Chromium Code Reviews| 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 #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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 #include "content/common/gpu_process_launch_causes.h" | 75 #include "content/common/gpu_process_launch_causes.h" |
| 76 #include "content/common/render_frame_setup.mojom.h" | 76 #include "content/common/render_frame_setup.mojom.h" |
| 77 #include "content/common/render_process_messages.h" | 77 #include "content/common/render_process_messages.h" |
| 78 #include "content/common/resource_messages.h" | 78 #include "content/common/resource_messages.h" |
| 79 #include "content/common/service_worker/embedded_worker_setup.mojom.h" | 79 #include "content/common/service_worker/embedded_worker_setup.mojom.h" |
| 80 #include "content/common/view_messages.h" | 80 #include "content/common/view_messages.h" |
| 81 #include "content/common/worker_messages.h" | 81 #include "content/common/worker_messages.h" |
| 82 #include "content/public/common/content_constants.h" | 82 #include "content/public/common/content_constants.h" |
| 83 #include "content/public/common/content_paths.h" | 83 #include "content/public/common/content_paths.h" |
| 84 #include "content/public/common/content_switches.h" | 84 #include "content/public/common/content_switches.h" |
| 85 #include "content/public/common/mojo_channel_switches.h" | |
| 86 #include "content/public/common/renderer_preferences.h" | 85 #include "content/public/common/renderer_preferences.h" |
| 87 #include "content/public/common/url_constants.h" | 86 #include "content/public/common/url_constants.h" |
| 88 #include "content/public/renderer/content_renderer_client.h" | 87 #include "content/public/renderer/content_renderer_client.h" |
| 89 #include "content/public/renderer/render_thread_observer.h" | 88 #include "content/public/renderer/render_thread_observer.h" |
| 90 #include "content/public/renderer/render_view_visitor.h" | 89 #include "content/public/renderer/render_view_visitor.h" |
| 91 #include "content/renderer/bluetooth/bluetooth_message_filter.h" | 90 #include "content/renderer/bluetooth/bluetooth_message_filter.h" |
| 92 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 91 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
| 93 #include "content/renderer/cache_storage/cache_storage_dispatcher.h" | 92 #include "content/renderer/cache_storage/cache_storage_dispatcher.h" |
| 94 #include "content/renderer/cache_storage/cache_storage_message_filter.h" | 93 #include "content/renderer/cache_storage/cache_storage_message_filter.h" |
| 95 #include "content/renderer/devtools/devtools_agent_filter.h" | 94 #include "content/renderer/devtools/devtools_agent_filter.h" |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 | 565 |
| 567 RenderThreadImpl* RenderThreadImpl::current() { | 566 RenderThreadImpl* RenderThreadImpl::current() { |
| 568 return lazy_tls.Pointer()->Get(); | 567 return lazy_tls.Pointer()->Get(); |
| 569 } | 568 } |
| 570 | 569 |
| 571 RenderThreadImpl::RenderThreadImpl( | 570 RenderThreadImpl::RenderThreadImpl( |
| 572 const InProcessChildThreadParams& params, | 571 const InProcessChildThreadParams& params, |
| 573 std::unique_ptr<scheduler::RendererScheduler> scheduler, | 572 std::unique_ptr<scheduler::RendererScheduler> scheduler, |
| 574 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) | 573 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) |
| 575 : ChildThreadImpl(Options::Builder() | 574 : ChildThreadImpl(Options::Builder() |
| 576 .InBrowserProcess(params) | 575 .InBrowserProcess(params).UseMojoChannel(true).Build()), |
| 577 .UseMojoChannel(ShouldUseMojoChannel()) | |
| 578 .Build()), | |
| 579 renderer_scheduler_(std::move(scheduler)), | 576 renderer_scheduler_(std::move(scheduler)), |
| 580 raster_worker_pool_(new RasterWorkerPool()) { | 577 raster_worker_pool_(new RasterWorkerPool()) { |
| 581 Init(resource_task_queue); | 578 Init(resource_task_queue); |
| 582 } | 579 } |
| 583 | 580 |
| 584 // When we run plugins in process, we actually run them on the render thread, | 581 // When we run plugins in process, we actually run them on the render thread, |
| 585 // which means that we need to make the render thread pump UI events. | 582 // which means that we need to make the render thread pump UI events. |
| 586 RenderThreadImpl::RenderThreadImpl( | 583 RenderThreadImpl::RenderThreadImpl( |
| 587 std::unique_ptr<base::MessageLoop> main_message_loop, | 584 std::unique_ptr<base::MessageLoop> main_message_loop, |
| 588 std::unique_ptr<scheduler::RendererScheduler> scheduler) | 585 std::unique_ptr<scheduler::RendererScheduler> scheduler) |
| 589 : ChildThreadImpl( | 586 : ChildThreadImpl(Options::Builder().UseMojoChannel(true).Build()), |
|
jam
2016/05/02 19:09:00
when is mojo channel going to be used for all proc
Ken Rockot(use gerrit already)
2016/05/02 19:33:08
Work in progress. Utility process and services pro
| |
| 590 Options::Builder().UseMojoChannel(ShouldUseMojoChannel()).Build()), | |
| 591 renderer_scheduler_(std::move(scheduler)), | 587 renderer_scheduler_(std::move(scheduler)), |
| 592 main_message_loop_(std::move(main_message_loop)), | 588 main_message_loop_(std::move(main_message_loop)), |
| 593 raster_worker_pool_(new RasterWorkerPool()) { | 589 raster_worker_pool_(new RasterWorkerPool()) { |
| 594 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; | 590 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; |
| 595 Init(test_task_counter); | 591 Init(test_task_counter); |
| 596 } | 592 } |
| 597 | 593 |
| 598 void RenderThreadImpl::Init( | 594 void RenderThreadImpl::Init( |
| 599 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { | 595 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { |
| 600 TRACE_EVENT0("startup", "RenderThreadImpl::Init"); | 596 TRACE_EVENT0("startup", "RenderThreadImpl::Init"); |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2048 } | 2044 } |
| 2049 | 2045 |
| 2050 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2046 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 2051 size_t erased = | 2047 size_t erased = |
| 2052 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2048 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 2053 routing_id_); | 2049 routing_id_); |
| 2054 DCHECK_EQ(1u, erased); | 2050 DCHECK_EQ(1u, erased); |
| 2055 } | 2051 } |
| 2056 | 2052 |
| 2057 } // namespace content | 2053 } // namespace content |
| OLD | NEW |