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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 ui::GpuSwitchingManager::GetInstance()->AddObserver(this); | 650 ui::GpuSwitchingManager::GetInstance()->AddObserver(this); |
651 } | 651 } |
652 | 652 |
653 power_monitor_broadcaster_.Init(); | 653 power_monitor_broadcaster_.Init(); |
654 | 654 |
655 is_initialized_ = true; | 655 is_initialized_ = true; |
656 init_time_ = base::TimeTicks::Now(); | 656 init_time_ = base::TimeTicks::Now(); |
657 return true; | 657 return true; |
658 } | 658 } |
659 | 659 |
660 bool RenderProcessHostImpl::ShouldUseMojoChannel() const { | |
661 const base::CommandLine& command_line = | |
662 *base::CommandLine::ForCurrentProcess(); | |
663 return command_line.HasSwitch(switches::kEnableRendererMojoChannel) || | |
664 IPC::ChannelMojo::ShouldBeUsed(); | |
665 } | |
666 | |
667 scoped_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy( | 660 scoped_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy( |
668 const std::string& channel_id) { | 661 const std::string& channel_id) { |
669 scoped_refptr<base::SingleThreadTaskRunner> runner = | 662 scoped_refptr<base::SingleThreadTaskRunner> runner = |
670 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 663 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
671 if (ShouldUseMojoChannel()) { | 664 if (ShouldUseMojoChannel()) { |
672 VLOG(1) << "Mojo Channel is enabled on host"; | 665 VLOG(1) << "Mojo Channel is enabled on host"; |
673 if (!channel_mojo_host_) { | 666 if (!channel_mojo_host_) { |
674 channel_mojo_host_.reset(new IPC::ChannelMojoHost( | 667 channel_mojo_host_.reset(new IPC::ChannelMojoHost( |
675 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | 668 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); |
676 } | 669 } |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2395 if (worker_ref_count_ == 0) | 2388 if (worker_ref_count_ == 0) |
2396 Cleanup(); | 2389 Cleanup(); |
2397 } | 2390 } |
2398 | 2391 |
2399 void RenderProcessHostImpl::GetAudioOutputControllers( | 2392 void RenderProcessHostImpl::GetAudioOutputControllers( |
2400 const GetAudioOutputControllersCallback& callback) const { | 2393 const GetAudioOutputControllersCallback& callback) const { |
2401 audio_renderer_host()->GetOutputControllers(callback); | 2394 audio_renderer_host()->GetOutputControllers(callback); |
2402 } | 2395 } |
2403 | 2396 |
2404 } // namespace content | 2397 } // namespace content |
OLD | NEW |