Commit bb074802 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Commit Bot

Remove MemoryCoordinatorClient from content/gpu.

BUG=888904

Change-Id: I5e8b2d3d3e2d0975cc5713fdae4b85969308a906
Reviewed-on: https://chromium-review.googlesource.com/c/1264435Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/master@{#599582}
parent 1892e3db
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/memory/memory_coordinator_client_registry.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
...@@ -193,7 +192,6 @@ GpuChildThread::GpuChildThread(base::RepeatingClosure quit_closure, ...@@ -193,7 +192,6 @@ GpuChildThread::GpuChildThread(base::RepeatingClosure quit_closure,
} }
GpuChildThread::~GpuChildThread() { GpuChildThread::~GpuChildThread() {
base::MemoryCoordinatorClientRegistry::GetInstance()->Unregister(this);
} }
void GpuChildThread::Init(const base::Time& process_start_time) { void GpuChildThread::Init(const base::Time& process_start_time) {
...@@ -230,7 +228,6 @@ void GpuChildThread::Init(const base::Time& process_start_time) { ...@@ -230,7 +228,6 @@ void GpuChildThread::Init(const base::Time& process_start_time) {
StartServiceManagerConnection(); StartServiceManagerConnection();
base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this);
memory_pressure_listener_ = memory_pressure_listener_ =
std::make_unique<base::MemoryPressureListener>(base::BindRepeating( std::make_unique<base::MemoryPressureListener>(base::BindRepeating(
&GpuChildThread::OnMemoryPressure, base::Unretained(this))); &GpuChildThread::OnMemoryPressure, base::Unretained(this)));
...@@ -308,17 +305,11 @@ void GpuChildThread::BindServiceFactoryRequest( ...@@ -308,17 +305,11 @@ void GpuChildThread::BindServiceFactoryRequest(
std::move(request)); std::move(request));
} }
void GpuChildThread::OnTrimMemoryImmediately() {
OnPurgeMemory();
}
void GpuChildThread::OnMemoryPressure( void GpuChildThread::OnMemoryPressure(
base::MemoryPressureListener::MemoryPressureLevel level) { base::MemoryPressureListener::MemoryPressureLevel level) {
if (level == base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) if (level != base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL)
OnPurgeMemory(); return;
}
void GpuChildThread::OnPurgeMemory() {
base::allocator::ReleaseFreeMemory(); base::allocator::ReleaseFreeMemory();
if (viz_main_.discardable_shared_memory_manager()) if (viz_main_.discardable_shared_memory_manager())
viz_main_.discardable_shared_memory_manager()->ReleaseFreeMemory(); viz_main_.discardable_shared_memory_manager()->ReleaseFreeMemory();
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/memory_coordinator_client.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -47,8 +46,7 @@ class GpuServiceFactory; ...@@ -47,8 +46,7 @@ class GpuServiceFactory;
// IPC messages to gpu::GpuChannelManager, which is responsible for issuing // IPC messages to gpu::GpuChannelManager, which is responsible for issuing
// rendering commands to the GPU. // rendering commands to the GPU.
class GpuChildThread : public ChildThreadImpl, class GpuChildThread : public ChildThreadImpl,
public viz::VizMainImpl::Delegate, public viz::VizMainImpl::Delegate {
public base::MemoryCoordinatorClient {
public: public:
GpuChildThread(base::RepeatingClosure quit_closure, GpuChildThread(base::RepeatingClosure quit_closure,
std::unique_ptr<gpu::GpuInit> gpu_init, std::unique_ptr<gpu::GpuInit> gpu_init,
...@@ -85,10 +83,6 @@ class GpuChildThread : public ChildThreadImpl, ...@@ -85,10 +83,6 @@ class GpuChildThread : public ChildThreadImpl,
base::SingleThreadTaskRunner* task_runner) override; base::SingleThreadTaskRunner* task_runner) override;
void QuitMainMessageLoop() override; void QuitMainMessageLoop() override;
// ChildMemoryCoordinatorDelegate implementation.
void OnTrimMemoryImmediately() override;
// base::MemoryCoordinatorClient implementation:
void OnPurgeMemory() override;
void OnMemoryPressure( void OnMemoryPressure(
base::MemoryPressureListener::MemoryPressureLevel level); base::MemoryPressureListener::MemoryPressureLevel level);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment