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

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

Issue 131413009: Prototype: Use Chromium IPC for plugin LOAD_MODULE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased, some FIXMEs cleaned up Created 6 years, 10 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/sel_ldr_launcher_chrome.cc
diff --git a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
index 486696bce53f2683a345a62652508840ffa6e73e..8802a6354bfe70f51c7be1bda98ea080ffedc840 100644
--- a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
+++ b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
@@ -3,11 +3,13 @@
// found in the LICENSE file.
#include "native_client/src/include/nacl_macros.h"
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/pp_var.h"
+#include "ppapi/cpp/completion_callback.h"
+#include "ppapi/cpp/module.h"
#include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h"
#include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h"
-#include "ppapi/cpp/var.h"
-
LaunchNaClProcessFunc launch_nacl_process = NULL;
namespace plugin {
@@ -17,7 +19,7 @@ bool SelLdrLauncherChrome::Start(const char* url) {
return false;
}
-bool SelLdrLauncherChrome::Start(PP_Instance instance,
+void SelLdrLauncherChrome::Start(PP_Instance instance,
const char* url,
bool uses_irt,
bool uses_ppapi,
@@ -25,29 +27,28 @@ bool SelLdrLauncherChrome::Start(PP_Instance instance,
bool enable_dyncode_syscalls,
bool enable_exception_handling,
bool enable_crash_throttling,
- nacl::string* error_message) {
- *error_message = "";
- if (!launch_nacl_process)
- return false;
- PP_Var var_error_message;
- // send a synchronous message to the browser process
- if (launch_nacl_process(instance,
- url,
- PP_FromBool(uses_irt),
- PP_FromBool(uses_ppapi),
- PP_FromBool(enable_ppapi_dev),
- PP_FromBool(enable_dyncode_syscalls),
- PP_FromBool(enable_exception_handling),
- PP_FromBool(enable_crash_throttling),
- &channel_,
- &var_error_message) != PP_EXTERNAL_PLUGIN_OK) {
- pp::Var var_error_message_cpp(pp::PASS_REF, var_error_message);
- if (var_error_message_cpp.is_string()) {
- *error_message = var_error_message_cpp.AsString();
- }
- return false;
+ PP_Var* error_message,
+ PP_CompletionCallback callback) {
+ if (!launch_nacl_process) {
+ pp::CompletionCallback cc(callback.func,
+ callback.user_data,
+ callback.flags);
+ pp::Module::Get()->core()->CallOnMainThread(
+ 0, cc, static_cast<int32_t>(PP_ERROR_FAILED));
+ return;
}
- return true;
+ // send a synchronous message to the browser process
+ launch_nacl_process(instance,
+ url,
+ PP_FromBool(uses_irt),
+ PP_FromBool(uses_ppapi),
+ PP_FromBool(enable_ppapi_dev),
+ PP_FromBool(enable_dyncode_syscalls),
+ PP_FromBool(enable_exception_handling),
+ PP_FromBool(enable_crash_throttling),
+ &channel_,
+ error_message,
+ callback);
}
} // namespace plugin

Powered by Google App Engine
This is Rietveld 408576698