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 // 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 #include "content/browser/storage_partition_impl.h" | 103 #include "content/browser/storage_partition_impl.h" |
104 #include "content/browser/streams/stream_context.h" | 104 #include "content/browser/streams/stream_context.h" |
105 #include "content/browser/tracing/trace_message_filter.h" | 105 #include "content/browser/tracing/trace_message_filter.h" |
106 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 106 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
107 #include "content/common/child_process_host_impl.h" | 107 #include "content/common/child_process_host_impl.h" |
108 #include "content/common/child_process_messages.h" | 108 #include "content/common/child_process_messages.h" |
109 #include "content/common/content_switches_internal.h" | 109 #include "content/common/content_switches_internal.h" |
110 #include "content/common/frame_messages.h" | 110 #include "content/common/frame_messages.h" |
111 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 111 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
112 #include "content/common/gpu/gpu_messages.h" | 112 #include "content/common/gpu/gpu_messages.h" |
113 #include "content/common/mojo/channel_init.h" | |
113 #include "content/common/mojo/mojo_messages.h" | 114 #include "content/common/mojo/mojo_messages.h" |
114 #include "content/common/resource_messages.h" | 115 #include "content/common/resource_messages.h" |
115 #include "content/common/view_messages.h" | 116 #include "content/common/view_messages.h" |
116 #include "content/public/browser/browser_context.h" | 117 #include "content/public/browser/browser_context.h" |
117 #include "content/public/browser/content_browser_client.h" | 118 #include "content/public/browser/content_browser_client.h" |
118 #include "content/public/browser/navigator_connect_context.h" | 119 #include "content/public/browser/navigator_connect_context.h" |
119 #include "content/public/browser/notification_service.h" | 120 #include "content/public/browser/notification_service.h" |
120 #include "content/public/browser/notification_types.h" | 121 #include "content/public/browser/notification_types.h" |
121 #include "content/public/browser/render_process_host_factory.h" | 122 #include "content/public/browser/render_process_host_factory.h" |
122 #include "content/public/browser/render_process_host_observer.h" | 123 #include "content/public/browser/render_process_host_observer.h" |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
657 init_time_ = base::TimeTicks::Now(); | 658 init_time_ = base::TimeTicks::Now(); |
658 return true; | 659 return true; |
659 } | 660 } |
660 | 661 |
661 scoped_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy( | 662 scoped_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy( |
662 const std::string& channel_id) { | 663 const std::string& channel_id) { |
663 scoped_refptr<base::SingleThreadTaskRunner> runner = | 664 scoped_refptr<base::SingleThreadTaskRunner> runner = |
664 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 665 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
665 if (ShouldUseMojoChannel()) { | 666 if (ShouldUseMojoChannel()) { |
666 VLOG(1) << "Mojo Channel is enabled on host"; | 667 VLOG(1) << "Mojo Channel is enabled on host"; |
668 scoped_refptr<base::TaskRunner> io_task_runner = | |
669 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) | |
670 ->task_runner(); | |
667 if (!channel_mojo_host_) { | 671 if (!channel_mojo_host_) { |
668 channel_mojo_host_.reset(new IPC::ChannelMojoHost( | 672 channel_mojo_host_.reset(new IPC::ChannelMojoHost(io_task_runner)); |
669 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | 673 } |
674 | |
675 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
jam
2015/03/03 04:32:22
use run_renderer_in_process()
Ken Rockot(use gerrit already)
2015/03/03 06:13:31
Done.
| |
676 switches::kSingleProcess)) { | |
677 ChannelInit::SetSingleProcessIOTaskRunner(io_task_runner); | |
670 } | 678 } |
671 | 679 |
672 return IPC::ChannelProxy::Create( | 680 return IPC::ChannelProxy::Create( |
673 IPC::ChannelMojo::CreateServerFactory( | 681 IPC::ChannelMojo::CreateServerFactory( |
674 channel_mojo_host_->channel_delegate(), channel_id), | 682 channel_mojo_host_->channel_delegate(), channel_id), |
675 this, | 683 this, |
676 runner.get()); | 684 runner.get()); |
677 } | 685 } |
678 | 686 |
679 return IPC::ChannelProxy::Create( | 687 return IPC::ChannelProxy::Create( |
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2390 if (worker_ref_count_ == 0) | 2398 if (worker_ref_count_ == 0) |
2391 Cleanup(); | 2399 Cleanup(); |
2392 } | 2400 } |
2393 | 2401 |
2394 void RenderProcessHostImpl::GetAudioOutputControllers( | 2402 void RenderProcessHostImpl::GetAudioOutputControllers( |
2395 const GetAudioOutputControllersCallback& callback) const { | 2403 const GetAudioOutputControllersCallback& callback) const { |
2396 audio_renderer_host()->GetOutputControllers(callback); | 2404 audio_renderer_host()->GetOutputControllers(callback); |
2397 } | 2405 } |
2398 | 2406 |
2399 } // namespace content | 2407 } // namespace content |
OLD | NEW |