| Index: components/nacl/renderer/trusted_plugin_channel.cc
|
| diff --git a/components/nacl/renderer/trusted_plugin_channel.cc b/components/nacl/renderer/trusted_plugin_channel.cc
|
| index 30be80c89b91368db0dc5be8dfe3710c1094d49e..92733fd75846347f3ca69753b616159ca41974d9 100644
|
| --- a/components/nacl/renderer/trusted_plugin_channel.cc
|
| +++ b/components/nacl/renderer/trusted_plugin_channel.cc
|
| @@ -5,14 +5,20 @@
|
| #include "components/nacl/renderer/trusted_plugin_channel.h"
|
|
|
| #include "base/callback_helpers.h"
|
| +#include "base/strings/string_tokenizer.h"
|
| +#include "components/nacl/common/nacl_messages.h"
|
| #include "content/public/renderer/render_thread.h"
|
| #include "ipc/ipc_channel_proxy.h"
|
| +#include "ipc/ipc_message_macros.h"
|
| #include "ppapi/c/pp_errors.h"
|
| +#include "ppapi/shared_impl/ppapi_globals.h"
|
|
|
| namespace nacl {
|
|
|
| TrustedPluginChannel::TrustedPluginChannel(
|
| - const IPC::ChannelHandle& handle) {
|
| + PP_Instance instance,
|
| + const IPC::ChannelHandle& handle)
|
| + : instance_(instance) {
|
| channel_proxy_ = IPC::ChannelProxy::Create(
|
| handle,
|
| IPC::Channel::MODE_CLIENT,
|
| @@ -28,7 +34,24 @@ bool TrustedPluginChannel::Send(IPC::Message* message) {
|
| }
|
|
|
| bool TrustedPluginChannel::OnMessageReceived(const IPC::Message& message) {
|
| - return false;
|
| + bool handled = true;
|
| + IPC_BEGIN_MESSAGE_MAP(TrustedPluginChannel, message)
|
| + IPC_MESSAGE_HANDLER(NaClProcessHostMsg_FatalLogReceived,
|
| + OnFatalLogReceived)
|
| + IPC_MESSAGE_UNHANDLED(handled = false)
|
| + IPC_END_MESSAGE_MAP()
|
| + return handled;
|
| +}
|
| +
|
| +void TrustedPluginChannel::OnFatalLogReceived(const std::string& fatal_log) {
|
| + CHECK(ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->
|
| + BelongsToCurrentThread());
|
| +
|
| + base::StringTokenizer t(fatal_log, "\n");
|
| + while (t.GetNext()) {
|
| + ppapi::PpapiGlobals::Get()->LogWithSource(
|
| + instance_, PP_LOGLEVEL_LOG, std::string("NativeClient"), t.token());
|
| + }
|
| }
|
|
|
| } // namespace nacl
|
|
|