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

Unified Diff: ppapi/native_client/src/trusted/plugin/plugin.cc

Issue 338353008: NaCl: clean up nexe loading logic in trusted plugin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + resolve conflicts Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
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 a9969ce74457b11ae31ca258af6eedf5f7ea8890..902e050c69e5a831c1cbd4cbe2b00857a888bf18 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -117,17 +117,13 @@ bool Plugin::LoadHelperNaClModule(PP_FileHandle file_handle,
// We can't use pp::BlockUntilComplete() inside an in-process plugin, so we
// have to roll our own blocking logic, similar to WaitForSelLdrStart()
// above, except without timeout logic.
- bool nexe_started = false;
- pp::CompletionCallback nexe_started_callback = callback_factory_.NewCallback(
- &Plugin::SignalNexeStarted, &nexe_started, service_runtime);
pp::Module::Get()->core()->CallOnMainThread(
0,
callback_factory_.NewCallback(
&Plugin::LoadNexeAndStart,
- service_runtime, info, nexe_started_callback));
- service_runtime->WaitForNexeStart();
-
- return nexe_started;
+ service_runtime,
+ info));
+ return service_runtime->WaitForNexeStart();
}
void Plugin::StartSelLdrOnMainThread(int32_t pp_error,
@@ -150,13 +146,6 @@ void Plugin::SignalStartSelLdrDone(int32_t pp_error,
service_runtime->SignalStartSelLdrDone();
}
-void Plugin::SignalNexeStarted(int32_t pp_error,
- bool* started,
- ServiceRuntime* service_runtime) {
- *started = (pp_error == PP_OK);
- service_runtime->SignalNexeStarted();
-}
-
void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
bool uses_nonsfi_mode,
bool enable_dyncode_syscalls,
@@ -209,20 +198,18 @@ void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
// 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,
- service_runtime, file_info_for_srpc, pp::CompletionCallback());
+ &Plugin::LoadNexeAndStart, service_runtime, file_info_for_srpc);
StartSelLdrOnMainThread(
static_cast<int32_t>(PP_OK), service_runtime, params, callback);
}
void Plugin::LoadNexeAndStart(int32_t pp_error,
ServiceRuntime* service_runtime,
- PP_NaClFileInfo file_info,
- const pp::CompletionCallback& callback) {
+ PP_NaClFileInfo file_info) {
CHECK(pp::Module::Get()->core()->IsMainThread());
if (pp_error != PP_OK)
return;
- service_runtime->LoadNexeAndStart(file_info, callback);
+ service_runtime->LoadNexeAndStart(file_info);
}
bool Plugin::LoadNaClModuleContinuationIntern() {
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/plugin.h ('k') | ppapi/native_client/src/trusted/plugin/service_runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698