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

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

Issue 2398783002: Rename a bunch of Mojo Application stuff to reference Services. (Closed)
Patch Set: . Created 4 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
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 <utility> 10 #include <utility>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 #include "content/renderer/media/peer_connection_tracker.h" 194 #include "content/renderer/media/peer_connection_tracker.h"
195 #include "content/renderer/media/rtc_peer_connection_handler.h" 195 #include "content/renderer/media/rtc_peer_connection_handler.h"
196 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 196 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
197 #endif 197 #endif
198 198
199 #ifdef ENABLE_VTUNE_JIT_INTERFACE 199 #ifdef ENABLE_VTUNE_JIT_INTERFACE
200 #include "v8/src/third_party/vtune/v8-vtune.h" 200 #include "v8/src/third_party/vtune/v8-vtune.h"
201 #endif 201 #endif
202 202
203 #if defined(USE_AURA) 203 #if defined(USE_AURA)
204 #include "content/public/common/mojo_shell_connection.h" 204 #include "content/public/common/service_manager_connection.h"
205 #include "content/renderer/mus/render_widget_mus_connection.h" 205 #include "content/renderer/mus/render_widget_mus_connection.h"
206 #include "content/renderer/mus/render_widget_window_tree_client_factory.h" 206 #include "content/renderer/mus/render_widget_window_tree_client_factory.h"
207 #include "services/ui/public/cpp/gpu_service.h" 207 #include "services/ui/public/cpp/gpu_service.h"
208 #endif 208 #endif
209 209
210 #if defined(ENABLE_IPC_FUZZER) 210 #if defined(ENABLE_IPC_FUZZER)
211 #include "content/common/external_ipc_dumper.h" 211 #include "content/common/external_ipc_dumper.h"
212 #endif 212 #endif
213 213
214 using base::ThreadRestrictions; 214 using base::ThreadRestrictions;
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 mojom::RenderMessageFilter* render_message_filter) { 593 mojom::RenderMessageFilter* render_message_filter) {
594 g_render_message_filter_for_testing = render_message_filter; 594 g_render_message_filter_for_testing = render_message_filter;
595 } 595 }
596 596
597 RenderThreadImpl::RenderThreadImpl( 597 RenderThreadImpl::RenderThreadImpl(
598 const InProcessChildThreadParams& params, 598 const InProcessChildThreadParams& params,
599 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler, 599 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler,
600 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) 600 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue)
601 : ChildThreadImpl(Options::Builder() 601 : ChildThreadImpl(Options::Builder()
602 .InBrowserProcess(params) 602 .InBrowserProcess(params)
603 .AutoStartMojoShellConnection(false) 603 .AutoStartServiceManagerConnection(false)
604 .ConnectToBrowser(true) 604 .ConnectToBrowser(true)
605 .Build()), 605 .Build()),
606 renderer_scheduler_(std::move(scheduler)), 606 renderer_scheduler_(std::move(scheduler)),
607 time_zone_monitor_binding_(this), 607 time_zone_monitor_binding_(this),
608 categorized_worker_pool_(new CategorizedWorkerPool()), 608 categorized_worker_pool_(new CategorizedWorkerPool()),
609 renderer_binding_(this) { 609 renderer_binding_(this) {
610 Init(resource_task_queue); 610 Init(resource_task_queue);
611 } 611 }
612 612
613 // When we run plugins in process, we actually run them on the render thread, 613 // When we run plugins in process, we actually run them on the render thread,
614 // which means that we need to make the render thread pump UI events. 614 // which means that we need to make the render thread pump UI events.
615 RenderThreadImpl::RenderThreadImpl( 615 RenderThreadImpl::RenderThreadImpl(
616 std::unique_ptr<base::MessageLoop> main_message_loop, 616 std::unique_ptr<base::MessageLoop> main_message_loop,
617 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler) 617 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler)
618 : ChildThreadImpl(Options::Builder() 618 : ChildThreadImpl(Options::Builder()
619 .AutoStartMojoShellConnection(false) 619 .AutoStartServiceManagerConnection(false)
620 .ConnectToBrowser(true) 620 .ConnectToBrowser(true)
621 .Build()), 621 .Build()),
622 renderer_scheduler_(std::move(scheduler)), 622 renderer_scheduler_(std::move(scheduler)),
623 time_zone_monitor_binding_(this), 623 time_zone_monitor_binding_(this),
624 main_message_loop_(std::move(main_message_loop)), 624 main_message_loop_(std::move(main_message_loop)),
625 categorized_worker_pool_(new CategorizedWorkerPool()), 625 categorized_worker_pool_(new CategorizedWorkerPool()),
626 renderer_binding_(this) { 626 renderer_binding_(this) {
627 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; 627 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter;
628 Init(test_task_counter); 628 Init(test_task_counter);
629 } 629 }
(...skipping 12 matching lines...) Expand all
642 #endif 642 #endif
643 643
644 lazy_tls.Pointer()->Set(this); 644 lazy_tls.Pointer()->Set(this);
645 645
646 // Register this object as the main thread. 646 // Register this object as the main thread.
647 ChildProcess::current()->set_main_thread(this); 647 ChildProcess::current()->set_main_thread(this);
648 648
649 #if defined(USE_AURA) 649 #if defined(USE_AURA)
650 if (IsRunningInMash()) { 650 if (IsRunningInMash()) {
651 gpu_service_ = 651 gpu_service_ =
652 ui::GpuService::Create(GetMojoShellConnection()->GetConnector(), 652 ui::GpuService::Create(GetServiceManagerConnection()->GetConnector(),
653 ChildProcess::current()->io_task_runner()); 653 ChildProcess::current()->io_task_runner());
654 } 654 }
655 #endif 655 #endif
656 gpu_memory_buffer_manager_ = 656 gpu_memory_buffer_manager_ =
657 base::MakeUnique<ChildGpuMemoryBufferManager>(thread_safe_sender()); 657 base::MakeUnique<ChildGpuMemoryBufferManager>(thread_safe_sender());
658 658
659 InitializeWebKit(resource_task_queue); 659 InitializeWebKit(resource_task_queue);
660 660
661 // In single process the single process is all there is. 661 // In single process the single process is all there is.
662 webkit_shared_timer_suspended_ = false; 662 webkit_shared_timer_suspended_ = false;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 723
724 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter()); 724 AddFilter((new IndexedDBMessageFilter(thread_safe_sender()))->GetFilter());
725 725
726 AddFilter((new CacheStorageMessageFilter(thread_safe_sender()))->GetFilter()); 726 AddFilter((new CacheStorageMessageFilter(thread_safe_sender()))->GetFilter());
727 727
728 AddFilter((new ServiceWorkerContextMessageFilter())->GetFilter()); 728 AddFilter((new ServiceWorkerContextMessageFilter())->GetFilter());
729 729
730 #if defined(USE_AURA) 730 #if defined(USE_AURA)
731 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 731 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
732 switches::kUseMusInRenderer)) { 732 switches::kUseMusInRenderer)) {
733 CreateRenderWidgetWindowTreeClientFactory(GetMojoShellConnection()); 733 CreateRenderWidgetWindowTreeClientFactory(GetServiceManagerConnection());
734 } 734 }
735 #endif 735 #endif
736 736
737 // Must be called before RenderThreadStarted() below. 737 // Must be called before RenderThreadStarted() below.
738 StartMojoShellConnection(); 738 StartServiceManagerConnection();
739 739
740 GetContentClient()->renderer()->RenderThreadStarted(); 740 GetContentClient()->renderer()->RenderThreadStarted();
741 741
742 GetAssociatedInterfaceRegistry()->AddInterface( 742 GetAssociatedInterfaceRegistry()->AddInterface(
743 base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest, 743 base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest,
744 base::Unretained(this))); 744 base::Unretained(this)));
745 745
746 InitSkiaEventTracer(); 746 InitSkiaEventTracer();
747 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 747 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
748 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); 748 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr);
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 bool use_software, 1824 bool use_software,
1825 int routing_id, 1825 int routing_id,
1826 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, 1826 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue,
1827 const GURL& url) { 1827 const GURL& url) {
1828 const base::CommandLine& command_line = 1828 const base::CommandLine& command_line =
1829 *base::CommandLine::ForCurrentProcess(); 1829 *base::CommandLine::ForCurrentProcess();
1830 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) 1830 if (command_line.HasSwitch(switches::kDisableGpuCompositing))
1831 use_software = true; 1831 use_software = true;
1832 1832
1833 #if defined(USE_AURA) 1833 #if defined(USE_AURA)
1834 if (GetMojoShellConnection() && !use_software && 1834 if (GetServiceManagerConnection() && !use_software &&
1835 command_line.HasSwitch(switches::kUseMusInRenderer)) { 1835 command_line.HasSwitch(switches::kUseMusInRenderer)) {
1836 RenderWidgetMusConnection* connection = 1836 RenderWidgetMusConnection* connection =
1837 RenderWidgetMusConnection::GetOrCreate(routing_id); 1837 RenderWidgetMusConnection::GetOrCreate(routing_id);
1838 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host = 1838 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host =
1839 EstablishGpuChannelSync(); 1839 EstablishGpuChannelSync();
1840 return connection->CreateCompositorFrameSink(std::move(gpu_channel_host)); 1840 return connection->CreateCompositorFrameSink(std::move(gpu_channel_host));
1841 } 1841 }
1842 #endif 1842 #endif
1843 1843
1844 uint32_t compositor_frame_sink_id = g_next_compositor_frame_sink_id++; 1844 uint32_t compositor_frame_sink_id = g_next_compositor_frame_sink_id++;
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
2329 } 2329 }
2330 } 2330 }
2331 2331
2332 void RenderThreadImpl::OnRendererInterfaceRequest( 2332 void RenderThreadImpl::OnRendererInterfaceRequest(
2333 mojom::RendererAssociatedRequest request) { 2333 mojom::RendererAssociatedRequest request) {
2334 DCHECK(!renderer_binding_.is_bound()); 2334 DCHECK(!renderer_binding_.is_bound());
2335 renderer_binding_.Bind(std::move(request)); 2335 renderer_binding_.Bind(std::move(request));
2336 } 2336 }
2337 2337
2338 } // namespace content 2338 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698