| 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 2431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2442 // happens. | 2442 // happens. |
| 2443 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, | 2443 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, |
| 2444 Source<RenderProcessHost>(this), | 2444 Source<RenderProcessHost>(this), |
| 2445 NotificationService::NoDetails()); | 2445 NotificationService::NoDetails()); |
| 2446 | 2446 |
| 2447 #if defined(MOJO_SHELL_CLIENT) | 2447 #if defined(MOJO_SHELL_CLIENT) |
| 2448 // Send the mojo shell handle to the renderer. | 2448 // Send the mojo shell handle to the renderer. |
| 2449 SendExternalMojoShellHandleToChild(GetHandle(), this); | 2449 SendExternalMojoShellHandleToChild(GetHandle(), this); |
| 2450 #endif | 2450 #endif |
| 2451 | 2451 |
| 2452 #if defined(OS_WIN) | |
| 2453 // TODO(jam): enable on POSIX | |
| 2454 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk") && | 2452 if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk") && |
| 2455 child_process_launcher_.get()) { | 2453 child_process_launcher_.get()) { |
| 2456 base::ProcessHandle process_handle = | 2454 base::ProcessHandle process_handle = |
| 2457 child_process_launcher_->GetProcess().Handle(); | 2455 child_process_launcher_->GetProcess().Handle(); |
| 2458 mojo::embedder::ScopedPlatformHandle client_pipe = | 2456 mojo::embedder::ScopedPlatformHandle client_pipe = |
| 2459 mojo::embedder::ChildProcessLaunched(process_handle); | 2457 mojo::embedder::ChildProcessLaunched(process_handle); |
| 2460 Send(new ChildProcessMsg_SetMojoParentPipeHandle( | 2458 Send(new ChildProcessMsg_SetMojoParentPipeHandle( |
| 2461 IPC::GetFileHandleForProcess( | 2459 IPC::GetFileHandleForProcess( |
| 2462 #if defined(OS_WIN) | 2460 #if defined(OS_WIN) |
| 2463 client_pipe.release().handle, | 2461 client_pipe.release().handle, |
| 2464 #else | 2462 #else |
| 2465 client_pipe.release().fd, | 2463 client_pipe.release().fd, |
| 2466 #endif | 2464 #endif |
| 2467 process_handle, true))); | 2465 process_handle, true))); |
| 2468 } | 2466 } |
| 2469 #endif | |
| 2470 | 2467 |
| 2471 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. | 2468 // Allow Mojo to be setup before the renderer sees any Chrome IPC messages. |
| 2472 // This way, Mojo can be safely used from the renderer in response to any | 2469 // This way, Mojo can be safely used from the renderer in response to any |
| 2473 // Chrome IPC message. | 2470 // Chrome IPC message. |
| 2474 mojo_application_host_->Activate(this, GetHandle()); | 2471 mojo_application_host_->Activate(this, GetHandle()); |
| 2475 | 2472 |
| 2476 while (!queued_messages_.empty()) { | 2473 while (!queued_messages_.empty()) { |
| 2477 Send(queued_messages_.front()); | 2474 Send(queued_messages_.front()); |
| 2478 queued_messages_.pop(); | 2475 queued_messages_.pop(); |
| 2479 } | 2476 } |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2633 void RenderProcessHostImpl::GetAudioOutputControllers( | 2630 void RenderProcessHostImpl::GetAudioOutputControllers( |
| 2634 const GetAudioOutputControllersCallback& callback) const { | 2631 const GetAudioOutputControllersCallback& callback) const { |
| 2635 audio_renderer_host()->GetOutputControllers(callback); | 2632 audio_renderer_host()->GetOutputControllers(callback); |
| 2636 } | 2633 } |
| 2637 | 2634 |
| 2638 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2635 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
| 2639 return bluetooth_dispatcher_host_.get(); | 2636 return bluetooth_dispatcher_host_.get(); |
| 2640 } | 2637 } |
| 2641 | 2638 |
| 2642 } // namespace content | 2639 } // namespace content |
| OLD | NEW |