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 cf1c29af4e1c445962ffa119efaa3513c2735526..ccc333a9bd917d89ce3d2da040b339275af1338d 100644 |
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc |
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc |
@@ -51,6 +51,11 @@ |
#include "ppapi/cpp/core.h" |
#include "ppapi/cpp/completion_callback.h" |
+// This is here due to a Windows API collision. |
+#ifdef PostMessage |
+#undef PostMessage |
+#endif |
dmichael (off chromium)
2011/12/07 19:02:13
Wouldn't it have worked to just move this above th
bsy
2011/12/07 21:18:32
you were looking at an old change set. this chang
|
+ |
using std::vector; |
namespace plugin { |
@@ -97,6 +102,18 @@ void PluginReverseInterface::Log(nacl::string message) { |
continuation); |
} |
+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 */ |
+ ALLOW_THIS_IN_INITIALIZER_LIST(this), |
+ &plugin::PluginReverseInterface::PostMessage_MainThreadContinuation, |
+ continuation); |
+} |
+ |
void PluginReverseInterface::StartupInitializationComplete() { |
NaClLog(0, "PluginReverseInterface::StartupInitializationComplete\n"); |
if (init_done_cb_.pp_completion_callback().func != NULL) { |
@@ -121,6 +138,15 @@ void PluginReverseInterface::Log_MainThreadContinuation( |
plugin_->browser_interface()->AddToConsole(static_cast<Plugin*>(plugin_), |
p->message); |
} |
+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); |
+} |
bool PluginReverseInterface::EnumerateManifestKeys( |
std::set<nacl::string>* out_keys) { |