| 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 "base/trace_event/malloc_dump_provider.h" |
| 24 #include "build/build_config.h" | 25 #include "build/build_config.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/storage_partition_service.mojom.h" | 32 #include "content/common/storage_partition_service.mojom.h" |
| 32 #include "content/public/renderer/render_thread.h" | 33 #include "content/public/renderer/render_thread.h" |
| 33 #include "content/renderer/gpu/compositor_dependencies.h" | 34 #include "content/renderer/gpu/compositor_dependencies.h" |
| 34 #include "content/renderer/layout_test_dependencies.h" | 35 #include "content/renderer/layout_test_dependencies.h" |
| 35 #include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h" | 36 #include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h" |
| 36 #include "gpu/ipc/client/gpu_channel_host.h" | 37 #include "gpu/ipc/client/gpu_channel_host.h" |
| 37 #include "mojo/public/cpp/bindings/binding.h" | 38 #include "mojo/public/cpp/bindings/binding.h" |
| 38 #include "net/base/network_change_notifier.h" | 39 #include "net/base/network_change_notifier.h" |
| 39 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 40 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
| 40 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 41 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 42 #include "third_party/WebKit/public/web/WebMemoryStatistics.h" |
| 41 #include "ui/gfx/native_widget_types.h" | 43 #include "ui/gfx/native_widget_types.h" |
| 42 | 44 |
| 43 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
| 44 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" | 46 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" |
| 45 #endif | 47 #endif |
| 46 | 48 |
| 47 class GrContext; | 49 class GrContext; |
| 48 class SkBitmap; | 50 class SkBitmap; |
| 49 struct FrameMsg_NewFrame_Params; | 51 struct FrameMsg_NewFrame_Params; |
| 50 struct ViewMsg_New_Params; | 52 struct ViewMsg_New_Params; |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); | 469 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); |
| 468 | 470 |
| 469 private: | 471 private: |
| 470 // IPC::Listener | 472 // IPC::Listener |
| 471 void OnChannelError() override; | 473 void OnChannelError() override; |
| 472 | 474 |
| 473 // ChildThread | 475 // ChildThread |
| 474 bool OnControlMessageReceived(const IPC::Message& msg) override; | 476 bool OnControlMessageReceived(const IPC::Message& msg) override; |
| 475 void OnProcessBackgrounded(bool backgrounded) override; | 477 void OnProcessBackgrounded(bool backgrounded) override; |
| 476 void OnProcessPurgeAndSuspend() override; | 478 void OnProcessPurgeAndSuspend() override; |
| 479 void OnDumpMemoryUsage(); |
| 480 |
| 481 blink::WebMemoryStatistics blink_memory_stats_; |
| 482 base::trace_event::MallocStatistics malloc_stats_; |
| 483 size_t discardable_stats_; |
| 484 size_t v8_total_heap_usage_; |
| 485 |
| 477 void RecordAction(const base::UserMetricsAction& action) override; | 486 void RecordAction(const base::UserMetricsAction& action) override; |
| 478 void RecordComputedAction(const std::string& action) override; | 487 void RecordComputedAction(const std::string& action) override; |
| 479 | 488 |
| 480 // GpuChannelHostFactory implementation: | 489 // GpuChannelHostFactory implementation: |
| 481 bool IsMainThread() override; | 490 bool IsMainThread() override; |
| 482 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; | 491 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; |
| 483 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( | 492 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( |
| 484 size_t size) override; | 493 size_t size) override; |
| 485 | 494 |
| 486 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); | 495 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 732 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 724 }; | 733 }; |
| 725 | 734 |
| 726 #if defined(COMPILER_MSVC) | 735 #if defined(COMPILER_MSVC) |
| 727 #pragma warning(pop) | 736 #pragma warning(pop) |
| 728 #endif | 737 #endif |
| 729 | 738 |
| 730 } // namespace content | 739 } // namespace content |
| 731 | 740 |
| 732 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 741 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |