MCPcopy Create free account
hub / github.com/awsm-research/LineVul / LoadNaClModuleCommon

Method LoadNaClModuleCommon

cppcheck/data/c_files/35.cpp:1–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1bool Plugin::LoadNaClModuleCommon(nacl::DescWrapper* wrapper,
2NaClSubprocess* subprocess,
3const Manifest* manifest,
4bool should_report_uma,
5ErrorInfo* error_info,
6pp::CompletionCallback init_done_cb,
7pp::CompletionCallback crash_cb) {
8ServiceRuntime* new_service_runtime =
9new ServiceRuntime(this, manifest, should_report_uma, init_done_cb,
10crash_cb);
11subprocess->set_service_runtime(new_service_runtime);
12PLUGIN_PRINTF(("Plugin::LoadNaClModuleCommon (service_runtime=%p)\n",
13static_cast<void*>(new_service_runtime)));
14if (NULL == new_service_runtime) {
15error_info->SetReport(ERROR_SEL_LDR_INIT,
16"sel_ldr init failure " + subprocess->description());
17return false;
18}
19
20bool service_runtime_started =
21 new_service_runtime->Start(wrapper,
22 error_info,
23 manifest_base_url());
24PLUGIN_PRINTF(("Plugin::LoadNaClModuleCommon (service_runtime_started=%d)\n",
25service_runtime_started));
26if (!service_runtime_started) {
27return false;
28}
29 // Try to start the Chrome IPC-based proxy.
30 const PPB_NaCl_Private* ppb_nacl = GetNaclInterface();
31 if (ppb_nacl->StartPpapiProxy(pp_instance())) {
32 using_ipc_proxy_ = true;
33 // We need to explicitly schedule this here. It is normally called in
34 // response to starting the SRPC proxy.
35 CHECK(init_done_cb.pp_completion_callback().func != NULL);
36 PLUGIN_PRINTF(("Plugin::LoadNaClModuleCommon, started ipc proxy.\n"));
37 pp::Module::Get()->core()->CallOnMainThread(0, init_done_cb, PP_OK);
38 }
39return true;
40}

Callers

nothing calls this directly

Calls 1

StartMethod · 0.80

Tested by

no test coverage detected