| Index: ppapi/native_client/src/trusted/plugin/plugin.cc
|
| diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
|
| index 8edd127f032739e4e6f7d9e31aea08a8c7e509cf..c559db30f3820fd45e4549bdcaa93107f77980d6 100644
|
| --- a/ppapi/native_client/src/trusted/plugin/plugin.cc
|
| +++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
|
| @@ -113,10 +113,16 @@ bool Plugin::LoadNaClModuleFromBackgroundThread(
|
| // have to roll our own blocking logic, similar to WaitForSelLdrStart()
|
| // above, except without timeout logic.
|
| bool nexe_started = false;
|
| - pp::CompletionCallback started_cb = callback_factory_.NewCallback(
|
| + pp::CompletionCallback nexe_started_callback = callback_factory_.NewCallback(
|
| &Plugin::SignalNexeStarted, &nexe_started, service_runtime);
|
| - service_runtime->LoadNexeAndStart(info, started_cb, pp::CompletionCallback());
|
| +
|
| + pp::Module::Get()->core()->CallOnMainThread(
|
| + 0,
|
| + callback_factory_.NewCallback(
|
| + &Plugin::LoadNexeAndStart,
|
| + service_runtime, info, nexe_started_callback));
|
| service_runtime->WaitForNexeStart();
|
| +
|
| return nexe_started;
|
| }
|
|
|
| @@ -185,23 +191,23 @@ void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
|
| return;
|
| }
|
|
|
| + // We don't take any action once nexe loading has completed, so pass an empty
|
| + // callback here for |callback|.
|
| pp::CompletionCallback callback = callback_factory_.NewCallback(
|
| - &Plugin::LoadNexeAndStart, file_info, service_runtime, crash_cb);
|
| + &Plugin::LoadNexeAndStart,
|
| + service_runtime, file_info, pp::CompletionCallback());
|
| StartSelLdrOnMainThread(
|
| static_cast<int32_t>(PP_OK), service_runtime, params, callback);
|
| }
|
|
|
| void Plugin::LoadNexeAndStart(int32_t pp_error,
|
| - PP_NaClFileInfo file_info,
|
| ServiceRuntime* service_runtime,
|
| - const pp::CompletionCallback& crash_cb) {
|
| + PP_NaClFileInfo file_info,
|
| + const pp::CompletionCallback& callback) {
|
| + CHECK(pp::Module::Get()->core()->IsMainThread());
|
| if (pp_error != PP_OK)
|
| return;
|
| -
|
| - // We don't take any action once nexe loading has completed, so pass an empty
|
| - // callback here for |loaded_cb|.
|
| - service_runtime->LoadNexeAndStart(file_info, pp::CompletionCallback(),
|
| - crash_cb);
|
| + service_runtime->LoadNexeAndStart(file_info, callback);
|
| }
|
|
|
| bool Plugin::LoadNaClModuleContinuationIntern() {
|
|
|