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 2461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2472 // happens. | 2472 // happens. |
2473 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, | 2473 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, |
2474 Source<RenderProcessHost>(this), | 2474 Source<RenderProcessHost>(this), |
2475 NotificationService::NoDetails()); | 2475 NotificationService::NoDetails()); |
2476 | 2476 |
2477 #if defined(MOJO_SHELL_CLIENT) | 2477 #if defined(MOJO_SHELL_CLIENT) |
2478 // Send the mojo shell handle to the renderer. | 2478 // Send the mojo shell handle to the renderer. |
2479 SendExternalMojoShellHandleToChild(GetHandle(), this); | 2479 SendExternalMojoShellHandleToChild(GetHandle(), this); |
2480 #endif | 2480 #endif |
2481 | 2481 |
2482 #if defined(OS_WIN) | |
2483 // TODO(jam): enable on POSIX | |
2484 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk") && | 2482 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk") && |
2485 child_process_launcher_.get()) { | 2483 child_process_launcher_.get()) { |
2486 base::ProcessHandle process_handle = | 2484 base::ProcessHandle process_handle = |
2487 child_process_launcher_->GetProcess().Handle(); | 2485 child_process_launcher_->GetProcess().Handle(); |
2488 mojo::embedder::ScopedPlatformHandle client_pipe = | 2486 mojo::embedder::ScopedPlatformHandle client_pipe = |
2489 mojo::embedder::ChildProcessLaunched(process_handle); | 2487 mojo::embedder::ChildProcessLaunched(process_handle); |
2490 Send(new ChildProcessMsg_SetMojoParentPipeHandle( | 2488 Send(new ChildProcessMsg_SetMojoParentPipeHandle( |
2491 IPC::GetFileHandleForProcess( | 2489 IPC::GetFileHandleForProcess( |
2492 #if defined(OS_WIN) | 2490 #if defined(OS_WIN) |
2493 client_pipe.release().handle, | 2491 client_pipe.release().handle, |
2494 #else | 2492 #else |
2495 client_pipe.release().fd, | 2493 client_pipe.release().fd, |
2496 #endif | 2494 #endif |
2497 process_handle, true))); | 2495 process_handle, true))); |
2498 } | 2496 } |
2499 #endif | |
2500 | 2497 |
2501 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. | 2498 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. |
2502 // This way, Mojo can be safely used from the renderer in response to any | 2499 // This way, Mojo can be safely used from the renderer in response to any |
2503 // Chrome IPC message. | 2500 // Chrome IPC message. |
2504 mojo_application_host_->Activate(this, GetHandle()); | 2501 mojo_application_host_->Activate(this, GetHandle()); |
2505 | 2502 |
2506 while (!queued_messages_.empty()) { | 2503 while (!queued_messages_.empty()) { |
2507 Send(queued_messages_.front()); | 2504 Send(queued_messages_.front()); |
2508 queued_messages_.pop(); | 2505 queued_messages_.pop(); |
2509 } | 2506 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2663 void RenderProcessHostImpl::GetAudioOutputControllers( | 2660 void RenderProcessHostImpl::GetAudioOutputControllers( |
2664 const GetAudioOutputControllersCallback& callback) const { | 2661 const GetAudioOutputControllersCallback& callback) const { |
2665 audio_renderer_host()->GetOutputControllers(callback); | 2662 audio_renderer_host()->GetOutputControllers(callback); |
2666 } | 2663 } |
2667 | 2664 |
2668 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2665 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2669 return bluetooth_dispatcher_host_.get(); | 2666 return bluetooth_dispatcher_host_.get(); |
2670 } | 2667 } |
2671 | 2668 |
2672 } // namespace content | 2669 } // namespace content |
OLD | NEW |