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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 139993009: [WIP] Yet another demo for BMM NaCl ppapi connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
Index: components/nacl/browser/nacl_process_host.cc
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index e6e8ef450177a7df62ee5ecad6db1c6c26430689..1d4fbe5800cffe12f9804c09d155fd1b967c3a16 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -770,6 +770,28 @@ bool NaClProcessHost::StartNaClExecution() {
}
#endif
+ // TODO Propagate command line flags and permissions.
+#if 0
+ // TODO move to StartNaCl
+ ppapi::PpapiNaClChannelArgs args;
+ args.off_the_record = nacl_host_message_filter_->off_the_record();
+ args.permissions = permissions_;
+ CommandLine* cmdline = CommandLine::ForCurrentProcess();
+ DCHECK(cmdline);
+ std::string flag_whitelist[] = {
+ switches::kPpapiKeepAliveThrottle,
+ switches::kV,
+ switches::kVModule,
+ };
+ for (size_t i = 0; i < arraysize(flag_whitelist); ++i) {
+ std::string value = cmdline->GetSwitchValueASCII(flag_whitelist[i]);
+ if (!value.empty()) {
+ args.switch_names.push_back(flag_whitelist[i]);
+ args.switch_values.push_back(value);
+ }
+ }
+#endif
+
process_->Send(new NaClProcessMsg_Start(params));
internal_->socket_for_sel_ldr = NACL_INVALID_HANDLE;
@@ -787,14 +809,15 @@ bool NaClProcessHost::SendStart() {
// This method is called when NaClProcessHostMsg_PpapiChannelCreated is
// received.
void NaClProcessHost::OnPpapiBrowserChannelCreated(
- const IPC::ChannelHandle& channel_handle) {
+ const IPC::ChannelHandle& browser_channel_handle,
+ const IPC::ChannelHandle& renderer_channel_handle) {
// Only renderer processes should create a channel.
DCHECK(enable_ppapi_proxy());
if (!ipc_proxy_channel_.get()) {
DCHECK_EQ(PROCESS_TYPE_NACL_LOADER, process_->GetData().process_type);
ipc_proxy_channel_.reset(
- new IPC::ChannelProxy(channel_handle,
+ new IPC::ChannelProxy(browser_channel_handle,
IPC::Channel::MODE_CLIENT,
&ipc_plugin_listener_,
base::MessageLoopProxy::current().get()));
@@ -811,36 +834,12 @@ void NaClProcessHost::OnPpapiBrowserChannelCreated(
ppapi_host_->SetOnKeepaliveCallback(
NaClBrowser::GetDelegate()->GetOnKeepaliveCallback());
- ppapi::PpapiNaClChannelArgs args;
- args.off_the_record = nacl_host_message_filter_->off_the_record();
- args.permissions = permissions_;
- CommandLine* cmdline = CommandLine::ForCurrentProcess();
- DCHECK(cmdline);
- std::string flag_whitelist[] = {
- switches::kPpapiKeepAliveThrottle,
- switches::kV,
- switches::kVModule,
- };
- for (size_t i = 0; i < arraysize(flag_whitelist); ++i) {
- std::string value = cmdline->GetSwitchValueASCII(flag_whitelist[i]);
- if (!value.empty()) {
- args.switch_names.push_back(flag_whitelist[i]);
- args.switch_values.push_back(value);
- }
- }
-
ppapi_host_->GetPpapiHost()->AddHostFactoryFilter(
scoped_ptr<ppapi::host::HostFactory>(
NaClBrowser::GetDelegate()->CreatePpapiHostFactory(
ppapi_host_.get())));
- // Send a message to create the NaCl-Renderer channel. The handle is just
- // a place holder.
- ipc_proxy_channel_->Send(
- new PpapiMsg_CreateNaClChannel(
Mark Seaborn 2014/02/04 01:18:31 I think you will want to keep the PpapiMsg_CreateN
- args,
- SerializedHandle(SerializedHandle::CHANNEL_HANDLE,
- IPC::InvalidPlatformFileForTransit())));
+ ReplyToRenderer(renderer_channel_handle);
} else {
// Attempt to open more than 1 browser channel is not supported.
// Shut down the NaCl process.

Powered by Google App Engine
This is Rietveld 408576698