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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 974933002: content: Refactor ChildThreadImpl::Options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 5 years, 9 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
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 #include "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 426 }
427 } 427 }
428 428
429 RenderThreadImpl* RenderThreadImpl::current() { 429 RenderThreadImpl* RenderThreadImpl::current() {
430 return lazy_tls.Pointer()->Get(); 430 return lazy_tls.Pointer()->Get();
431 } 431 }
432 432
433 // When we run plugins in process, we actually run them on the render thread, 433 // When we run plugins in process, we actually run them on the render thread,
434 // which means that we need to make the render thread pump UI events. 434 // which means that we need to make the render thread pump UI events.
435 RenderThreadImpl::RenderThreadImpl() 435 RenderThreadImpl::RenderThreadImpl()
436 : ChildThreadImpl(Options(ShouldUseMojoChannel())) { 436 : ChildThreadImpl(Options::Builder()
437 .InBrowserProcess(true)
438 .UseMojoChannel(ShouldUseMojoChannel())
439 .Build()) {
437 Init(); 440 Init();
438 } 441 }
439 442
440 RenderThreadImpl::RenderThreadImpl(const std::string& channel_name) 443 RenderThreadImpl::RenderThreadImpl(const std::string& channel_name)
441 : ChildThreadImpl(Options(channel_name, ShouldUseMojoChannel())) { 444 : ChildThreadImpl(Options::Builder()
445 .InBrowserProcess(true)
446 .UseMojoChannel(ShouldUseMojoChannel())
447 .WithChannelName(channel_name)
448 .Build()) {
442 Init(); 449 Init();
443 } 450 }
444 451
445 RenderThreadImpl::RenderThreadImpl( 452 RenderThreadImpl::RenderThreadImpl(
446 scoped_ptr<base::MessageLoop> main_message_loop) 453 scoped_ptr<base::MessageLoop> main_message_loop)
447 : ChildThreadImpl(Options(ShouldUseMojoChannel())), 454 : ChildThreadImpl(Options::Builder()
455 .InBrowserProcess(true)
no sievers 2015/03/04 19:10:49 Has this been wrong even before your patch? This i
Sami 2015/03/04 19:21:16 Yes, that's one of the reasons why I wanted to do
456 .UseMojoChannel(ShouldUseMojoChannel())
457 .Build()),
448 main_message_loop_(main_message_loop.Pass()) { 458 main_message_loop_(main_message_loop.Pass()) {
449 Init(); 459 Init();
450 } 460 }
451 461
452 void RenderThreadImpl::Init() { 462 void RenderThreadImpl::Init() {
453 TRACE_EVENT_BEGIN_ETW("RenderThreadImpl::Init", 0, ""); 463 TRACE_EVENT_BEGIN_ETW("RenderThreadImpl::Init", 0, "");
454 464
455 base::trace_event::TraceLog::GetInstance()->SetThreadSortIndex( 465 base::trace_event::TraceLog::GetInstance()->SetThreadSortIndex(
456 base::PlatformThread::CurrentId(), 466 base::PlatformThread::CurrentId(),
457 kTraceEventRendererMainThreadSortIndex); 467 kTraceEventRendererMainThreadSortIndex);
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 mojo::InterfaceRequest<mojo::ServiceProvider> services, 1829 mojo::InterfaceRequest<mojo::ServiceProvider> services,
1820 mojo::ServiceProviderPtr exposed_services) 1830 mojo::ServiceProviderPtr exposed_services)
1821 : services(services.Pass()), 1831 : services(services.Pass()),
1822 exposed_services(exposed_services.Pass()) { 1832 exposed_services(exposed_services.Pass()) {
1823 } 1833 }
1824 1834
1825 RenderThreadImpl::PendingRenderFrameConnect::~PendingRenderFrameConnect() { 1835 RenderThreadImpl::PendingRenderFrameConnect::~PendingRenderFrameConnect() {
1826 } 1836 }
1827 1837
1828 } // namespace content 1838 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698