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> |
| 9 #include <stdint.h> |
| 10 |
8 #include <set> | 11 #include <set> |
9 #include <string> | 12 #include <string> |
10 #include <vector> | 13 #include <vector> |
11 | 14 |
12 #include "base/cancelable_callback.h" | 15 #include "base/cancelable_callback.h" |
| 16 #include "base/macros.h" |
13 #include "base/memory/memory_pressure_listener.h" | 17 #include "base/memory/memory_pressure_listener.h" |
14 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
15 #include "base/metrics/user_metrics_action.h" | 19 #include "base/metrics/user_metrics_action.h" |
16 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
17 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
18 #include "base/threading/thread_checker.h" | 22 #include "base/threading/thread_checker.h" |
19 #include "base/timer/timer.h" | 23 #include "base/timer/timer.h" |
20 #include "build/build_config.h" | 24 #include "build/build_config.h" |
21 #include "content/child/child_thread_impl.h" | 25 #include "content/child/child_thread_impl.h" |
22 #include "content/common/content_export.h" | 26 #include "content/common/content_export.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // Notify V8 that the date/time configuration of the system might have | 162 // Notify V8 that the date/time configuration of the system might have |
159 // changed. | 163 // changed. |
160 static void NotifyTimezoneChange(); | 164 static void NotifyTimezoneChange(); |
161 | 165 |
162 // RenderThread implementation: | 166 // RenderThread implementation: |
163 bool Send(IPC::Message* msg) override; | 167 bool Send(IPC::Message* msg) override; |
164 IPC::SyncChannel* GetChannel() override; | 168 IPC::SyncChannel* GetChannel() override; |
165 std::string GetLocale() override; | 169 std::string GetLocale() override; |
166 IPC::SyncMessageFilter* GetSyncMessageFilter() override; | 170 IPC::SyncMessageFilter* GetSyncMessageFilter() override; |
167 scoped_refptr<base::SingleThreadTaskRunner> GetIOMessageLoopProxy() override; | 171 scoped_refptr<base::SingleThreadTaskRunner> GetIOMessageLoopProxy() override; |
168 void AddRoute(int32 routing_id, IPC::Listener* listener) override; | 172 void AddRoute(int32_t routing_id, IPC::Listener* listener) override; |
169 void RemoveRoute(int32 routing_id) override; | 173 void RemoveRoute(int32_t routing_id) override; |
170 int GenerateRoutingID() override; | 174 int GenerateRoutingID() override; |
171 void AddFilter(IPC::MessageFilter* filter) override; | 175 void AddFilter(IPC::MessageFilter* filter) override; |
172 void RemoveFilter(IPC::MessageFilter* filter) override; | 176 void RemoveFilter(IPC::MessageFilter* filter) override; |
173 void AddObserver(RenderProcessObserver* observer) override; | 177 void AddObserver(RenderProcessObserver* observer) override; |
174 void RemoveObserver(RenderProcessObserver* observer) override; | 178 void RemoveObserver(RenderProcessObserver* observer) override; |
175 void SetResourceDispatcherDelegate( | 179 void SetResourceDispatcherDelegate( |
176 ResourceDispatcherDelegate* delegate) override; | 180 ResourceDispatcherDelegate* delegate) override; |
177 void EnsureWebKitInitialized() override; | 181 void EnsureWebKitInitialized() override; |
178 void RecordAction(const base::UserMetricsAction& action) override; | 182 void RecordAction(const base::UserMetricsAction& action) override; |
179 void RecordComputedAction(const std::string& action) override; | 183 void RecordComputedAction(const std::string& action) override; |
180 scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer( | 184 scoped_ptr<base::SharedMemory> HostAllocateSharedMemoryBuffer( |
181 size_t buffer_size) override; | 185 size_t buffer_size) override; |
182 cc::SharedBitmapManager* GetSharedBitmapManager() override; | 186 cc::SharedBitmapManager* GetSharedBitmapManager() override; |
183 void RegisterExtension(v8::Extension* extension) override; | 187 void RegisterExtension(v8::Extension* extension) override; |
184 void ScheduleIdleHandler(int64 initial_delay_ms) override; | 188 void ScheduleIdleHandler(int64_t initial_delay_ms) override; |
185 void IdleHandler() override; | 189 void IdleHandler() override; |
186 int64 GetIdleNotificationDelayInMs() const override; | 190 int64_t GetIdleNotificationDelayInMs() const override; |
187 void SetIdleNotificationDelayInMs( | 191 void SetIdleNotificationDelayInMs( |
188 int64 idle_notification_delay_in_ms) override; | 192 int64_t idle_notification_delay_in_ms) override; |
189 void UpdateHistograms(int sequence_number) override; | 193 void UpdateHistograms(int sequence_number) override; |
190 int PostTaskToAllWebWorkers(const base::Closure& closure) override; | 194 int PostTaskToAllWebWorkers(const base::Closure& closure) override; |
191 bool ResolveProxy(const GURL& url, std::string* proxy_list) override; | 195 bool ResolveProxy(const GURL& url, std::string* proxy_list) override; |
192 base::WaitableEvent* GetShutdownEvent() override; | 196 base::WaitableEvent* GetShutdownEvent() override; |
193 ServiceRegistry* GetServiceRegistry() override; | 197 ServiceRegistry* GetServiceRegistry() override; |
194 | 198 |
195 // CompositorDependencies implementation. | 199 // CompositorDependencies implementation. |
196 bool IsGpuRasterizationForced() override; | 200 bool IsGpuRasterizationForced() override; |
197 bool IsGpuRasterizationEnabled() override; | 201 bool IsGpuRasterizationEnabled() override; |
198 int GetGpuRasterizationMSAASampleCount() override; | 202 int GetGpuRasterizationMSAASampleCount() override; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 | 435 |
432 // Called by a RenderWidget when it is created or destroyed. This | 436 // Called by a RenderWidget when it is created or destroyed. This |
433 // allows the process to know when there are no visible widgets. | 437 // allows the process to know when there are no visible widgets. |
434 void WidgetCreated(); | 438 void WidgetCreated(); |
435 // Note: A widget must not be hidden when it is destroyed - ensure that | 439 // Note: A widget must not be hidden when it is destroyed - ensure that |
436 // WidgetRestored is called before WidgetDestroyed for any hidden widget. | 440 // WidgetRestored is called before WidgetDestroyed for any hidden widget. |
437 void WidgetDestroyed(); | 441 void WidgetDestroyed(); |
438 void WidgetHidden(); | 442 void WidgetHidden(); |
439 void WidgetRestored(); | 443 void WidgetRestored(); |
440 | 444 |
441 void AddEmbeddedWorkerRoute(int32 routing_id, IPC::Listener* listener); | 445 void AddEmbeddedWorkerRoute(int32_t routing_id, IPC::Listener* listener); |
442 void RemoveEmbeddedWorkerRoute(int32 routing_id); | 446 void RemoveEmbeddedWorkerRoute(int32_t routing_id); |
443 | 447 |
444 void RegisterPendingRenderFrameConnect( | 448 void RegisterPendingRenderFrameConnect( |
445 int routing_id, | 449 int routing_id, |
446 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 450 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
447 mojo::ServiceProviderPtr exposed_services); | 451 mojo::ServiceProviderPtr exposed_services); |
448 | 452 |
449 protected: | 453 protected: |
450 RenderThreadImpl(const InProcessChildThreadParams& params, | 454 RenderThreadImpl(const InProcessChildThreadParams& params, |
451 scoped_ptr<scheduler::RendererScheduler> scheduler); | 455 scoped_ptr<scheduler::RendererScheduler> scheduler); |
452 RenderThreadImpl(scoped_ptr<base::MessageLoop> main_message_loop, | 456 RenderThreadImpl(scoped_ptr<base::MessageLoop> main_message_loop, |
453 scoped_ptr<scheduler::RendererScheduler> scheduler); | 457 scoped_ptr<scheduler::RendererScheduler> scheduler); |
454 virtual void SetResourceDispatchTaskQueue( | 458 virtual void SetResourceDispatchTaskQueue( |
455 const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); | 459 const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); |
456 | 460 |
457 private: | 461 private: |
458 // ChildThread | 462 // ChildThread |
459 bool OnControlMessageReceived(const IPC::Message& msg) override; | 463 bool OnControlMessageReceived(const IPC::Message& msg) override; |
460 void OnProcessBackgrounded(bool backgrounded) override; | 464 void OnProcessBackgrounded(bool backgrounded) override; |
461 | 465 |
462 // GpuChannelHostFactory implementation: | 466 // GpuChannelHostFactory implementation: |
463 bool IsMainThread() override; | 467 bool IsMainThread() override; |
464 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; | 468 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; |
465 scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override; | 469 scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) override; |
466 CreateCommandBufferResult CreateViewCommandBuffer( | 470 CreateCommandBufferResult CreateViewCommandBuffer( |
467 int32 surface_id, | 471 int32_t surface_id, |
468 const GPUCreateCommandBufferConfig& init_params, | 472 const GPUCreateCommandBufferConfig& init_params, |
469 int32 route_id) override; | 473 int32_t route_id) override; |
470 | 474 |
471 void Init(); | 475 void Init(); |
472 | 476 |
473 void InitializeCompositorThread(); | 477 void InitializeCompositorThread(); |
474 | 478 |
475 void OnCreateNewFrame(FrameMsg_NewFrame_Params params); | 479 void OnCreateNewFrame(FrameMsg_NewFrame_Params params); |
476 void OnCreateNewFrameProxy(int routing_id, | 480 void OnCreateNewFrameProxy(int routing_id, |
477 int render_view_routing_id, | 481 int render_view_routing_id, |
478 int opener_routing_id, | 482 int opener_routing_id, |
479 int parent_routing_id, | 483 int parent_routing_id, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 // chrome://webrtc-internals. | 563 // chrome://webrtc-internals. |
560 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; | 564 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; |
561 | 565 |
562 // The count of RenderWidgets running through this thread. | 566 // The count of RenderWidgets running through this thread. |
563 int widget_count_; | 567 int widget_count_; |
564 | 568 |
565 // The count of hidden RenderWidgets running through this thread. | 569 // The count of hidden RenderWidgets running through this thread. |
566 int hidden_widget_count_; | 570 int hidden_widget_count_; |
567 | 571 |
568 // The current value of the idle notification timer delay. | 572 // The current value of the idle notification timer delay. |
569 int64 idle_notification_delay_in_ms_; | 573 int64_t idle_notification_delay_in_ms_; |
570 | 574 |
571 // The number of idle handler calls that skip sending idle notifications. | 575 // The number of idle handler calls that skip sending idle notifications. |
572 int idle_notifications_to_skip_; | 576 int idle_notifications_to_skip_; |
573 | 577 |
574 bool notify_webkit_of_modal_loop_; | 578 bool notify_webkit_of_modal_loop_; |
575 bool webkit_shared_timer_suspended_; | 579 bool webkit_shared_timer_suspended_; |
576 | 580 |
577 // The following flag is used to control layout test specific behavior. | 581 // The following flag is used to control layout test specific behavior. |
578 bool layout_test_mode_; | 582 bool layout_test_mode_; |
579 | 583 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 698 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
695 }; | 699 }; |
696 | 700 |
697 #if defined(COMPILER_MSVC) | 701 #if defined(COMPILER_MSVC) |
698 #pragma warning(pop) | 702 #pragma warning(pop) |
699 #endif | 703 #endif |
700 | 704 |
701 } // namespace content | 705 } // namespace content |
702 | 706 |
703 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 707 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
OLD | NEW |