OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2438 Source<RenderProcessHost>(this), | 2438 Source<RenderProcessHost>(this), |
2439 NotificationService::NoDetails()); | 2439 NotificationService::NoDetails()); |
2440 | 2440 |
2441 #if defined(MOJO_SHELL_CLIENT) | 2441 #if defined(MOJO_SHELL_CLIENT) |
2442 // Send a handle that the external Mojo shell can use to pass an Application | 2442 // Send a handle that the external Mojo shell can use to pass an Application |
2443 // request to the child. | 2443 // request to the child. |
2444 RegisterChildWithExternalShell(id_, GetHandle(), this); | 2444 RegisterChildWithExternalShell(id_, GetHandle(), this); |
2445 #endif | 2445 #endif |
2446 | 2446 |
2447 #if defined(OS_WIN) | 2447 #if defined(OS_WIN) |
| 2448 // TODO(jam): enable on POSIX |
2448 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk") && | 2449 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk") && |
2449 child_process_launcher_.get()) { | 2450 child_process_launcher_.get()) { |
2450 HANDLE process_handle = child_process_launcher_->GetProcess().Handle(); | 2451 base::ProcessHandle process_handle = |
2451 HANDLE client_pipe = mojo::embedder::ChildProcessLaunched(process_handle); | 2452 child_process_launcher_->GetProcess().Handle(); |
| 2453 mojo::embedder::ScopedPlatformHandle client_pipe = |
| 2454 mojo::embedder::ChildProcessLaunched(process_handle); |
2452 Send(new ChildProcessMsg_SetMojoParentPipeHandle( | 2455 Send(new ChildProcessMsg_SetMojoParentPipeHandle( |
2453 IPC::GetFileHandleForProcess(client_pipe, process_handle, true))); | 2456 IPC::GetFileHandleForProcess( |
| 2457 #if defined(OS_WIN) |
| 2458 client_pipe.release().handle, |
| 2459 #else |
| 2460 client_pipe.release().fd, |
| 2461 #endif |
| 2462 process_handle, true))); |
2454 } | 2463 } |
2455 #endif | 2464 #endif |
2456 | 2465 |
2457 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. | 2466 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. |
2458 // This way, Mojo can be safely used from the renderer in response to any | 2467 // This way, Mojo can be safely used from the renderer in response to any |
2459 // Chrome IPC message. | 2468 // Chrome IPC message. |
2460 mojo_application_host_->Activate(this, GetHandle()); | 2469 mojo_application_host_->Activate(this, GetHandle()); |
2461 | 2470 |
2462 while (!queued_messages_.empty()) { | 2471 while (!queued_messages_.empty()) { |
2463 Send(queued_messages_.front()); | 2472 Send(queued_messages_.front()); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2619 void RenderProcessHostImpl::GetAudioOutputControllers( | 2628 void RenderProcessHostImpl::GetAudioOutputControllers( |
2620 const GetAudioOutputControllersCallback& callback) const { | 2629 const GetAudioOutputControllersCallback& callback) const { |
2621 audio_renderer_host()->GetOutputControllers(callback); | 2630 audio_renderer_host()->GetOutputControllers(callback); |
2622 } | 2631 } |
2623 | 2632 |
2624 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2633 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2625 return bluetooth_dispatcher_host_.get(); | 2634 return bluetooth_dispatcher_host_.get(); |
2626 } | 2635 } |
2627 | 2636 |
2628 } // namespace content | 2637 } // namespace content |
OLD | NEW |