| OLD | NEW |
| 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 notify_child_disconnected_ = false; | 400 notify_child_disconnected_ = false; |
| 401 delete delegate_; // Will delete us | 401 delete delegate_; // Will delete us |
| 402 } | 402 } |
| 403 | 403 |
| 404 void BrowserChildProcessHostImpl::OnProcessLaunched() { | 404 void BrowserChildProcessHostImpl::OnProcessLaunched() { |
| 405 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 405 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 406 | 406 |
| 407 const base::Process& process = child_process_->GetProcess(); | 407 const base::Process& process = child_process_->GetProcess(); |
| 408 DCHECK(process.IsValid()); | 408 DCHECK(process.IsValid()); |
| 409 | 409 |
| 410 mojo::edk::ScopedPlatformHandle client_pipe = | |
| 411 mojo::edk::ChildProcessLaunched(process.Handle()); | |
| 412 Send(new ChildProcessMsg_SetMojoParentPipeHandle( | |
| 413 IPC::GetPlatformFileForTransit(client_pipe.release().handle, true))); | |
| 414 | |
| 415 #if defined(OS_WIN) | 410 #if defined(OS_WIN) |
| 416 // Start a WaitableEventWatcher that will invoke OnProcessExitedEarly if the | 411 // Start a WaitableEventWatcher that will invoke OnProcessExitedEarly if the |
| 417 // child process exits. This watcher is stopped once the IPC channel is | 412 // child process exits. This watcher is stopped once the IPC channel is |
| 418 // connected and the exit of the child process is detecter by an error on the | 413 // connected and the exit of the child process is detecter by an error on the |
| 419 // IPC channel thereafter. | 414 // IPC channel thereafter. |
| 420 DCHECK(!early_exit_watcher_.GetWatchedObject()); | 415 DCHECK(!early_exit_watcher_.GetWatchedObject()); |
| 421 early_exit_watcher_.StartWatchingOnce(process.Handle(), this); | 416 early_exit_watcher_.StartWatchingOnce(process.Handle(), this); |
| 422 #endif | 417 #endif |
| 423 | 418 |
| 424 // TODO(rvargas) crbug.com/417532: Don't store a handle. | 419 // TODO(rvargas) crbug.com/417532: Don't store a handle. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 440 | 435 |
| 441 #if defined(OS_WIN) | 436 #if defined(OS_WIN) |
| 442 | 437 |
| 443 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 438 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
| 444 OnChildDisconnected(); | 439 OnChildDisconnected(); |
| 445 } | 440 } |
| 446 | 441 |
| 447 #endif | 442 #endif |
| 448 | 443 |
| 449 } // namespace content | 444 } // namespace content |
| OLD | NEW |