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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 #include "content/public/browser/notification_service.h" | 130 #include "content/public/browser/notification_service.h" |
131 #include "content/public/browser/notification_types.h" | 131 #include "content/public/browser/notification_types.h" |
132 #include "content/public/browser/render_process_host_factory.h" | 132 #include "content/public/browser/render_process_host_factory.h" |
133 #include "content/public/browser/render_process_host_observer.h" | 133 #include "content/public/browser/render_process_host_observer.h" |
134 #include "content/public/browser/render_widget_host.h" | 134 #include "content/public/browser/render_widget_host.h" |
135 #include "content/public/browser/render_widget_host_iterator.h" | 135 #include "content/public/browser/render_widget_host_iterator.h" |
136 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" | 136 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" |
137 #include "content/public/browser/resource_context.h" | 137 #include "content/public/browser/resource_context.h" |
138 #include "content/public/browser/user_metrics.h" | 138 #include "content/public/browser/user_metrics.h" |
139 #include "content/public/browser/worker_service.h" | 139 #include "content/public/browser/worker_service.h" |
| 140 #include "content/public/common/child_process_host.h" |
140 #include "content/public/common/content_constants.h" | 141 #include "content/public/common/content_constants.h" |
141 #include "content/public/common/content_switches.h" | 142 #include "content/public/common/content_switches.h" |
142 #include "content/public/common/mojo_channel_switches.h" | 143 #include "content/public/common/mojo_channel_switches.h" |
143 #include "content/public/common/process_type.h" | 144 #include "content/public/common/process_type.h" |
144 #include "content/public/common/resource_type.h" | 145 #include "content/public/common/resource_type.h" |
145 #include "content/public/common/result_codes.h" | 146 #include "content/public/common/result_codes.h" |
146 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 147 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
147 #include "content/public/common/url_constants.h" | 148 #include "content/public/common/url_constants.h" |
148 #include "device/battery/battery_monitor_impl.h" | 149 #include "device/battery/battery_monitor_impl.h" |
149 #include "device/vibration/vibration_manager_impl.h" | 150 #include "device/vibration/vibration_manager_impl.h" |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 711 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
711 scoped_refptr<base::SequencedTaskRunner> mojo_task_runner = | 712 scoped_refptr<base::SequencedTaskRunner> mojo_task_runner = |
712 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) | 713 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) |
713 ->task_runner(); | 714 ->task_runner(); |
714 if (ShouldUseMojoChannel()) { | 715 if (ShouldUseMojoChannel()) { |
715 VLOG(1) << "Mojo Channel is enabled on host"; | 716 VLOG(1) << "Mojo Channel is enabled on host"; |
716 if (!channel_mojo_host_) { | 717 if (!channel_mojo_host_) { |
717 channel_mojo_host_.reset(new IPC::ChannelMojoHost(mojo_task_runner)); | 718 channel_mojo_host_.reset(new IPC::ChannelMojoHost(mojo_task_runner)); |
718 } | 719 } |
719 | 720 |
720 return IPC::ChannelProxy::Create(IPC::ChannelMojo::CreateServerFactory( | 721 return IPC::ChannelProxy::Create( |
721 channel_mojo_host_->channel_delegate(), | 722 IPC::ChannelMojo::CreateServerFactory( |
722 mojo_task_runner, channel_id), | 723 channel_mojo_host_->channel_delegate(), mojo_task_runner, |
723 this, runner.get()); | 724 channel_id, content::ChildProcessHost::GetAttachmentBroker()), |
| 725 this, runner.get()); |
724 } | 726 } |
725 | 727 |
726 return IPC::ChannelProxy::Create( | 728 return IPC::ChannelProxy::Create( |
727 channel_id, IPC::Channel::MODE_SERVER, this, runner.get()); | 729 channel_id, IPC::Channel::MODE_SERVER, this, runner.get(), |
| 730 content::ChildProcessHost::GetAttachmentBroker()); |
728 } | 731 } |
729 | 732 |
730 void RenderProcessHostImpl::CreateMessageFilters() { | 733 void RenderProcessHostImpl::CreateMessageFilters() { |
731 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 734 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
732 const base::CommandLine& browser_command_line = | 735 const base::CommandLine& browser_command_line = |
733 *base::CommandLine::ForCurrentProcess(); | 736 *base::CommandLine::ForCurrentProcess(); |
734 AddFilter(new ResourceSchedulerFilter(GetID())); | 737 AddFilter(new ResourceSchedulerFilter(GetID())); |
735 MediaInternals* media_internals = MediaInternals::GetInstance(); | 738 MediaInternals* media_internals = MediaInternals::GetInstance(); |
736 media::AudioManager* audio_manager = | 739 media::AudioManager* audio_manager = |
737 BrowserMainLoop::GetInstance()->audio_manager(); | 740 BrowserMainLoop::GetInstance()->audio_manager(); |
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2492 void RenderProcessHostImpl::GetAudioOutputControllers( | 2495 void RenderProcessHostImpl::GetAudioOutputControllers( |
2493 const GetAudioOutputControllersCallback& callback) const { | 2496 const GetAudioOutputControllersCallback& callback) const { |
2494 audio_renderer_host()->GetOutputControllers(callback); | 2497 audio_renderer_host()->GetOutputControllers(callback); |
2495 } | 2498 } |
2496 | 2499 |
2497 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2500 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2498 return bluetooth_dispatcher_host_.get(); | 2501 return bluetooth_dispatcher_host_.get(); |
2499 } | 2502 } |
2500 | 2503 |
2501 } // namespace content | 2504 } // namespace content |
OLD | NEW |