Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: content/renderer/render_thread_impl.h

Issue 2402983002: [TimeZoneMonitor] Decouple renderer side impl from content to blink. (Closed)
Patch Set: content_unittests does not need to init mojo edk any more by itself Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 17 matching lines...) Expand all
28 #include "content/common/content_export.h" 28 #include "content/common/content_export.h"
29 #include "content/common/frame.mojom.h" 29 #include "content/common/frame.mojom.h"
30 #include "content/common/frame_replication_state.h" 30 #include "content/common/frame_replication_state.h"
31 #include "content/common/render_frame_message_filter.mojom.h" 31 #include "content/common/render_frame_message_filter.mojom.h"
32 #include "content/common/render_message_filter.mojom.h" 32 #include "content/common/render_message_filter.mojom.h"
33 #include "content/common/renderer.mojom.h" 33 #include "content/common/renderer.mojom.h"
34 #include "content/common/storage_partition_service.mojom.h" 34 #include "content/common/storage_partition_service.mojom.h"
35 #include "content/public/renderer/render_thread.h" 35 #include "content/public/renderer/render_thread.h"
36 #include "content/renderer/gpu/compositor_dependencies.h" 36 #include "content/renderer/gpu/compositor_dependencies.h"
37 #include "content/renderer/layout_test_dependencies.h" 37 #include "content/renderer/layout_test_dependencies.h"
38 #include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h"
39 #include "gpu/ipc/client/gpu_channel_host.h" 38 #include "gpu/ipc/client/gpu_channel_host.h"
40 #include "mojo/public/cpp/bindings/associated_binding.h" 39 #include "mojo/public/cpp/bindings/associated_binding.h"
41 #include "mojo/public/cpp/bindings/binding.h" 40 #include "mojo/public/cpp/bindings/binding.h"
42 #include "net/base/network_change_notifier.h" 41 #include "net/base/network_change_notifier.h"
43 #include "third_party/WebKit/public/platform/WebConnectionType.h" 42 #include "third_party/WebKit/public/platform/WebConnectionType.h"
44 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h" 43 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h"
45 #include "ui/gfx/native_widget_types.h" 44 #include "ui/gfx/native_widget_types.h"
46 45
47 #if defined(OS_MACOSX) 46 #if defined(OS_MACOSX)
48 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" 47 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Most of the communication occurs in the form of IPC messages. They are 148 // Most of the communication occurs in the form of IPC messages. They are
150 // routed to the RenderThread according to the routing IDs of the messages. 149 // routed to the RenderThread according to the routing IDs of the messages.
151 // The routing IDs correspond to RenderView instances. 150 // The routing IDs correspond to RenderView instances.
152 class CONTENT_EXPORT RenderThreadImpl 151 class CONTENT_EXPORT RenderThreadImpl
153 : public RenderThread, 152 : public RenderThread,
154 public ChildThreadImpl, 153 public ChildThreadImpl,
155 public gpu::GpuChannelHostFactory, 154 public gpu::GpuChannelHostFactory,
156 public blink::scheduler::RendererScheduler::RAILModeObserver, 155 public blink::scheduler::RendererScheduler::RAILModeObserver,
157 public ChildMemoryCoordinatorDelegate, 156 public ChildMemoryCoordinatorDelegate,
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 505
513 // mojom::Renderer: 506 // mojom::Renderer:
514 void CreateView(mojom::CreateViewParamsPtr params) override; 507 void CreateView(mojom::CreateViewParamsPtr params) override;
515 void CreateFrame(mojom::CreateFrameParamsPtr params) override; 508 void CreateFrame(mojom::CreateFrameParamsPtr params) override;
516 void CreateFrameProxy(int32_t routing_id, 509 void CreateFrameProxy(int32_t routing_id,
517 int32_t render_view_routing_id, 510 int32_t render_view_routing_id,
518 int32_t opener_routing_id, 511 int32_t opener_routing_id,
519 int32_t parent_routing_id, 512 int32_t parent_routing_id,
520 const FrameReplicationState& replicated_state) override; 513 const FrameReplicationState& replicated_state) override;
521 514
522 // device::mojom::TimeZoneClient:
523 void OnTimeZoneChange(const std::string& zoneId) override;
524 void OnMemoryPressure( 515 void OnMemoryPressure(
525 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); 516 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
526 #if defined(OS_ANDROID) 517 #if defined(OS_ANDROID)
527 void OnSetWebKitSharedTimersSuspended(bool suspend); 518 void OnSetWebKitSharedTimersSuspended(bool suspend);
528 #endif 519 #endif
529 #if defined(OS_MACOSX) 520 #if defined(OS_MACOSX)
530 void OnUpdateScrollbarTheme( 521 void OnUpdateScrollbarTheme(
531 const ViewMsg_UpdateScrollbarTheme_Params& params); 522 const ViewMsg_UpdateScrollbarTheme_Params& params);
532 void OnSystemColorsChanged(int aqua_color_variant, 523 void OnSystemColorsChanged(int aqua_color_variant,
533 const std::string& highlight_text_color, 524 const std::string& highlight_text_color,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // Dispatches all P2P sockets. 574 // Dispatches all P2P sockets.
584 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_; 575 scoped_refptr<P2PSocketDispatcher> p2p_socket_dispatcher_;
585 576
586 // Used for communicating registering AEC dump consumers with the browser and 577 // Used for communicating registering AEC dump consumers with the browser and
587 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is 578 // receving AEC dump file handles when AEC dump is enabled. An AEC dump is
588 // diagnostic audio data for WebRTC stored locally when enabled by the user in 579 // diagnostic audio data for WebRTC stored locally when enabled by the user in
589 // chrome://webrtc-internals. 580 // chrome://webrtc-internals.
590 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; 581 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_;
591 #endif 582 #endif
592 583
593 mojo::Binding<device::mojom::TimeZoneMonitorClient>
594 time_zone_monitor_binding_;
595
596 // Used on the render thread. 584 // Used on the render thread.
597 std::unique_ptr<VideoCaptureImplManager> vc_manager_; 585 std::unique_ptr<VideoCaptureImplManager> vc_manager_;
598 586
599 // The count of RenderWidgets running through this thread. 587 // The count of RenderWidgets running through this thread.
600 int widget_count_; 588 int widget_count_;
601 589
602 // The count of hidden RenderWidgets running through this thread. 590 // The count of hidden RenderWidgets running through this thread.
603 int hidden_widget_count_; 591 int hidden_widget_count_;
604 592
605 // The current value of the idle notification timer delay. 593 // The current value of the idle notification timer delay.
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 730 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
743 }; 731 };
744 732
745 #if defined(COMPILER_MSVC) 733 #if defined(COMPILER_MSVC)
746 #pragma warning(pop) 734 #pragma warning(pop)
747 #endif 735 #endif
748 736
749 } // namespace content 737 } // namespace content
750 738
751 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 739 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698