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

Side by Side Diff: chrome/nacl/nacl_listener.cc

Issue 10214007: Add an IPC channel between the NaCl loader process and the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/nacl/nacl_listener.h" 5 #include "chrome/nacl/nacl_listener.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return handled; 173 return handled;
174 } 174 }
175 175
176 void NaClListener::OnMsgStart(const nacl::NaClStartParams& params) { 176 void NaClListener::OnMsgStart(const nacl::NaClStartParams& params) {
177 struct NaClChromeMainArgs *args = NaClChromeMainArgsCreate(); 177 struct NaClChromeMainArgs *args = NaClChromeMainArgsCreate();
178 if (args == NULL) { 178 if (args == NULL) {
179 LOG(ERROR) << "NaClChromeMainArgsCreate() failed"; 179 LOG(ERROR) << "NaClChromeMainArgsCreate() failed";
180 return; 180 return;
181 } 181 }
182 182
183 scoped_ptr<IPC::SyncChannel> ipc_channel(
184 new IPC::SyncChannel(this, io_thread_.message_loop_proxy(),
185 &shutdown_event_));
186 ipc_channel->Init(params.channel_name, IPC::Channel::MODE_SERVER, true);
dmichael (off chromium) 2012/04/25 21:06:00 You're not doing anything with ipc_channel yet. Is
187
183 std::vector<nacl::FileDescriptor> handles = params.handles; 188 std::vector<nacl::FileDescriptor> handles = params.handles;
184 189
185 #if defined(OS_LINUX) || defined(OS_MACOSX) 190 #if defined(OS_LINUX) || defined(OS_MACOSX)
186 args->create_memory_object_func = CreateMemoryObject; 191 args->create_memory_object_func = CreateMemoryObject;
187 # if defined(OS_MACOSX) 192 # if defined(OS_MACOSX)
188 CHECK(handles.size() >= 1); 193 CHECK(handles.size() >= 1);
189 g_shm_fd = nacl::ToNativeHandle(handles[handles.size() - 1]); 194 g_shm_fd = nacl::ToNativeHandle(handles[handles.size() - 1]);
190 handles.pop_back(); 195 handles.pop_back();
191 # endif 196 # endif
192 #endif 197 #endif
(...skipping 24 matching lines...) Expand all
217 CHECK(handles.size() == 1); 222 CHECK(handles.size() == 1);
218 args->imc_bootstrap_handle = nacl::ToNativeHandle(handles[0]); 223 args->imc_bootstrap_handle = nacl::ToNativeHandle(handles[0]);
219 args->enable_exception_handling = params.enable_exception_handling; 224 args->enable_exception_handling = params.enable_exception_handling;
220 args->enable_debug_stub = debug_enabled_; 225 args->enable_debug_stub = debug_enabled_;
221 #if defined(OS_WIN) 226 #if defined(OS_WIN)
222 args->broker_duplicate_handle_func = BrokerDuplicateHandle; 227 args->broker_duplicate_handle_func = BrokerDuplicateHandle;
223 #endif 228 #endif
224 NaClChromeMainStart(args); 229 NaClChromeMainStart(args);
225 NOTREACHED(); 230 NOTREACHED();
226 } 231 }
OLDNEW
« chrome/browser/nacl_host/nacl_process_host.cc ('K') | « chrome/common/nacl_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698