Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Side by Side Diff: ppapi/native_client/src/trusted/plugin/plugin.cc

Issue 10214007: Add an IPC channel between the NaCl loader process and the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifdef _MSC_VER 5 #ifdef _MSC_VER
6 // Do not warn about use of std::copy with raw pointers. 6 // Do not warn about use of std::copy with raw pointers.
7 #pragma warning(disable : 4996) 7 #pragma warning(disable : 4996)
8 #endif 8 #endif
9 9
10 #include "native_client/src/trusted/plugin/plugin.h" 10 #include "native_client/src/trusted/plugin/plugin.h"
(...skipping 16 matching lines...) Expand all
27 #include "native_client/src/include/nacl_scoped_ptr.h" 27 #include "native_client/src/include/nacl_scoped_ptr.h"
28 #include "native_client/src/include/nacl_string.h" 28 #include "native_client/src/include/nacl_string.h"
29 #include "native_client/src/include/portability.h" 29 #include "native_client/src/include/portability.h"
30 #include "native_client/src/include/portability_io.h" 30 #include "native_client/src/include/portability_io.h"
31 #include "native_client/src/include/portability_string.h" 31 #include "native_client/src/include/portability_string.h"
32 #include "native_client/src/shared/platform/nacl_check.h" 32 #include "native_client/src/shared/platform/nacl_check.h"
33 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" 33 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h"
34 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" 34 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
35 #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" 35 #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h"
36 #include "native_client/src/trusted/plugin/json_manifest.h" 36 #include "native_client/src/trusted/plugin/json_manifest.h"
37 #include "native_client/src/trusted/plugin/nacl_entry_points.h"
37 #include "native_client/src/trusted/plugin/nacl_subprocess.h" 38 #include "native_client/src/trusted/plugin/nacl_subprocess.h"
38 #include "native_client/src/trusted/plugin/nexe_arch.h" 39 #include "native_client/src/trusted/plugin/nexe_arch.h"
39 #include "native_client/src/trusted/plugin/plugin_error.h" 40 #include "native_client/src/trusted/plugin/plugin_error.h"
40 #include "native_client/src/trusted/plugin/scriptable_plugin.h" 41 #include "native_client/src/trusted/plugin/scriptable_plugin.h"
41 #include "native_client/src/trusted/plugin/service_runtime.h" 42 #include "native_client/src/trusted/plugin/service_runtime.h"
42 #include "native_client/src/trusted/plugin/utility.h" 43 #include "native_client/src/trusted/plugin/utility.h"
43 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" 44 #include "native_client/src/trusted/service_runtime/nacl_error_code.h"
44 45
45 #include "ppapi/c/dev/ppb_console_dev.h" 46 #include "ppapi/c/dev/ppb_console_dev.h"
46 #include "ppapi/c/dev/ppp_find_dev.h" 47 #include "ppapi/c/dev/ppp_find_dev.h"
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 if (NaClSrpcServiceMethodIndex(client_service, 1208 if (NaClSrpcServiceMethodIndex(client_service,
1208 "PPP_InitializeModule:ihs:i") == 1209 "PPP_InitializeModule:ihs:i") ==
1209 kNaClSrpcInvalidMethodIndex) { 1210 kNaClSrpcInvalidMethodIndex) {
1210 error_info->SetReport( 1211 error_info->SetReport(
1211 ERROR_START_PROXY_CHECK_PPP, 1212 ERROR_START_PROXY_CHECK_PPP,
1212 "could not find PPP_InitializeModule() - toolchain version mismatch?"); 1213 "could not find PPP_InitializeModule() - toolchain version mismatch?");
1213 PLUGIN_PRINTF(("Plugin::StartProxiedExecution (%s)\n", 1214 PLUGIN_PRINTF(("Plugin::StartProxiedExecution (%s)\n",
1214 error_info->message().c_str())); 1215 error_info->message().c_str()));
1215 return false; 1216 return false;
1216 } 1217 }
1218
1219 if (start_ppapi_proxy && start_ppapi_proxy(pp_instance())) {
1220 return true;
1221 }
1222
1217 nacl::scoped_ptr<BrowserPpp> ppapi_proxy(new BrowserPpp(srpc_channel, this)); 1223 nacl::scoped_ptr<BrowserPpp> ppapi_proxy(new BrowserPpp(srpc_channel, this));
1218 PLUGIN_PRINTF(("Plugin::StartProxiedExecution (ppapi_proxy=%p)\n", 1224 PLUGIN_PRINTF(("Plugin::StartProxiedExecution (ppapi_proxy=%p)\n",
1219 static_cast<void*>(ppapi_proxy.get()))); 1225 static_cast<void*>(ppapi_proxy.get())));
1220 if (ppapi_proxy.get() == NULL) { 1226 if (ppapi_proxy.get() == NULL) {
1221 error_info->SetReport(ERROR_START_PROXY_ALLOC, 1227 error_info->SetReport(ERROR_START_PROXY_ALLOC,
1222 "could not allocate proxy memory."); 1228 "could not allocate proxy memory.");
1223 return false; 1229 return false;
1224 } 1230 }
1225 pp::Module* module = pp::Module::Get(); 1231 pp::Module* module = pp::Module::Get();
1226 PLUGIN_PRINTF(("Plugin::StartProxiedExecution (module=%p)\n", 1232 PLUGIN_PRINTF(("Plugin::StartProxiedExecution (module=%p)\n",
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1904 static_cast<uint32_t>(text.size())); 1910 static_cast<uint32_t>(text.size()));
1905 const PPB_Console_Dev* console_interface = 1911 const PPB_Console_Dev* console_interface =
1906 static_cast<const PPB_Console_Dev*>( 1912 static_cast<const PPB_Console_Dev*>(
1907 module->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE)); 1913 module->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE));
1908 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str); 1914 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str);
1909 var_interface->Release(prefix); 1915 var_interface->Release(prefix);
1910 var_interface->Release(str); 1916 var_interface->Release(str);
1911 } 1917 }
1912 1918
1913 } // namespace plugin 1919 } // namespace plugin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698