| 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" |
| 85 #include "content/public/common/renderer_preferences.h" | 86 #include "content/public/common/renderer_preferences.h" |
| 86 #include "content/public/common/url_constants.h" | 87 #include "content/public/common/url_constants.h" |
| 87 #include "content/public/renderer/content_renderer_client.h" | 88 #include "content/public/renderer/content_renderer_client.h" |
| 88 #include "content/public/renderer/render_thread_observer.h" | 89 #include "content/public/renderer/render_thread_observer.h" |
| 89 #include "content/public/renderer/render_view_visitor.h" | 90 #include "content/public/renderer/render_view_visitor.h" |
| 90 #include "content/renderer/bluetooth/bluetooth_message_filter.h" | 91 #include "content/renderer/bluetooth/bluetooth_message_filter.h" |
| 91 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 92 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
| 92 #include "content/renderer/cache_storage/cache_storage_dispatcher.h" | 93 #include "content/renderer/cache_storage/cache_storage_dispatcher.h" |
| 93 #include "content/renderer/cache_storage/cache_storage_message_filter.h" | 94 #include "content/renderer/cache_storage/cache_storage_message_filter.h" |
| 94 #include "content/renderer/devtools/devtools_agent_filter.h" | 95 #include "content/renderer/devtools/devtools_agent_filter.h" |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 | 566 |
| 566 RenderThreadImpl* RenderThreadImpl::current() { | 567 RenderThreadImpl* RenderThreadImpl::current() { |
| 567 return lazy_tls.Pointer()->Get(); | 568 return lazy_tls.Pointer()->Get(); |
| 568 } | 569 } |
| 569 | 570 |
| 570 RenderThreadImpl::RenderThreadImpl( | 571 RenderThreadImpl::RenderThreadImpl( |
| 571 const InProcessChildThreadParams& params, | 572 const InProcessChildThreadParams& params, |
| 572 std::unique_ptr<scheduler::RendererScheduler> scheduler, | 573 std::unique_ptr<scheduler::RendererScheduler> scheduler, |
| 573 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) | 574 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) |
| 574 : ChildThreadImpl(Options::Builder() | 575 : ChildThreadImpl(Options::Builder() |
| 575 .InBrowserProcess(params).UseMojoChannel(true).Build()), | 576 .InBrowserProcess(params) |
| 577 .UseMojoChannel(ShouldUseMojoChannel()) |
| 578 .Build()), |
| 576 renderer_scheduler_(std::move(scheduler)), | 579 renderer_scheduler_(std::move(scheduler)), |
| 577 raster_worker_pool_(new RasterWorkerPool()) { | 580 raster_worker_pool_(new RasterWorkerPool()) { |
| 578 Init(resource_task_queue); | 581 Init(resource_task_queue); |
| 579 } | 582 } |
| 580 | 583 |
| 581 // When we run plugins in process, we actually run them on the render thread, | 584 // When we run plugins in process, we actually run them on the render thread, |
| 582 // which means that we need to make the render thread pump UI events. | 585 // which means that we need to make the render thread pump UI events. |
| 583 RenderThreadImpl::RenderThreadImpl( | 586 RenderThreadImpl::RenderThreadImpl( |
| 584 std::unique_ptr<base::MessageLoop> main_message_loop, | 587 std::unique_ptr<base::MessageLoop> main_message_loop, |
| 585 std::unique_ptr<scheduler::RendererScheduler> scheduler) | 588 std::unique_ptr<scheduler::RendererScheduler> scheduler) |
| 586 : ChildThreadImpl(Options::Builder().UseMojoChannel(true).Build()), | 589 : ChildThreadImpl( |
| 590 Options::Builder().UseMojoChannel(ShouldUseMojoChannel()).Build()), |
| 587 renderer_scheduler_(std::move(scheduler)), | 591 renderer_scheduler_(std::move(scheduler)), |
| 588 main_message_loop_(std::move(main_message_loop)), | 592 main_message_loop_(std::move(main_message_loop)), |
| 589 raster_worker_pool_(new RasterWorkerPool()) { | 593 raster_worker_pool_(new RasterWorkerPool()) { |
| 590 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; | 594 scoped_refptr<base::SingleThreadTaskRunner> test_task_counter; |
| 591 Init(test_task_counter); | 595 Init(test_task_counter); |
| 592 } | 596 } |
| 593 | 597 |
| 594 void RenderThreadImpl::Init( | 598 void RenderThreadImpl::Init( |
| 595 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { | 599 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) { |
| 596 TRACE_EVENT0("startup", "RenderThreadImpl::Init"); | 600 TRACE_EVENT0("startup", "RenderThreadImpl::Init"); |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2044 } | 2048 } |
| 2045 | 2049 |
| 2046 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2050 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 2047 size_t erased = | 2051 size_t erased = |
| 2048 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2052 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 2049 routing_id_); | 2053 routing_id_); |
| 2050 DCHECK_EQ(1u, erased); | 2054 DCHECK_EQ(1u, erased); |
| 2051 } | 2055 } |
| 2052 | 2056 |
| 2053 } // namespace content | 2057 } // namespace content |
| OLD | NEW |