| 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 |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/cancelable_callback.h" | 15 #include "base/cancelable_callback.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/memory_pressure_listener.h" | 17 #include "base/memory/memory_pressure_listener.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/metrics/user_metrics_action.h" | 19 #include "base/metrics/user_metrics_action.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 22 #include "base/threading/thread_checker.h" | 22 #include "base/threading/thread_checker.h" |
| 23 #include "base/timer/timer.h" | 23 #include "base/timer/timer.h" |
| 24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "content/child/child_discardable_shared_memory_manager.h" |
| 25 #include "content/child/child_thread_impl.h" | 26 #include "content/child/child_thread_impl.h" |
| 26 #include "content/child/memory/child_memory_coordinator_impl.h" | 27 #include "content/child/memory/child_memory_coordinator_impl.h" |
| 27 #include "content/common/content_export.h" | 28 #include "content/common/content_export.h" |
| 28 #include "content/common/frame.mojom.h" | 29 #include "content/common/frame.mojom.h" |
| 29 #include "content/common/frame_replication_state.h" | 30 #include "content/common/frame_replication_state.h" |
| 30 #include "content/common/render_frame_message_filter.mojom.h" | 31 #include "content/common/render_frame_message_filter.mojom.h" |
| 31 #include "content/common/render_message_filter.mojom.h" | 32 #include "content/common/render_message_filter.mojom.h" |
| 32 #include "content/common/storage_partition_service.mojom.h" | 33 #include "content/common/storage_partition_service.mojom.h" |
| 33 #include "content/public/renderer/render_thread.h" | 34 #include "content/public/renderer/render_thread.h" |
| 34 #include "content/renderer/gpu/compositor_dependencies.h" | 35 #include "content/renderer/gpu/compositor_dependencies.h" |
| 35 #include "content/renderer/layout_test_dependencies.h" | 36 #include "content/renderer/layout_test_dependencies.h" |
| 36 #include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h" | 37 #include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h" |
| 37 #include "gpu/ipc/client/gpu_channel_host.h" | 38 #include "gpu/ipc/client/gpu_channel_host.h" |
| 38 #include "mojo/public/cpp/bindings/binding.h" | 39 #include "mojo/public/cpp/bindings/binding.h" |
| 39 #include "net/base/network_change_notifier.h" | 40 #include "net/base/network_change_notifier.h" |
| 40 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 41 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
| 41 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 42 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 43 #include "third_party/WebKit/public/web/WebMemoryStatistics.h" |
| 42 #include "ui/gfx/native_widget_types.h" | 44 #include "ui/gfx/native_widget_types.h" |
| 43 | 45 |
| 44 #if defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
| 45 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" | 47 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" |
| 46 #endif | 48 #endif |
| 47 | 49 |
| 48 class GrContext; | 50 class GrContext; |
| 49 class SkBitmap; | 51 class SkBitmap; |
| 50 struct FrameMsg_NewFrame_Params; | 52 struct FrameMsg_NewFrame_Params; |
| 51 struct ViewMsg_New_Params; | 53 struct ViewMsg_New_Params; |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); | 470 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); |
| 469 | 471 |
| 470 private: | 472 private: |
| 471 // IPC::Listener | 473 // IPC::Listener |
| 472 void OnChannelError() override; | 474 void OnChannelError() override; |
| 473 | 475 |
| 474 // ChildThread | 476 // ChildThread |
| 475 bool OnControlMessageReceived(const IPC::Message& msg) override; | 477 bool OnControlMessageReceived(const IPC::Message& msg) override; |
| 476 void OnProcessBackgrounded(bool backgrounded) override; | 478 void OnProcessBackgrounded(bool backgrounded) override; |
| 477 void OnProcessPurgeAndSuspend() override; | 479 void OnProcessPurgeAndSuspend() override; |
| 480 |
| 478 void RecordAction(const base::UserMetricsAction& action) override; | 481 void RecordAction(const base::UserMetricsAction& action) override; |
| 479 void RecordComputedAction(const std::string& action) override; | 482 void RecordComputedAction(const std::string& action) override; |
| 480 | 483 |
| 481 // GpuChannelHostFactory implementation: | 484 // GpuChannelHostFactory implementation: |
| 482 bool IsMainThread() override; | 485 bool IsMainThread() override; |
| 483 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; | 486 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; |
| 484 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( | 487 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( |
| 485 size_t size) override; | 488 size_t size) override; |
| 486 | 489 |
| 487 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); | 490 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 void OnSystemColorsChanged(int aqua_color_variant, | 523 void OnSystemColorsChanged(int aqua_color_variant, |
| 521 const std::string& highlight_text_color, | 524 const std::string& highlight_text_color, |
| 522 const std::string& highlight_color); | 525 const std::string& highlight_color); |
| 523 #endif | 526 #endif |
| 524 void OnCreateNewSharedWorker( | 527 void OnCreateNewSharedWorker( |
| 525 const WorkerProcessMsg_CreateWorker_Params& params); | 528 const WorkerProcessMsg_CreateWorker_Params& params); |
| 526 bool RendererIsHidden() const; | 529 bool RendererIsHidden() const; |
| 527 void OnRendererHidden(); | 530 void OnRendererHidden(); |
| 528 void OnRendererVisible(); | 531 void OnRendererVisible(); |
| 529 | 532 |
| 533 void OnDumpMemoryUsage() const; |
| 534 |
| 530 void ReleaseFreeMemory(); | 535 void ReleaseFreeMemory(); |
| 531 | 536 |
| 532 void OnSyncMemoryPressure( | 537 void OnSyncMemoryPressure( |
| 533 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 538 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
| 534 | 539 |
| 535 std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( | 540 std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( |
| 536 int routing_id); | 541 int routing_id); |
| 537 | 542 |
| 538 // These objects live solely on the render thread. | 543 // These objects live solely on the render thread. |
| 539 std::unique_ptr<AppCacheDispatcher> appcache_dispatcher_; | 544 std::unique_ptr<AppCacheDispatcher> appcache_dispatcher_; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 727 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 723 }; | 728 }; |
| 724 | 729 |
| 725 #if defined(COMPILER_MSVC) | 730 #if defined(COMPILER_MSVC) |
| 726 #pragma warning(pop) | 731 #pragma warning(pop) |
| 727 #endif | 732 #endif |
| 728 | 733 |
| 729 } // namespace content | 734 } // namespace content |
| 730 | 735 |
| 731 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 736 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |