| 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 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "content/common/render_message_filter.mojom.h" | 33 #include "content/common/render_message_filter.mojom.h" |
| 34 #include "content/common/renderer.mojom.h" | 34 #include "content/common/renderer.mojom.h" |
| 35 #include "content/common/storage_partition_service.mojom.h" | 35 #include "content/common/storage_partition_service.mojom.h" |
| 36 #include "content/public/renderer/render_thread.h" | 36 #include "content/public/renderer/render_thread.h" |
| 37 #include "content/renderer/gpu/compositor_dependencies.h" | 37 #include "content/renderer/gpu/compositor_dependencies.h" |
| 38 #include "content/renderer/layout_test_dependencies.h" | 38 #include "content/renderer/layout_test_dependencies.h" |
| 39 #include "gpu/ipc/client/gpu_channel_host.h" | 39 #include "gpu/ipc/client/gpu_channel_host.h" |
| 40 #include "media/media_features.h" | 40 #include "media/media_features.h" |
| 41 #include "mojo/public/cpp/bindings/associated_binding.h" | 41 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 42 #include "mojo/public/cpp/bindings/binding.h" | 42 #include "mojo/public/cpp/bindings/binding.h" |
| 43 #include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h" |
| 43 #include "net/base/network_change_notifier.h" | 44 #include "net/base/network_change_notifier.h" |
| 44 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 45 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
| 45 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 46 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 46 #include "third_party/WebKit/public/web/WebMemoryStatistics.h" | 47 #include "third_party/WebKit/public/web/WebMemoryStatistics.h" |
| 47 #include "ui/gfx/native_widget_types.h" | 48 #include "ui/gfx/native_widget_types.h" |
| 48 | 49 |
| 49 #if defined(OS_MACOSX) | 50 #if defined(OS_MACOSX) |
| 50 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" | 51 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" |
| 51 #endif | 52 #endif |
| 52 | 53 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 class MemoryObserver; | 120 class MemoryObserver; |
| 120 class MidiMessageFilter; | 121 class MidiMessageFilter; |
| 121 class P2PSocketDispatcher; | 122 class P2PSocketDispatcher; |
| 122 class PeerConnectionDependencyFactory; | 123 class PeerConnectionDependencyFactory; |
| 123 class PeerConnectionTracker; | 124 class PeerConnectionTracker; |
| 124 class CategorizedWorkerPool; | 125 class CategorizedWorkerPool; |
| 125 class RenderThreadObserver; | 126 class RenderThreadObserver; |
| 126 class RendererBlinkPlatformImpl; | 127 class RendererBlinkPlatformImpl; |
| 127 class RendererGpuVideoAcceleratorFactories; | 128 class RendererGpuVideoAcceleratorFactories; |
| 128 class ResourceDispatchThrottler; | 129 class ResourceDispatchThrottler; |
| 130 class ThreadSafeAssociatedInterfacePtrProvider; |
| 129 class VideoCaptureImplManager; | 131 class VideoCaptureImplManager; |
| 130 | 132 |
| 131 #if defined(OS_ANDROID) | 133 #if defined(OS_ANDROID) |
| 132 class StreamTextureFactory; | 134 class StreamTextureFactory; |
| 133 class SynchronousCompositorFilter; | 135 class SynchronousCompositorFilter; |
| 134 #endif | 136 #endif |
| 135 | 137 |
| 136 #if defined(COMPILER_MSVC) | 138 #if defined(COMPILER_MSVC) |
| 137 // See explanation for other RenderViewHostImpl which is the same issue. | 139 // See explanation for other RenderViewHostImpl which is the same issue. |
| 138 #pragma warning(push) | 140 #pragma warning(push) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 157 public base::MemoryCoordinatorClient, | 159 public base::MemoryCoordinatorClient, |
| 158 NON_EXPORTED_BASE(public mojom::Renderer), | 160 NON_EXPORTED_BASE(public mojom::Renderer), |
| 159 NON_EXPORTED_BASE(public CompositorDependencies) { | 161 NON_EXPORTED_BASE(public CompositorDependencies) { |
| 160 public: | 162 public: |
| 161 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); | 163 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); |
| 162 static RenderThreadImpl* Create( | 164 static RenderThreadImpl* Create( |
| 163 std::unique_ptr<base::MessageLoop> main_message_loop, | 165 std::unique_ptr<base::MessageLoop> main_message_loop, |
| 164 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler); | 166 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler); |
| 165 static RenderThreadImpl* current(); | 167 static RenderThreadImpl* current(); |
| 166 static mojom::RenderMessageFilter* current_render_message_filter(); | 168 static mojom::RenderMessageFilter* current_render_message_filter(); |
| 169 static const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>& |
| 170 current_thread_safe_render_message_filter(); |
| 167 | 171 |
| 168 static void SetRenderMessageFilterForTesting( | 172 static void SetRenderMessageFilterForTesting( |
| 169 mojom::RenderMessageFilter* render_message_filter); | 173 mojom::RenderMessageFilter* render_message_filter); |
| 170 | 174 |
| 171 ~RenderThreadImpl() override; | 175 ~RenderThreadImpl() override; |
| 172 void Shutdown() override; | 176 void Shutdown() override; |
| 173 | 177 |
| 174 // When initializing WebKit, ensure that any schemes needed for the content | 178 // When initializing WebKit, ensure that any schemes needed for the content |
| 175 // module are registered properly. Static to allow sharing with tests. | 179 // module are registered properly. Static to allow sharing with tests. |
| 176 static void RegisterSchemes(); | 180 static void RegisterSchemes(); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 return p2p_socket_dispatcher_.get(); | 340 return p2p_socket_dispatcher_.get(); |
| 337 } | 341 } |
| 338 #endif | 342 #endif |
| 339 | 343 |
| 340 VideoCaptureImplManager* video_capture_impl_manager() const { | 344 VideoCaptureImplManager* video_capture_impl_manager() const { |
| 341 return vc_manager_.get(); | 345 return vc_manager_.get(); |
| 342 } | 346 } |
| 343 | 347 |
| 344 mojom::RenderFrameMessageFilter* render_frame_message_filter(); | 348 mojom::RenderFrameMessageFilter* render_frame_message_filter(); |
| 345 mojom::RenderMessageFilter* render_message_filter(); | 349 mojom::RenderMessageFilter* render_message_filter(); |
| 350 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>& |
| 351 thread_safe_render_message_filter(); |
| 346 | 352 |
| 347 // Get the GPU channel. Returns NULL if the channel is not established or | 353 // Get the GPU channel. Returns NULL if the channel is not established or |
| 348 // has been lost. | 354 // has been lost. |
| 349 gpu::GpuChannelHost* GetGpuChannel(); | 355 gpu::GpuChannelHost* GetGpuChannel(); |
| 350 | 356 |
| 351 // Returns a SingleThreadTaskRunner instance corresponding to the message loop | 357 // Returns a SingleThreadTaskRunner instance corresponding to the message loop |
| 352 // of the thread on which file operations should be run. Must be called | 358 // of the thread on which file operations should be run. Must be called |
| 353 // on the renderer's main thread. | 359 // on the renderer's main thread. |
| 354 scoped_refptr<base::SingleThreadTaskRunner> GetFileThreadTaskRunner(); | 360 scoped_refptr<base::SingleThreadTaskRunner> GetFileThreadTaskRunner(); |
| 355 | 361 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 | 586 |
| 581 // Used for communicating registering AEC dump consumers with the browser and | 587 // Used for communicating registering AEC dump consumers with the browser and |
| 582 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is | 588 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is |
| 583 // diagnostic audio data for WebRTC stored locally when enabled by the user in | 589 // diagnostic audio data for WebRTC stored locally when enabled by the user in |
| 584 // chrome://webrtc-internals. | 590 // chrome://webrtc-internals. |
| 585 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; | 591 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; |
| 586 #endif | 592 #endif |
| 587 | 593 |
| 588 // Used on the render thread. | 594 // Used on the render thread. |
| 589 std::unique_ptr<VideoCaptureImplManager> vc_manager_; | 595 std::unique_ptr<VideoCaptureImplManager> vc_manager_; |
| 596 std::unique_ptr<ThreadSafeAssociatedInterfacePtrProvider> |
| 597 thread_safe_associated_interface_ptr_provider_; |
| 590 | 598 |
| 591 // The count of RenderWidgets running through this thread. | 599 // The count of RenderWidgets running through this thread. |
| 592 int widget_count_; | 600 int widget_count_; |
| 593 | 601 |
| 594 // The count of hidden RenderWidgets running through this thread. | 602 // The count of hidden RenderWidgets running through this thread. |
| 595 int hidden_widget_count_; | 603 int hidden_widget_count_; |
| 596 | 604 |
| 597 // The current value of the idle notification timer delay. | 605 // The current value of the idle notification timer delay. |
| 598 int64_t idle_notification_delay_in_ms_; | 606 int64_t idle_notification_delay_in_ms_; |
| 599 | 607 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 PendingFrameCreateMap pending_frame_creates_; | 729 PendingFrameCreateMap pending_frame_creates_; |
| 722 | 730 |
| 723 mojom::StoragePartitionServicePtr storage_partition_service_; | 731 mojom::StoragePartitionServicePtr storage_partition_service_; |
| 724 | 732 |
| 725 AssociatedInterfaceRegistryImpl associated_interfaces_; | 733 AssociatedInterfaceRegistryImpl associated_interfaces_; |
| 726 | 734 |
| 727 mojo::AssociatedBinding<mojom::Renderer> renderer_binding_; | 735 mojo::AssociatedBinding<mojom::Renderer> renderer_binding_; |
| 728 | 736 |
| 729 mojom::RenderFrameMessageFilterAssociatedPtr render_frame_message_filter_; | 737 mojom::RenderFrameMessageFilterAssociatedPtr render_frame_message_filter_; |
| 730 mojom::RenderMessageFilterAssociatedPtr render_message_filter_; | 738 mojom::RenderMessageFilterAssociatedPtr render_message_filter_; |
| 739 scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr> |
| 740 thread_safe_render_message_filter_; |
| 731 | 741 |
| 732 base::CancelableClosure record_purge_suspend_metric_closure_; | 742 base::CancelableClosure record_purge_suspend_metric_closure_; |
| 733 bool is_renderer_suspended_; | 743 bool is_renderer_suspended_; |
| 734 | 744 |
| 735 int32_t client_id_; | 745 int32_t client_id_; |
| 736 | 746 |
| 737 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 747 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 738 }; | 748 }; |
| 739 | 749 |
| 740 #if defined(COMPILER_MSVC) | 750 #if defined(COMPILER_MSVC) |
| 741 #pragma warning(pop) | 751 #pragma warning(pop) |
| 742 #endif | 752 #endif |
| 743 | 753 |
| 744 } // namespace content | 754 } // namespace content |
| 745 | 755 |
| 746 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 756 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |