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

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

Issue 8826005: Chrome-side change to support stdout/err to postmessage debug hookup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more PostMessage collision Created 9 years 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
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/service_runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/service_runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698