Index: ppapi/native_client/src/trusted/plugin/service_runtime.cc |
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc |
index c3a7f949b349ab0672bf5e815adb47cb42ff84db..c17f409e9f1bbf414d4355be0f02afebc743b3da 100644 |
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc |
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc |
@@ -33,12 +33,6 @@ |
#include "native_client/src/trusted/desc/nrd_xfer.h" |
#include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h" |
-// This is here due to a Windows API collision; plugin.h through |
-// file_downloader.h transitively includes Instance.h which defines a |
-// PostMessage method, so this undef must appear before any of those. |
-#ifdef PostMessage |
-#undef PostMessage |
-#endif |
#include "native_client/src/public/imc_types.h" |
#include "native_client/src/trusted/service_runtime/nacl_error_code.h" |
#include "native_client/src/trusted/validator/nacl_file_info.h" |
@@ -52,6 +46,7 @@ |
#include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h" |
#include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" |
#include "ppapi/native_client/src/trusted/plugin/srpc_client.h" |
+#include "ppapi/native_client/src/trusted/plugin/utility.h" |
#include "ppapi/native_client/src/trusted/weak_ref/call_on_main_thread.h" |
namespace plugin { |
@@ -226,15 +221,8 @@ void PluginReverseInterface::ShutDown() { |
} |
void PluginReverseInterface::DoPostMessage(nacl::string message) { |
- PostMessageResource* continuation = new PostMessageResource(message); |
- CHECK(continuation != NULL); |
- NaClLog(4, "PluginReverseInterface::DoPostMessage(%s)\n", message.c_str()); |
- plugin::WeakRefCallOnMainThread( |
- anchor_, |
- 0, /* delay in ms */ |
- this, |
- &plugin::PluginReverseInterface::PostMessage_MainThreadContinuation, |
- continuation); |
+ GetNaClInterface()->PostMessageToJavaScript(plugin_->pp_instance(), |
+ message.c_str()); |
} |
void PluginReverseInterface::StartupInitializationComplete() { |
@@ -251,16 +239,6 @@ void PluginReverseInterface::StartupInitializationComplete() { |
} |
} |
-void PluginReverseInterface::PostMessage_MainThreadContinuation( |
- PostMessageResource* p, |
- int32_t err) { |
- UNREFERENCED_PARAMETER(err); |
- NaClLog(4, |
- "PluginReverseInterface::PostMessage_MainThreadContinuation(%s)\n", |
- p->message.c_str()); |
- plugin_->PostMessage(std::string("DEBUG_POSTMESSAGE:") + p->message); |
-} |
- |
// TODO(bsy): OpenManifestEntry should use the manifest to ResolveKey |
// and invoke StreamAsFile with a completion callback that invokes |
// GetPOSIXFileDesc. |