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 14 matching lines...) Expand all Loading... |
25 #include "components/memory_coordinator/child/child_memory_coordinator_impl.h" | 25 #include "components/memory_coordinator/child/child_memory_coordinator_impl.h" |
26 #include "content/child/child_thread_impl.h" | 26 #include "content/child/child_thread_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 "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h" |
35 #include "gpu/ipc/client/gpu_channel_host.h" | 36 #include "gpu/ipc/client/gpu_channel_host.h" |
| 37 #include "mojo/public/cpp/bindings/binding.h" |
36 #include "net/base/network_change_notifier.h" | 38 #include "net/base/network_change_notifier.h" |
37 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 39 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
38 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 40 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
39 #include "ui/gfx/native_widget_types.h" | 41 #include "ui/gfx/native_widget_types.h" |
40 | 42 |
41 #if defined(OS_MACOSX) | 43 #if defined(OS_MACOSX) |
42 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" | 44 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" |
43 #endif | 45 #endif |
44 | 46 |
45 class GrContext; | 47 class GrContext; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // | 146 // |
145 // Most of the communication occurs in the form of IPC messages. They are | 147 // 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. | 148 // routed to the RenderThread according to the routing IDs of the messages. |
147 // The routing IDs correspond to RenderView instances. | 149 // The routing IDs correspond to RenderView instances. |
148 class CONTENT_EXPORT RenderThreadImpl | 150 class CONTENT_EXPORT RenderThreadImpl |
149 : public RenderThread, | 151 : public RenderThread, |
150 public ChildThreadImpl, | 152 public ChildThreadImpl, |
151 public gpu::GpuChannelHostFactory, | 153 public gpu::GpuChannelHostFactory, |
152 public blink::scheduler::RendererScheduler::RAILModeObserver, | 154 public blink::scheduler::RendererScheduler::RAILModeObserver, |
153 public memory_coordinator::ChildMemoryCoordinatorDelegate, | 155 public memory_coordinator::ChildMemoryCoordinatorDelegate, |
| 156 // TODO(blundell): Separate this impl out into Blink. |
| 157 NON_EXPORTED_BASE(public device::mojom::TimeZoneMonitorClient), |
154 NON_EXPORTED_BASE(public CompositorDependencies) { | 158 NON_EXPORTED_BASE(public CompositorDependencies) { |
155 public: | 159 public: |
156 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); | 160 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); |
157 static RenderThreadImpl* Create( | 161 static RenderThreadImpl* Create( |
158 std::unique_ptr<base::MessageLoop> main_message_loop, | 162 std::unique_ptr<base::MessageLoop> main_message_loop, |
159 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler); | 163 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler); |
160 static RenderThreadImpl* current(); | 164 static RenderThreadImpl* current(); |
161 | 165 |
162 ~RenderThreadImpl() override; | 166 ~RenderThreadImpl() override; |
163 void Shutdown() override; | 167 void Shutdown() override; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 const FrameReplicationState& replicated_state); | 500 const FrameReplicationState& replicated_state); |
497 void OnCreateNewView(const ViewMsg_New_Params& params); | 501 void OnCreateNewView(const ViewMsg_New_Params& params); |
498 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); | 502 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); |
499 #if defined(ENABLE_PLUGINS) | 503 #if defined(ENABLE_PLUGINS) |
500 void OnPurgePluginListCache(bool reload_pages); | 504 void OnPurgePluginListCache(bool reload_pages); |
501 #endif | 505 #endif |
502 void OnNetworkConnectionChanged( | 506 void OnNetworkConnectionChanged( |
503 net::NetworkChangeNotifier::ConnectionType type, | 507 net::NetworkChangeNotifier::ConnectionType type, |
504 double max_bandwidth_mbps); | 508 double max_bandwidth_mbps); |
505 void OnGetAccessibilityTree(); | 509 void OnGetAccessibilityTree(); |
506 void OnUpdateTimezone(const std::string& zoneId); | 510 |
| 511 // device::mojom::TimeZoneClient: |
| 512 void OnTimeZoneChange(const std::string& zoneId) override; |
507 void OnMemoryPressure( | 513 void OnMemoryPressure( |
508 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 514 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
509 #if defined(OS_ANDROID) | 515 #if defined(OS_ANDROID) |
510 void OnSetWebKitSharedTimersSuspended(bool suspend); | 516 void OnSetWebKitSharedTimersSuspended(bool suspend); |
511 #endif | 517 #endif |
512 #if defined(OS_MACOSX) | 518 #if defined(OS_MACOSX) |
513 void OnUpdateScrollbarTheme( | 519 void OnUpdateScrollbarTheme( |
514 const ViewMsg_UpdateScrollbarTheme_Params& params); | 520 const ViewMsg_UpdateScrollbarTheme_Params& params); |
515 void OnSystemColorsChanged(int aqua_color_variant, | 521 void OnSystemColorsChanged(int aqua_color_variant, |
516 const std::string& highlight_text_color, | 522 const std::string& highlight_text_color, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 std::unique_ptr<PeerConnectionDependencyFactory> peer_connection_factory_; | 564 std::unique_ptr<PeerConnectionDependencyFactory> peer_connection_factory_; |
559 | 565 |
560 // This is used to communicate to the browser process the status | 566 // This is used to communicate to the browser process the status |
561 // of all the peer connections created in the renderer. | 567 // of all the peer connections created in the renderer. |
562 std::unique_ptr<PeerConnectionTracker> peer_connection_tracker_; | 568 std::unique_ptr<PeerConnectionTracker> peer_connection_tracker_; |
563 | 569 |
564 // Dispatches all P2P sockets. | 570 // Dispatches all P2P sockets. |
565 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; | 571 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; |
566 #endif | 572 #endif |
567 | 573 |
| 574 mojo::Binding<device::mojom::TimeZoneMonitorClient> |
| 575 time_zone_monitor_binding_; |
| 576 |
568 // Used on the render thread. | 577 // Used on the render thread. |
569 std::unique_ptr<VideoCaptureImplManager> vc_manager_; | 578 std::unique_ptr<VideoCaptureImplManager> vc_manager_; |
570 | 579 |
571 // Used for communicating registering AEC dump consumers with the browser and | 580 // Used for communicating registering AEC dump consumers with the browser and |
572 // 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 |
573 // 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 |
574 // chrome://webrtc-internals. | 583 // chrome://webrtc-internals. |
575 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; | 584 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; |
576 | 585 |
577 // The count of RenderWidgets running through this thread. | 586 // The count of RenderWidgets running through this thread. |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 }; | 711 }; |
703 | 712 |
704 using PendingFrameCreateMap = | 713 using PendingFrameCreateMap = |
705 std::map<int, scoped_refptr<PendingFrameCreate>>; | 714 std::map<int, scoped_refptr<PendingFrameCreate>>; |
706 PendingFrameCreateMap pending_frame_creates_; | 715 PendingFrameCreateMap pending_frame_creates_; |
707 | 716 |
708 mojom::StoragePartitionServicePtr storage_partition_service_; | 717 mojom::StoragePartitionServicePtr storage_partition_service_; |
709 | 718 |
710 mojom::RenderFrameMessageFilterAssociatedPtr render_frame_message_filter_; | 719 mojom::RenderFrameMessageFilterAssociatedPtr render_frame_message_filter_; |
711 | 720 |
| 721 device::mojom::TimeZoneMonitorPtr time_zone_monitor_; |
| 722 |
712 bool is_renderer_suspended_; | 723 bool is_renderer_suspended_; |
713 | 724 |
714 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 725 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
715 }; | 726 }; |
716 | 727 |
717 #if defined(COMPILER_MSVC) | 728 #if defined(COMPILER_MSVC) |
718 #pragma warning(pop) | 729 #pragma warning(pop) |
719 #endif | 730 #endif |
720 | 731 |
721 } // namespace content | 732 } // namespace content |
722 | 733 |
723 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 734 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
OLD | NEW |