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

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, 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 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 ppapi_channel_.reset(
184 new IPC::SyncChannel(this, io_thread_.message_loop_proxy(),
185 &shutdown_event_));
186 ppapi_channel_->Init(
187 params.ppapi_channel_name, IPC::Channel::MODE_SERVER, true);
188
183 std::vector<nacl::FileDescriptor> handles = params.handles; 189 std::vector<nacl::FileDescriptor> handles = params.handles;
184 190
185 #if defined(OS_LINUX) || defined(OS_MACOSX) 191 #if defined(OS_LINUX) || defined(OS_MACOSX)
186 args->create_memory_object_func = CreateMemoryObject; 192 args->create_memory_object_func = CreateMemoryObject;
187 # if defined(OS_MACOSX) 193 # if defined(OS_MACOSX)
188 CHECK(handles.size() >= 1); 194 CHECK(handles.size() >= 1);
189 g_shm_fd = nacl::ToNativeHandle(handles[handles.size() - 1]); 195 g_shm_fd = nacl::ToNativeHandle(handles[handles.size() - 1]);
190 handles.pop_back(); 196 handles.pop_back();
191 # endif 197 # endif
192 #endif 198 #endif
(...skipping 24 matching lines...) Expand all
217 CHECK(handles.size() == 1); 223 CHECK(handles.size() == 1);
218 args->imc_bootstrap_handle = nacl::ToNativeHandle(handles[0]); 224 args->imc_bootstrap_handle = nacl::ToNativeHandle(handles[0]);
219 args->enable_exception_handling = params.enable_exception_handling; 225 args->enable_exception_handling = params.enable_exception_handling;
220 args->enable_debug_stub = debug_enabled_; 226 args->enable_debug_stub = debug_enabled_;
221 #if defined(OS_WIN) 227 #if defined(OS_WIN)
222 args->broker_duplicate_handle_func = BrokerDuplicateHandle; 228 args->broker_duplicate_handle_func = BrokerDuplicateHandle;
223 #endif 229 #endif
224 NaClChromeMainStart(args); 230 NaClChromeMainStart(args);
225 NOTREACHED(); 231 NOTREACHED();
226 } 232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698