| 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 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/cancelable_callback.h" | 15 #include "base/cancelable_callback.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/memory_pressure_listener.h" | 17 #include "base/memory/memory_pressure_listener.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/metrics/user_metrics_action.h" | 19 #include "base/metrics/user_metrics_action.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 22 #include "base/threading/thread_checker.h" | 22 #include "base/threading/thread_checker.h" |
| 23 #include "base/timer/timer.h" | 23 #include "base/timer/timer.h" |
| 24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 25 #include "content/child/child_thread_impl.h" | 26 #include "content/child/child_thread_impl.h" |
| 26 #include "content/common/content_export.h" | 27 #include "content/common/content_export.h" |
| 27 #include "content/common/frame.mojom.h" | 28 #include "content/common/frame.mojom.h" |
| 28 #include "content/common/frame_replication_state.h" | 29 #include "content/common/frame_replication_state.h" |
| 29 #include "content/common/gpu_process_launch_causes.h" | 30 #include "content/common/gpu_process_launch_causes.h" |
| 30 #include "content/common/storage_partition_service.mojom.h" | 31 #include "content/common/storage_partition_service.mojom.h" |
| 31 #include "content/public/renderer/render_thread.h" | 32 #include "content/public/renderer/render_thread.h" |
| 32 #include "content/renderer/gpu/compositor_dependencies.h" | 33 #include "content/renderer/gpu/compositor_dependencies.h" |
| 33 #include "content/renderer/layout_test_dependencies.h" | 34 #include "content/renderer/layout_test_dependencies.h" |
| 34 #include "gpu/ipc/client/gpu_channel_host.h" | 35 #include "gpu/ipc/client/gpu_channel_host.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 namespace IPC { | 73 namespace IPC { |
| 73 class MessageFilter; | 74 class MessageFilter; |
| 74 } | 75 } |
| 75 | 76 |
| 76 namespace media { | 77 namespace media { |
| 77 class AudioHardwareConfig; | 78 class AudioHardwareConfig; |
| 78 class GpuVideoAcceleratorFactories; | 79 class GpuVideoAcceleratorFactories; |
| 79 } | 80 } |
| 80 | 81 |
| 81 namespace scheduler { | 82 namespace scheduler { |
| 82 class RendererScheduler; | |
| 83 class WebThreadBase; | 83 class WebThreadBase; |
| 84 } | 84 } |
| 85 | 85 |
| 86 namespace v8 { | 86 namespace v8 { |
| 87 class Extension; | 87 class Extension; |
| 88 } | 88 } |
| 89 | 89 |
| 90 namespace content { | 90 namespace content { |
| 91 | 91 |
| 92 class AppCacheDispatcher; | 92 class AppCacheDispatcher; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Likewise, it provides an API for the RenderViews to talk back to the main | 140 // Likewise, it provides an API for the RenderViews to talk back to the main |
| 141 // process (i.e., their corresponding WebContentsImpl). | 141 // process (i.e., their corresponding WebContentsImpl). |
| 142 // | 142 // |
| 143 // Most of the communication occurs in the form of IPC messages. They are | 143 // Most of the communication occurs in the form of IPC messages. They are |
| 144 // routed to the RenderThread according to the routing IDs of the messages. | 144 // routed to the RenderThread according to the routing IDs of the messages. |
| 145 // The routing IDs correspond to RenderView instances. | 145 // The routing IDs correspond to RenderView instances. |
| 146 class CONTENT_EXPORT RenderThreadImpl | 146 class CONTENT_EXPORT RenderThreadImpl |
| 147 : public RenderThread, | 147 : public RenderThread, |
| 148 public ChildThreadImpl, | 148 public ChildThreadImpl, |
| 149 public gpu::GpuChannelHostFactory, | 149 public gpu::GpuChannelHostFactory, |
| 150 public scheduler::RendererScheduler::RAILModeObserver, |
| 150 NON_EXPORTED_BASE(public CompositorDependencies) { | 151 NON_EXPORTED_BASE(public CompositorDependencies) { |
| 151 public: | 152 public: |
| 152 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); | 153 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); |
| 153 static RenderThreadImpl* Create( | 154 static RenderThreadImpl* Create( |
| 154 std::unique_ptr<base::MessageLoop> main_message_loop, | 155 std::unique_ptr<base::MessageLoop> main_message_loop, |
| 155 std::unique_ptr<scheduler::RendererScheduler> renderer_scheduler); | 156 std::unique_ptr<scheduler::RendererScheduler> renderer_scheduler); |
| 156 static RenderThreadImpl* current(); | 157 static RenderThreadImpl* current(); |
| 157 | 158 |
| 158 ~RenderThreadImpl() override; | 159 ~RenderThreadImpl() override; |
| 159 void Shutdown() override; | 160 void Shutdown() override; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 GetCompositorImplThreadTaskRunner() override; | 214 GetCompositorImplThreadTaskRunner() override; |
| 214 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 215 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
| 215 scheduler::RendererScheduler* GetRendererScheduler() override; | 216 scheduler::RendererScheduler* GetRendererScheduler() override; |
| 216 std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( | 217 std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( |
| 217 int routing_id) override; | 218 int routing_id) override; |
| 218 cc::ImageSerializationProcessor* GetImageSerializationProcessor() override; | 219 cc::ImageSerializationProcessor* GetImageSerializationProcessor() override; |
| 219 cc::TaskGraphRunner* GetTaskGraphRunner() override; | 220 cc::TaskGraphRunner* GetTaskGraphRunner() override; |
| 220 bool AreImageDecodeTasksEnabled() override; | 221 bool AreImageDecodeTasksEnabled() override; |
| 221 bool IsThreadedAnimationEnabled() override; | 222 bool IsThreadedAnimationEnabled() override; |
| 222 | 223 |
| 224 // scheduler::RendererScheduler::RAILModeObserver implementation. |
| 225 void OnRAILModeChanged(v8::RAILMode rail_mode) override; |
| 226 |
| 223 // Synchronously establish a channel to the GPU plugin if not previously | 227 // Synchronously establish a channel to the GPU plugin if not previously |
| 224 // established or if it has been lost (for example if the GPU plugin crashed). | 228 // established or if it has been lost (for example if the GPU plugin crashed). |
| 225 // If there is a pending asynchronous request, it will be completed by the | 229 // If there is a pending asynchronous request, it will be completed by the |
| 226 // time this routine returns. | 230 // time this routine returns. |
| 227 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync(CauseForGpuLaunch); | 231 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync(CauseForGpuLaunch); |
| 228 | 232 |
| 229 std::unique_ptr<cc::OutputSurface> CreateCompositorOutputSurface( | 233 std::unique_ptr<cc::OutputSurface> CreateCompositorOutputSurface( |
| 230 bool use_software, | 234 bool use_software, |
| 231 int routing_id, | 235 int routing_id, |
| 232 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, | 236 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 710 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 707 }; | 711 }; |
| 708 | 712 |
| 709 #if defined(COMPILER_MSVC) | 713 #if defined(COMPILER_MSVC) |
| 710 #pragma warning(pop) | 714 #pragma warning(pop) |
| 711 #endif | 715 #endif |
| 712 | 716 |
| 713 } // namespace content | 717 } // namespace content |
| 714 | 718 |
| 715 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 719 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |