| 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/malloc_statistics.h" |
| 17 #include "base/memory/memory_pressure_listener.h" | 18 #include "base/memory/memory_pressure_listener.h" |
| 18 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 19 #include "base/metrics/user_metrics_action.h" | 20 #include "base/metrics/user_metrics_action.h" |
| 20 #include "base/observer_list.h" | 21 #include "base/observer_list.h" |
| 21 #include "base/strings/string16.h" | 22 #include "base/strings/string16.h" |
| 22 #include "base/threading/thread_checker.h" | 23 #include "base/threading/thread_checker.h" |
| 23 #include "base/timer/timer.h" | 24 #include "base/timer/timer.h" |
| 24 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 26 #include "content/child/child_discardable_shared_memory_manager.h" |
| 25 #include "content/child/child_thread_impl.h" | 27 #include "content/child/child_thread_impl.h" |
| 26 #include "content/child/memory/child_memory_coordinator_impl.h" | 28 #include "content/child/memory/child_memory_coordinator_impl.h" |
| 27 #include "content/common/content_export.h" | 29 #include "content/common/content_export.h" |
| 28 #include "content/common/frame.mojom.h" | 30 #include "content/common/frame.mojom.h" |
| 29 #include "content/common/frame_replication_state.h" | 31 #include "content/common/frame_replication_state.h" |
| 30 #include "content/common/render_frame_message_filter.mojom.h" | 32 #include "content/common/render_frame_message_filter.mojom.h" |
| 31 #include "content/common/render_message_filter.mojom.h" | 33 #include "content/common/render_message_filter.mojom.h" |
| 32 #include "content/common/storage_partition_service.mojom.h" | 34 #include "content/common/storage_partition_service.mojom.h" |
| 33 #include "content/public/renderer/render_thread.h" | 35 #include "content/public/renderer/render_thread.h" |
| 34 #include "content/renderer/gpu/compositor_dependencies.h" | 36 #include "content/renderer/gpu/compositor_dependencies.h" |
| 35 #include "content/renderer/layout_test_dependencies.h" | 37 #include "content/renderer/layout_test_dependencies.h" |
| 36 #include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h" | 38 #include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h" |
| 37 #include "gpu/ipc/client/gpu_channel_host.h" | 39 #include "gpu/ipc/client/gpu_channel_host.h" |
| 38 #include "mojo/public/cpp/bindings/binding.h" | 40 #include "mojo/public/cpp/bindings/binding.h" |
| 39 #include "net/base/network_change_notifier.h" | 41 #include "net/base/network_change_notifier.h" |
| 40 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 42 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
| 41 #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" |
| 44 #include "third_party/WebKit/public/web/WebMemoryStatistics.h" |
| 42 #include "ui/gfx/native_widget_types.h" | 45 #include "ui/gfx/native_widget_types.h" |
| 43 | 46 |
| 44 #if defined(OS_MACOSX) | 47 #if defined(OS_MACOSX) |
| 45 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" | 48 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" |
| 46 #endif | 49 #endif |
| 47 | 50 |
| 48 class GrContext; | 51 class GrContext; |
| 49 class SkBitmap; | 52 class SkBitmap; |
| 50 struct FrameMsg_NewFrame_Params; | 53 struct FrameMsg_NewFrame_Params; |
| 51 struct ViewMsg_New_Params; | 54 struct ViewMsg_New_Params; |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); | 472 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); |
| 470 | 473 |
| 471 private: | 474 private: |
| 472 // IPC::Listener | 475 // IPC::Listener |
| 473 void OnChannelError() override; | 476 void OnChannelError() override; |
| 474 | 477 |
| 475 // ChildThread | 478 // ChildThread |
| 476 bool OnControlMessageReceived(const IPC::Message& msg) override; | 479 bool OnControlMessageReceived(const IPC::Message& msg) override; |
| 477 void OnProcessBackgrounded(bool backgrounded) override; | 480 void OnProcessBackgrounded(bool backgrounded) override; |
| 478 void OnProcessPurgeAndSuspend() override; | 481 void OnProcessPurgeAndSuspend() override; |
| 482 void OnDumpMemoryUsage(); |
| 483 |
| 484 blink::WebMemoryStatistics blink_memory_stats_; |
| 485 base::memory::MallocStatistics malloc_stats_; |
| 486 ChildDiscardableSharedMemoryManager::Statistics discardable_stats_; |
| 487 size_t v8_total_heap_usage_; |
| 488 |
| 479 void RecordAction(const base::UserMetricsAction& action) override; | 489 void RecordAction(const base::UserMetricsAction& action) override; |
| 480 void RecordComputedAction(const std::string& action) override; | 490 void RecordComputedAction(const std::string& action) override; |
| 481 | 491 |
| 482 // GpuChannelHostFactory implementation: | 492 // GpuChannelHostFactory implementation: |
| 483 bool IsMainThread() override; | 493 bool IsMainThread() override; |
| 484 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; | 494 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; |
| 485 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( | 495 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( |
| 486 size_t size) override; | 496 size_t size) override; |
| 487 | 497 |
| 488 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); | 498 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 736 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 727 }; | 737 }; |
| 728 | 738 |
| 729 #if defined(COMPILER_MSVC) | 739 #if defined(COMPILER_MSVC) |
| 730 #pragma warning(pop) | 740 #pragma warning(pop) |
| 731 #endif | 741 #endif |
| 732 | 742 |
| 733 } // namespace content | 743 } // namespace content |
| 734 | 744 |
| 735 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 745 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |