Chromium Code Reviews| Index: ppapi/native_client/src/trusted/plugin/plugin.cc |
| =================================================================== |
| --- ppapi/native_client/src/trusted/plugin/plugin.cc (revision 143163) |
| +++ ppapi/native_client/src/trusted/plugin/plugin.cc (working copy) |
| @@ -34,6 +34,7 @@ |
| #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
| #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" |
| #include "native_client/src/trusted/plugin/json_manifest.h" |
| +#include "native_client/src/trusted/plugin/nacl_entry_points.h" |
| #include "native_client/src/trusted/plugin/nacl_subprocess.h" |
| #include "native_client/src/trusted/plugin/nexe_arch.h" |
| #include "native_client/src/trusted/plugin/plugin_error.h" |
| @@ -609,6 +610,12 @@ |
| if (!service_runtime_started) { |
| return false; |
| } |
| + if (start_ppapi_proxy && start_ppapi_proxy(pp_instance())) { |
| + using_ipc_proxy_ = true; |
| + CHECK(init_done_cb.pp_completion_callback().func != NULL); |
| + PLUGIN_PRINTF(("Plugin::LoadNaClModuleCommon, started ipc proxy.\n")); |
| + pp::Module::Get()->core()->CallOnMainThread(0, init_done_cb, PP_OK); |
|
dmichael (off chromium)
2012/06/21 18:18:16
We probably ought to comment to explain this too..
bbudge
2012/06/21 19:28:18
Done.
|
| + } |
| return true; |
| } |
| @@ -631,6 +638,11 @@ |
| } |
| bool Plugin::LoadNaClModuleContinuationIntern(ErrorInfo* error_info) { |
| + // If we are using the IPC proxy, StartSrpcServices and StartJSObjectProxy |
| + // don't makes sense. Return 'true' so that the plugin continues loading. |
| + if (using_ipc_proxy_) |
| + return true; |
| + |
| if (!main_subprocess_.StartSrpcServices()) { |
| error_info->SetReport(ERROR_SRPC_CONNECTION_FAIL, |
| "SRPC connection failure for " + |
| @@ -862,7 +874,8 @@ |
| init_time_(0), |
| ready_time_(0), |
| nexe_size_(0), |
| - time_of_last_progress_event_(0) { |
| + time_of_last_progress_event_(0), |
| + using_ipc_proxy_(false) { |
| PLUGIN_PRINTF(("Plugin::Plugin (this=%p, pp_instance=%" |
| NACL_PRId32")\n", static_cast<void*>(this), pp_instance)); |
| callback_factory_.Initialize(this); |