| 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 18 matching lines...) Expand all Loading... |
| 29 #include "content/common/content_export.h" | 29 #include "content/common/content_export.h" |
| 30 #include "content/common/frame.mojom.h" | 30 #include "content/common/frame.mojom.h" |
| 31 #include "content/common/frame_replication_state.h" | 31 #include "content/common/frame_replication_state.h" |
| 32 #include "content/common/render_frame_message_filter.mojom.h" | 32 #include "content/common/render_frame_message_filter.mojom.h" |
| 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 "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h" | |
| 40 #include "gpu/ipc/client/gpu_channel_host.h" | 39 #include "gpu/ipc/client/gpu_channel_host.h" |
| 41 #include "mojo/public/cpp/bindings/associated_binding.h" | 40 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 42 #include "mojo/public/cpp/bindings/binding.h" | 41 #include "mojo/public/cpp/bindings/binding.h" |
| 43 #include "net/base/network_change_notifier.h" | 42 #include "net/base/network_change_notifier.h" |
| 44 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 43 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
| 45 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 44 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 46 #include "third_party/WebKit/public/web/WebMemoryStatistics.h" | 45 #include "third_party/WebKit/public/web/WebMemoryStatistics.h" |
| 47 #include "ui/gfx/native_widget_types.h" | 46 #include "ui/gfx/native_widget_types.h" |
| 48 | 47 |
| 49 #if defined(OS_MACOSX) | 48 #if defined(OS_MACOSX) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // routed to the RenderThread according to the routing IDs of the messages. | 148 // routed to the RenderThread according to the routing IDs of the messages. |
| 150 // The routing IDs correspond to RenderView instances. | 149 // The routing IDs correspond to RenderView instances. |
| 151 class CONTENT_EXPORT RenderThreadImpl | 150 class CONTENT_EXPORT RenderThreadImpl |
| 152 : public RenderThread, | 151 : public RenderThread, |
| 153 public ChildThreadImpl, | 152 public ChildThreadImpl, |
| 154 public gpu::GpuChannelHostFactory, | 153 public gpu::GpuChannelHostFactory, |
| 155 public blink::scheduler::RendererScheduler::RAILModeObserver, | 154 public blink::scheduler::RendererScheduler::RAILModeObserver, |
| 156 public ChildMemoryCoordinatorDelegate, | 155 public ChildMemoryCoordinatorDelegate, |
| 157 public base::MemoryCoordinatorClient, | 156 public base::MemoryCoordinatorClient, |
| 158 NON_EXPORTED_BASE(public mojom::Renderer), | 157 NON_EXPORTED_BASE(public mojom::Renderer), |
| 159 // TODO(blundell): Separate this impl out into Blink. | |
| 160 NON_EXPORTED_BASE(public device::mojom::TimeZoneMonitorClient), | |
| 161 NON_EXPORTED_BASE(public CompositorDependencies) { | 158 NON_EXPORTED_BASE(public CompositorDependencies) { |
| 162 public: | 159 public: |
| 163 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); | 160 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); |
| 164 static RenderThreadImpl* Create( | 161 static RenderThreadImpl* Create( |
| 165 std::unique_ptr<base::MessageLoop> main_message_loop, | 162 std::unique_ptr<base::MessageLoop> main_message_loop, |
| 166 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler); | 163 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler); |
| 167 static RenderThreadImpl* current(); | 164 static RenderThreadImpl* current(); |
| 168 static mojom::RenderMessageFilter* current_render_message_filter(); | 165 static mojom::RenderMessageFilter* current_render_message_filter(); |
| 169 | 166 |
| 170 static void SetRenderMessageFilterForTesting( | 167 static void SetRenderMessageFilterForTesting( |
| 171 mojom::RenderMessageFilter* render_message_filter); | 168 mojom::RenderMessageFilter* render_message_filter); |
| 172 | 169 |
| 173 ~RenderThreadImpl() override; | 170 ~RenderThreadImpl() override; |
| 174 void Shutdown() override; | 171 void Shutdown() override; |
| 175 | 172 |
| 176 // When initializing WebKit, ensure that any schemes needed for the content | 173 // When initializing WebKit, ensure that any schemes needed for the content |
| 177 // module are registered properly. Static to allow sharing with tests. | 174 // module are registered properly. Static to allow sharing with tests. |
| 178 static void RegisterSchemes(); | 175 static void RegisterSchemes(); |
| 179 | 176 |
| 180 // Notify V8 that the date/time configuration of the system might have | |
| 181 // changed. | |
| 182 static void NotifyTimezoneChange(); | |
| 183 | |
| 184 // RenderThread implementation: | 177 // RenderThread implementation: |
| 185 bool Send(IPC::Message* msg) override; | 178 bool Send(IPC::Message* msg) override; |
| 186 IPC::SyncChannel* GetChannel() override; | 179 IPC::SyncChannel* GetChannel() override; |
| 187 std::string GetLocale() override; | 180 std::string GetLocale() override; |
| 188 IPC::SyncMessageFilter* GetSyncMessageFilter() override; | 181 IPC::SyncMessageFilter* GetSyncMessageFilter() override; |
| 189 scoped_refptr<base::SingleThreadTaskRunner> GetIOTaskRunner() override; | 182 scoped_refptr<base::SingleThreadTaskRunner> GetIOTaskRunner() override; |
| 190 void AddRoute(int32_t routing_id, IPC::Listener* listener) override; | 183 void AddRoute(int32_t routing_id, IPC::Listener* listener) override; |
| 191 void RemoveRoute(int32_t routing_id) override; | 184 void RemoveRoute(int32_t routing_id) override; |
| 192 int GenerateRoutingID() override; | 185 int GenerateRoutingID() override; |
| 193 void AddFilter(IPC::MessageFilter* filter) override; | 186 void AddFilter(IPC::MessageFilter* filter) override; |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 net::NetworkChangeNotifier::ConnectionType type, | 516 net::NetworkChangeNotifier::ConnectionType type, |
| 524 double max_bandwidth_mbps) override; | 517 double max_bandwidth_mbps) override; |
| 525 void SetWebKitSharedTimersSuspended(bool suspend) override; | 518 void SetWebKitSharedTimersSuspended(bool suspend) override; |
| 526 void UpdateScrollbarTheme( | 519 void UpdateScrollbarTheme( |
| 527 mojom::UpdateScrollbarThemeParamsPtr params) override; | 520 mojom::UpdateScrollbarThemeParamsPtr params) override; |
| 528 void OnSystemColorsChanged(int32_t aqua_color_variant, | 521 void OnSystemColorsChanged(int32_t aqua_color_variant, |
| 529 const std::string& highlight_text_color, | 522 const std::string& highlight_text_color, |
| 530 const std::string& highlight_color) override; | 523 const std::string& highlight_color) override; |
| 531 void PurgePluginListCache(bool reload_pages) override; | 524 void PurgePluginListCache(bool reload_pages) override; |
| 532 | 525 |
| 533 // device::mojom::TimeZoneClient: | |
| 534 void OnTimeZoneChange(const std::string& zoneId) override; | |
| 535 void OnMemoryPressure( | 526 void OnMemoryPressure( |
| 536 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 527 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
| 537 | 528 |
| 538 void OnCreateNewSharedWorker( | 529 void OnCreateNewSharedWorker( |
| 539 const WorkerProcessMsg_CreateWorker_Params& params); | 530 const WorkerProcessMsg_CreateWorker_Params& params); |
| 540 bool RendererIsHidden() const; | 531 bool RendererIsHidden() const; |
| 541 void OnRendererHidden(); | 532 void OnRendererHidden(); |
| 542 void OnRendererVisible(); | 533 void OnRendererVisible(); |
| 543 | 534 |
| 544 void RecordPurgeAndSuspendMetrics() const; | 535 void RecordPurgeAndSuspendMetrics() const; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 // Dispatches all P2P sockets. | 577 // Dispatches all P2P sockets. |
| 587 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; | 578 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; |
| 588 | 579 |
| 589 // Used for communicating registering AEC dump consumers with the browser and | 580 // Used for communicating registering AEC dump consumers with the browser and |
| 590 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is | 581 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is |
| 591 // diagnostic audio data for WebRTC stored locally when enabled by the user in | 582 // diagnostic audio data for WebRTC stored locally when enabled by the user in |
| 592 // chrome://webrtc-internals. | 583 // chrome://webrtc-internals. |
| 593 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; | 584 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; |
| 594 #endif | 585 #endif |
| 595 | 586 |
| 596 mojo::Binding<device::mojom::TimeZoneMonitorClient> | |
| 597 time_zone_monitor_binding_; | |
| 598 | |
| 599 // Used on the render thread. | 587 // Used on the render thread. |
| 600 std::unique_ptr<VideoCaptureImplManager> vc_manager_; | 588 std::unique_ptr<VideoCaptureImplManager> vc_manager_; |
| 601 | 589 |
| 602 // The count of RenderWidgets running through this thread. | 590 // The count of RenderWidgets running through this thread. |
| 603 int widget_count_; | 591 int widget_count_; |
| 604 | 592 |
| 605 // The count of hidden RenderWidgets running through this thread. | 593 // The count of hidden RenderWidgets running through this thread. |
| 606 int hidden_widget_count_; | 594 int hidden_widget_count_; |
| 607 | 595 |
| 608 // The current value of the idle notification timer delay. | 596 // The current value of the idle notification timer delay. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 736 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 749 }; | 737 }; |
| 750 | 738 |
| 751 #if defined(COMPILER_MSVC) | 739 #if defined(COMPILER_MSVC) |
| 752 #pragma warning(pop) | 740 #pragma warning(pop) |
| 753 #endif | 741 #endif |
| 754 | 742 |
| 755 } // namespace content | 743 } // namespace content |
| 756 | 744 |
| 757 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 745 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |