Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 665993002: ChannelMojo: Add ChannelMojo::CanBeUsed() to enable it incrementally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 power_monitor_broadcaster_.Init(); 641 power_monitor_broadcaster_.Init();
642 642
643 is_initialized_ = true; 643 is_initialized_ = true;
644 init_time_ = base::TimeTicks::Now(); 644 init_time_ = base::TimeTicks::Now();
645 return true; 645 return true;
646 } 646 }
647 647
648 bool RenderProcessHostImpl::ShouldUseMojoChannel() const { 648 bool RenderProcessHostImpl::ShouldUseMojoChannel() const {
649 const base::CommandLine& command_line = 649 const base::CommandLine& command_line =
650 *base::CommandLine::ForCurrentProcess(); 650 *base::CommandLine::ForCurrentProcess();
651 return command_line.HasSwitch(switches::kEnableRendererMojoChannel); 651 return command_line.HasSwitch(switches::kEnableRendererMojoChannel) ||
652 IPC::ChannelMojo::ShouldBeUsed();
652 } 653 }
653 654
654 scoped_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy( 655 scoped_ptr<IPC::ChannelProxy> RenderProcessHostImpl::CreateChannelProxy(
655 const std::string& channel_id) { 656 const std::string& channel_id) {
656 scoped_refptr<base::SingleThreadTaskRunner> runner = 657 scoped_refptr<base::SingleThreadTaskRunner> runner =
657 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 658 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
658 if (ShouldUseMojoChannel()) { 659 if (ShouldUseMojoChannel()) {
659 VLOG(1) << "Mojo Channel is enabled on host"; 660 VLOG(1) << "Mojo Channel is enabled on host";
660 if (!channel_mojo_host_) { 661 if (!channel_mojo_host_) {
661 channel_mojo_host_.reset(new IPC::ChannelMojoHost( 662 channel_mojo_host_.reset(new IPC::ChannelMojoHost(
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 2231
2231 void RenderProcessHostImpl::DecrementWorkerRefCount() { 2232 void RenderProcessHostImpl::DecrementWorkerRefCount() {
2232 DCHECK_CURRENTLY_ON(BrowserThread::UI); 2233 DCHECK_CURRENTLY_ON(BrowserThread::UI);
2233 DCHECK_GT(worker_ref_count_, 0); 2234 DCHECK_GT(worker_ref_count_, 0);
2234 --worker_ref_count_; 2235 --worker_ref_count_;
2235 if (worker_ref_count_ == 0) 2236 if (worker_ref_count_ == 0)
2236 Cleanup(); 2237 Cleanup();
2237 } 2238 }
2238 2239
2239 } // namespace content 2240 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698