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

Side by Side Diff: components/nacl/loader/nacl_listener.cc

Issue 418423002: Pepper: Stop using SRPC for irt_open_resource(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/nacl/loader/nacl_listener.h" 5 #include "components/nacl/loader/nacl_listener.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #if defined(OS_POSIX) 10 #if defined(OS_POSIX)
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 struct NaClApp* nap = NULL; 282 struct NaClApp* nap = NULL;
283 NaClChromeMainInit(); 283 NaClChromeMainInit();
284 nap = NaClAppCreate(); 284 nap = NaClAppCreate();
285 if (nap == NULL) { 285 if (nap == NULL) {
286 LOG(ERROR) << "NaClAppCreate() failed"; 286 LOG(ERROR) << "NaClAppCreate() failed";
287 return; 287 return;
288 } 288 }
289 289
290 IPC::ChannelHandle browser_handle; 290 IPC::ChannelHandle browser_handle;
291 IPC::ChannelHandle ppapi_renderer_handle; 291 IPC::ChannelHandle ppapi_renderer_handle;
292 IPC::ChannelHandle manifest_service_handle;
292 293
293 if (params.enable_ipc_proxy) { 294 if (params.enable_ipc_proxy) {
294 browser_handle = IPC::Channel::GenerateVerifiedChannelID("nacl"); 295 browser_handle = IPC::Channel::GenerateVerifiedChannelID("nacl");
295 ppapi_renderer_handle = IPC::Channel::GenerateVerifiedChannelID("nacl"); 296 ppapi_renderer_handle = IPC::Channel::GenerateVerifiedChannelID("nacl");
297 manifest_service_handle = IPC::Channel::GenerateVerifiedChannelID("nacl");
296 298
297 // Create the PPAPI IPC channels between the NaCl IRT and the host 299 // Create the PPAPI IPC channels between the NaCl IRT and the host
298 // (browser/renderer) processes. The IRT uses these channels to 300 // (browser/renderer) processes. The IRT uses these channels to
299 // communicate with the host and to initialize the IPC dispatchers. 301 // communicate with the host and to initialize the IPC dispatchers.
300 SetUpIPCAdapter(&browser_handle, io_thread_.message_loop_proxy(), 302 SetUpIPCAdapter(&browser_handle, io_thread_.message_loop_proxy(),
301 nap, NACL_CHROME_DESC_BASE); 303 nap, NACL_CHROME_DESC_BASE);
302 SetUpIPCAdapter(&ppapi_renderer_handle, io_thread_.message_loop_proxy(), 304 SetUpIPCAdapter(&ppapi_renderer_handle, io_thread_.message_loop_proxy(),
303 nap, NACL_CHROME_DESC_BASE + 1); 305 nap, NACL_CHROME_DESC_BASE + 1);
306 SetUpIPCAdapter(&manifest_service_handle, io_thread_.message_loop_proxy(),
307 nap, NACL_CHROME_DESC_BASE + 2);
304 } 308 }
305 309
306 IPC::ChannelHandle trusted_renderer_handle = CreateTrustedListener( 310 IPC::ChannelHandle trusted_renderer_handle = CreateTrustedListener(
307 io_thread_.message_loop_proxy(), &shutdown_event_); 311 io_thread_.message_loop_proxy(), &shutdown_event_);
308 if (!Send(new NaClProcessHostMsg_PpapiChannelsCreated( 312 if (!Send(new NaClProcessHostMsg_PpapiChannelsCreated(
309 browser_handle, ppapi_renderer_handle, 313 browser_handle, ppapi_renderer_handle,
310 trusted_renderer_handle, IPC::ChannelHandle()))) 314 trusted_renderer_handle, manifest_service_handle)))
311 LOG(ERROR) << "Failed to send IPC channel handle to NaClProcessHost."; 315 LOG(ERROR) << "Failed to send IPC channel handle to NaClProcessHost.";
312 316
313 std::vector<nacl::FileDescriptor> handles = params.handles; 317 std::vector<nacl::FileDescriptor> handles = params.handles;
314 struct NaClChromeMainArgs* args = NaClChromeMainArgsCreate(); 318 struct NaClChromeMainArgs* args = NaClChromeMainArgsCreate();
315 if (args == NULL) { 319 if (args == NULL) {
316 LOG(ERROR) << "NaClChromeMainArgsCreate() failed"; 320 LOG(ERROR) << "NaClChromeMainArgsCreate() failed";
317 return; 321 return;
318 } 322 }
319 323
320 #if defined(OS_LINUX) || defined(OS_MACOSX) 324 #if defined(OS_LINUX) || defined(OS_MACOSX)
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 IPC::ChannelHandle trusted_renderer_handle = 492 IPC::ChannelHandle trusted_renderer_handle =
489 IPC::Channel::GenerateVerifiedChannelID("nacl"); 493 IPC::Channel::GenerateVerifiedChannelID("nacl");
490 trusted_listener_ = new NaClTrustedListener( 494 trusted_listener_ = new NaClTrustedListener(
491 trusted_renderer_handle, io_thread_.message_loop_proxy().get()); 495 trusted_renderer_handle, io_thread_.message_loop_proxy().get());
492 #if defined(OS_POSIX) 496 #if defined(OS_POSIX)
493 trusted_renderer_handle.socket = base::FileDescriptor( 497 trusted_renderer_handle.socket = base::FileDescriptor(
494 trusted_listener_->TakeClientFileDescriptor(), true); 498 trusted_listener_->TakeClientFileDescriptor(), true);
495 #endif 499 #endif
496 return trusted_renderer_handle; 500 return trusted_renderer_handle;
497 } 501 }
OLDNEW
« no previous file with comments | « no previous file | components/nacl/renderer/manifest_service_channel.cc » ('j') | ppapi/nacl_irt/irt_ppapi.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698