| 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/memory_coordinator/child/child_memory_coordinator_impl.h" | |
| 26 #include "content/child/child_thread_impl.h" | 25 #include "content/child/child_thread_impl.h" |
| 26 #include "content/child/memory/child_memory_coordinator_impl.h" |
| 27 #include "content/common/content_export.h" | 27 #include "content/common/content_export.h" |
| 28 #include "content/common/frame.mojom.h" | 28 #include "content/common/frame.mojom.h" |
| 29 #include "content/common/frame_replication_state.h" | 29 #include "content/common/frame_replication_state.h" |
| 30 #include "content/common/render_frame_message_filter.mojom.h" | 30 #include "content/common/render_frame_message_filter.mojom.h" |
| 31 #include "content/common/storage_partition_service.mojom.h" | 31 #include "content/common/storage_partition_service.mojom.h" |
| 32 #include "content/public/renderer/render_thread.h" | 32 #include "content/public/renderer/render_thread.h" |
| 33 #include "content/renderer/gpu/compositor_dependencies.h" | 33 #include "content/renderer/gpu/compositor_dependencies.h" |
| 34 #include "content/renderer/layout_test_dependencies.h" | 34 #include "content/renderer/layout_test_dependencies.h" |
| 35 #include "gpu/ipc/client/gpu_channel_host.h" | 35 #include "gpu/ipc/client/gpu_channel_host.h" |
| 36 #include "net/base/network_change_notifier.h" | 36 #include "net/base/network_change_notifier.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // process (i.e., their corresponding WebContentsImpl). | 143 // process (i.e., their corresponding WebContentsImpl). |
| 144 // | 144 // |
| 145 // Most of the communication occurs in the form of IPC messages. They are | 145 // Most of the communication occurs in the form of IPC messages. They are |
| 146 // routed to the RenderThread according to the routing IDs of the messages. | 146 // routed to the RenderThread according to the routing IDs of the messages. |
| 147 // The routing IDs correspond to RenderView instances. | 147 // The routing IDs correspond to RenderView instances. |
| 148 class CONTENT_EXPORT RenderThreadImpl | 148 class CONTENT_EXPORT RenderThreadImpl |
| 149 : public RenderThread, | 149 : public RenderThread, |
| 150 public ChildThreadImpl, | 150 public ChildThreadImpl, |
| 151 public gpu::GpuChannelHostFactory, | 151 public gpu::GpuChannelHostFactory, |
| 152 public blink::scheduler::RendererScheduler::RAILModeObserver, | 152 public blink::scheduler::RendererScheduler::RAILModeObserver, |
| 153 public memory_coordinator::ChildMemoryCoordinatorDelegate, | 153 public ChildMemoryCoordinatorDelegate, |
| 154 NON_EXPORTED_BASE(public CompositorDependencies) { | 154 NON_EXPORTED_BASE(public CompositorDependencies) { |
| 155 public: | 155 public: |
| 156 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); | 156 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); |
| 157 static RenderThreadImpl* Create( | 157 static RenderThreadImpl* Create( |
| 158 std::unique_ptr<base::MessageLoop> main_message_loop, | 158 std::unique_ptr<base::MessageLoop> main_message_loop, |
| 159 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler); | 159 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler); |
| 160 static RenderThreadImpl* current(); | 160 static RenderThreadImpl* current(); |
| 161 | 161 |
| 162 ~RenderThreadImpl() override; | 162 ~RenderThreadImpl() override; |
| 163 void Shutdown() override; | 163 void Shutdown() override; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 445 |
| 446 void AddEmbeddedWorkerRoute(int32_t routing_id, IPC::Listener* listener); | 446 void AddEmbeddedWorkerRoute(int32_t routing_id, IPC::Listener* listener); |
| 447 void RemoveEmbeddedWorkerRoute(int32_t routing_id); | 447 void RemoveEmbeddedWorkerRoute(int32_t routing_id); |
| 448 | 448 |
| 449 void RegisterPendingFrameCreate(int routing_id, | 449 void RegisterPendingFrameCreate(int routing_id, |
| 450 mojom::FrameRequest frame, | 450 mojom::FrameRequest frame, |
| 451 mojom::FrameHostPtr host); | 451 mojom::FrameHostPtr host); |
| 452 | 452 |
| 453 mojom::StoragePartitionService* GetStoragePartitionService(); | 453 mojom::StoragePartitionService* GetStoragePartitionService(); |
| 454 | 454 |
| 455 // memory_coordinator::ChildMemoryCoordinatorDelegate implementation. | 455 // ChildMemoryCoordinatorDelegate implementation. |
| 456 void OnTrimMemoryImmediately() override; | 456 void OnTrimMemoryImmediately() override; |
| 457 | 457 |
| 458 protected: | 458 protected: |
| 459 RenderThreadImpl( | 459 RenderThreadImpl( |
| 460 const InProcessChildThreadParams& params, | 460 const InProcessChildThreadParams& params, |
| 461 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler, | 461 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler, |
| 462 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); | 462 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); |
| 463 RenderThreadImpl( | 463 RenderThreadImpl( |
| 464 std::unique_ptr<base::MessageLoop> main_message_loop, | 464 std::unique_ptr<base::MessageLoop> main_message_loop, |
| 465 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); | 465 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 | 644 |
| 645 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_; | 645 scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_provider_; |
| 646 | 646 |
| 647 std::unique_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_; | 647 std::unique_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_; |
| 648 | 648 |
| 649 HistogramCustomizer histogram_customizer_; | 649 HistogramCustomizer histogram_customizer_; |
| 650 | 650 |
| 651 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 651 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
| 652 | 652 |
| 653 std::unique_ptr<MemoryObserver> memory_observer_; | 653 std::unique_ptr<MemoryObserver> memory_observer_; |
| 654 std::unique_ptr<memory_coordinator::ChildMemoryCoordinatorImpl> | 654 std::unique_ptr<ChildMemoryCoordinatorImpl> memory_coordinator_; |
| 655 memory_coordinator_; | |
| 656 | 655 |
| 657 #if defined(USE_AURA) | 656 #if defined(USE_AURA) |
| 658 std::unique_ptr<ui::GpuService> gpu_service_; | 657 std::unique_ptr<ui::GpuService> gpu_service_; |
| 659 #endif | 658 #endif |
| 660 | 659 |
| 661 scoped_refptr<base::SingleThreadTaskRunner> | 660 scoped_refptr<base::SingleThreadTaskRunner> |
| 662 main_thread_compositor_task_runner_; | 661 main_thread_compositor_task_runner_; |
| 663 | 662 |
| 664 // Compositor settings. | 663 // Compositor settings. |
| 665 bool is_gpu_rasterization_enabled_; | 664 bool is_gpu_rasterization_enabled_; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 713 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 715 }; | 714 }; |
| 716 | 715 |
| 717 #if defined(COMPILER_MSVC) | 716 #if defined(COMPILER_MSVC) |
| 718 #pragma warning(pop) | 717 #pragma warning(pop) |
| 719 #endif | 718 #endif |
| 720 | 719 |
| 721 } // namespace content | 720 } // namespace content |
| 722 | 721 |
| 723 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 722 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |