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

Unified Diff: ppapi/proxy/plugin_main_nacl.cc

Issue 13866034: Pepper: Add VLOG support for NaCl plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small fixes Created 7 years, 8 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
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_main_nacl.cc
diff --git a/ppapi/proxy/plugin_main_nacl.cc b/ppapi/proxy/plugin_main_nacl.cc
index 8733b9c46748ba8c90d48d89ba7833c89bad0724..d32cad4e36e65b6e6886c6b48591fdbe45f3a170 100644
--- a/ppapi/proxy/plugin_main_nacl.cc
+++ b/ppapi/proxy/plugin_main_nacl.cc
@@ -11,6 +11,7 @@
// IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the
// ViewMsgLog et al. functions.
+#include "base/command_line.h"
#include "base/message_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
@@ -83,8 +84,7 @@ class PpapiDispatcher : public ProxyChannel,
private:
void OnMsgCreateNaClChannel(int renderer_id,
- const ppapi::PpapiPermissions& permissions,
- bool incognito,
+ const ppapi::PpapiNaClChannelArgs& args,
SerializedHandle handle);
void OnMsgResourceReply(
const ppapi::proxy::ResourceMessageReplyParams& reply_params,
@@ -179,18 +179,36 @@ bool PpapiDispatcher::OnMessageReceived(const IPC::Message& msg) {
return true;
}
+static bool create_channel_ran = false;
brettw 2013/04/11 22:42:09 I'd move this static to be inside the function you
+
void PpapiDispatcher::OnMsgCreateNaClChannel(
int renderer_id,
- const ppapi::PpapiPermissions& permissions,
- bool incognito,
+ const ppapi::PpapiNaClChannelArgs& args,
SerializedHandle handle) {
+ DCHECK(!create_channel_ran);
+ create_channel_ran = true;
+
+ CommandLine::Init(0, NULL);
+ for (size_t i = 0; i < args.switch_names.size(); ++i) {
+ DCHECK(i < args.switch_values.size());
+ CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ args.switch_names[i], args.switch_values[i]);
+ }
+ logging::InitLogging(
+ NULL,
+ logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
+ logging::DONT_LOCK_LOG_FILE,
+ logging::DELETE_OLD_LOG_FILE,
+ logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
+
// Tell the process-global GetInterface which interfaces it can return to the
// plugin.
ppapi::proxy::InterfaceList::SetProcessGlobalPermissions(
- permissions);
+ args.permissions);
PluginDispatcher* dispatcher =
- new PluginDispatcher(::PPP_GetInterface, permissions, incognito);
+ new PluginDispatcher(::PPP_GetInterface, args.permissions,
+ args.off_the_record);
// The channel handle's true name is not revealed here.
IPC::ChannelHandle channel_handle("nacl", handle.descriptor());
if (!dispatcher->InitPluginWithChannel(this, base::kNullProcessId,
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698