| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); | 471 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); |
| 470 | 472 |
| 471 private: | 473 private: |
| 472 // IPC::Listener | 474 // IPC::Listener |
| 473 void OnChannelError() override; | 475 void OnChannelError() override; |
| 474 | 476 |
| 475 // ChildThread | 477 // ChildThread |
| 476 bool OnControlMessageReceived(const IPC::Message& msg) override; | 478 bool OnControlMessageReceived(const IPC::Message& msg) override; |
| 477 void OnProcessBackgrounded(bool backgrounded) override; | 479 void OnProcessBackgrounded(bool backgrounded) override; |
| 478 void OnProcessPurgeAndSuspend() override; | 480 void OnProcessPurgeAndSuspend() override; |
| 481 |
| 479 void RecordAction(const base::UserMetricsAction& action) override; | 482 void RecordAction(const base::UserMetricsAction& action) override; |
| 480 void RecordComputedAction(const std::string& action) override; | 483 void RecordComputedAction(const std::string& action) override; |
| 481 | 484 |
| 482 // GpuChannelHostFactory implementation: | 485 // GpuChannelHostFactory implementation: |
| 483 bool IsMainThread() override; | 486 bool IsMainThread() override; |
| 484 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; | 487 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; |
| 485 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( | 488 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( |
| 486 size_t size) override; | 489 size_t size) override; |
| 487 | 490 |
| 488 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); | 491 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 void OnSystemColorsChanged(int aqua_color_variant, | 524 void OnSystemColorsChanged(int aqua_color_variant, |
| 522 const std::string& highlight_text_color, | 525 const std::string& highlight_text_color, |
| 523 const std::string& highlight_color); | 526 const std::string& highlight_color); |
| 524 #endif | 527 #endif |
| 525 void OnCreateNewSharedWorker( | 528 void OnCreateNewSharedWorker( |
| 526 const WorkerProcessMsg_CreateWorker_Params& params); | 529 const WorkerProcessMsg_CreateWorker_Params& params); |
| 527 bool RendererIsHidden() const; | 530 bool RendererIsHidden() const; |
| 528 void OnRendererHidden(); | 531 void OnRendererHidden(); |
| 529 void OnRendererVisible(); | 532 void OnRendererVisible(); |
| 530 | 533 |
| 534 void OnDumpMemoryUsage() const; |
| 535 |
| 531 void ReleaseFreeMemory(); | 536 void ReleaseFreeMemory(); |
| 532 | 537 |
| 533 void OnSyncMemoryPressure( | 538 void OnSyncMemoryPressure( |
| 534 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 539 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
| 535 | 540 |
| 536 std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( | 541 std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( |
| 537 int routing_id); | 542 int routing_id); |
| 538 | 543 |
| 539 // These objects live solely on the render thread. | 544 // These objects live solely on the render thread. |
| 540 std::unique_ptr<AppCacheDispatcher> appcache_dispatcher_; | 545 std::unique_ptr<AppCacheDispatcher> appcache_dispatcher_; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 731 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 727 }; | 732 }; |
| 728 | 733 |
| 729 #if defined(COMPILER_MSVC) | 734 #if defined(COMPILER_MSVC) |
| 730 #pragma warning(pop) | 735 #pragma warning(pop) |
| 731 #endif | 736 #endif |
| 732 | 737 |
| 733 } // namespace content | 738 } // namespace content |
| 734 | 739 |
| 735 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 740 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |