Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: content/renderer/render_thread_impl.h

Issue 2402643002: Make RenderThreadImpl a client of memory coordinator (Closed)
Patch Set: Address on haraken's review Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_coordinator_client.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"
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"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // 149 //
149 // Most of the communication occurs in the form of IPC messages. They are 150 // Most of the communication occurs in the form of IPC messages. They are
150 // routed to the RenderThread according to the routing IDs of the messages. 151 // routed to the RenderThread according to the routing IDs of the messages.
151 // The routing IDs correspond to RenderView instances. 152 // The routing IDs correspond to RenderView instances.
152 class CONTENT_EXPORT RenderThreadImpl 153 class CONTENT_EXPORT RenderThreadImpl
153 : public RenderThread, 154 : public RenderThread,
154 public ChildThreadImpl, 155 public ChildThreadImpl,
155 public gpu::GpuChannelHostFactory, 156 public gpu::GpuChannelHostFactory,
156 public blink::scheduler::RendererScheduler::RAILModeObserver, 157 public blink::scheduler::RendererScheduler::RAILModeObserver,
157 public ChildMemoryCoordinatorDelegate, 158 public ChildMemoryCoordinatorDelegate,
159 public base::MemoryCoordinatorClient,
158 NON_EXPORTED_BASE(public mojom::Renderer), 160 NON_EXPORTED_BASE(public mojom::Renderer),
159 // TODO(blundell): Separate this impl out into Blink. 161 // TODO(blundell): Separate this impl out into Blink.
160 NON_EXPORTED_BASE(public device::mojom::TimeZoneMonitorClient), 162 NON_EXPORTED_BASE(public device::mojom::TimeZoneMonitorClient),
161 NON_EXPORTED_BASE(public CompositorDependencies) { 163 NON_EXPORTED_BASE(public CompositorDependencies) {
162 public: 164 public:
163 static RenderThreadImpl* Create(const InProcessChildThreadParams& params); 165 static RenderThreadImpl* Create(const InProcessChildThreadParams& params);
164 static RenderThreadImpl* Create( 166 static RenderThreadImpl* Create(
165 std::unique_ptr<base::MessageLoop> main_message_loop, 167 std::unique_ptr<base::MessageLoop> main_message_loop,
166 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler); 168 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler);
167 static RenderThreadImpl* current(); 169 static RenderThreadImpl* current();
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 void OnProcessPurgeAndSuspend() override; 489 void OnProcessPurgeAndSuspend() override;
488 void RecordAction(const base::UserMetricsAction& action) override; 490 void RecordAction(const base::UserMetricsAction& action) override;
489 void RecordComputedAction(const std::string& action) override; 491 void RecordComputedAction(const std::string& action) override;
490 492
491 // GpuChannelHostFactory implementation: 493 // GpuChannelHostFactory implementation:
492 bool IsMainThread() override; 494 bool IsMainThread() override;
493 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; 495 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
494 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( 496 std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
495 size_t size) override; 497 size_t size) override;
496 498
499 // base::MemoryCoordinatorClient implementation:
500 void OnMemoryStateChange(base::MemoryState state) override;
501
502 void ClearMemory();
503
497 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); 504 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue);
498 505
499 void InitializeCompositorThread(); 506 void InitializeCompositorThread();
500 507
501 void InitializeWebKit( 508 void InitializeWebKit(
502 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); 509 scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue);
503 510
504 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); 511 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id);
505 #if defined(ENABLE_PLUGINS) 512 #if defined(ENABLE_PLUGINS)
506 void OnPurgePluginListCache(bool reload_pages); 513 void OnPurgePluginListCache(bool reload_pages);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 749 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
743 }; 750 };
744 751
745 #if defined(COMPILER_MSVC) 752 #if defined(COMPILER_MSVC)
746 #pragma warning(pop) 753 #pragma warning(pop)
747 #endif 754 #endif
748 755
749 } // namespace content 756 } // namespace content
750 757
751 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 758 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698