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

Side by Side Diff: content/browser/browser_child_process_host_impl.cc

Issue 1488853002: Add multiplexing of message pipes in the new EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tsepez review comments Created 5 years 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
« no previous file with comments | « components/web_view/frame.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/browser_child_process_host_impl.h" 5 #include "content/browser/browser_child_process_host_impl.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/dump_without_crashing.h" 10 #include "base/debug/dump_without_crashing.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 delegate_->OnProcessLaunchFailed(); 394 delegate_->OnProcessLaunchFailed();
395 delete delegate_; // Will delete us 395 delete delegate_; // Will delete us
396 } 396 }
397 397
398 void BrowserChildProcessHostImpl::OnProcessLaunched() { 398 void BrowserChildProcessHostImpl::OnProcessLaunched() {
399 DCHECK_CURRENTLY_ON(BrowserThread::IO); 399 DCHECK_CURRENTLY_ON(BrowserThread::IO);
400 400
401 const base::Process& process = child_process_->GetProcess(); 401 const base::Process& process = child_process_->GetProcess();
402 DCHECK(process.IsValid()); 402 DCHECK(process.IsValid());
403 403
404 #if defined(OS_WIN)
405 // TODO(jam): enable on POSIX
406 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) { 404 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) {
407 mojo::embedder::ScopedPlatformHandle client_pipe = 405 mojo::embedder::ScopedPlatformHandle client_pipe =
408 mojo::embedder::ChildProcessLaunched(process.Handle()); 406 mojo::embedder::ChildProcessLaunched(process.Handle());
409 Send(new ChildProcessMsg_SetMojoParentPipeHandle( 407 Send(new ChildProcessMsg_SetMojoParentPipeHandle(
410 IPC::GetFileHandleForProcess( 408 IPC::GetFileHandleForProcess(
411 #if defined(OS_WIN) 409 #if defined(OS_WIN)
412 client_pipe.release().handle, 410 client_pipe.release().handle,
413 #else 411 #else
414 client_pipe.release().fd, 412 client_pipe.release().fd,
415 #endif 413 #endif
416 process.Handle(), true))); 414 process.Handle(), true)));
417 } 415 }
418 #endif
419 416
420 #if defined(OS_WIN) 417 #if defined(OS_WIN)
421 // Start a WaitableEventWatcher that will invoke OnProcessExitedEarly if the 418 // Start a WaitableEventWatcher that will invoke OnProcessExitedEarly if the
422 // child process exits. This watcher is stopped once the IPC channel is 419 // child process exits. This watcher is stopped once the IPC channel is
423 // connected and the exit of the child process is detecter by an error on the 420 // connected and the exit of the child process is detecter by an error on the
424 // IPC channel thereafter. 421 // IPC channel thereafter.
425 DCHECK(!early_exit_watcher_.GetWatchedObject()); 422 DCHECK(!early_exit_watcher_.GetWatchedObject());
426 early_exit_watcher_.StartWatchingOnce(process.Handle(), this); 423 early_exit_watcher_.StartWatchingOnce(process.Handle(), this);
427 #endif 424 #endif
428 425
(...skipping 16 matching lines...) Expand all
445 442
446 #if defined(OS_WIN) 443 #if defined(OS_WIN)
447 444
448 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { 445 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) {
449 OnChildDisconnected(); 446 OnChildDisconnected();
450 } 447 }
451 448
452 #endif 449 #endif
453 450
454 } // namespace content 451 } // namespace content
OLDNEW
« no previous file with comments | « components/web_view/frame.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698