Index: components/history/core/browser/history_backend.cc |
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc |
index ff46dd8c34b1032a78050d742cfe70eacf79389e..d92049f71f0fd19e42b304c6586d0cde80fb4702 100644 |
--- a/components/history/core/browser/history_backend.cc |
+++ b/components/history/core/browser/history_backend.cc |
@@ -41,7 +41,6 @@ |
#include "components/history/core/browser/page_usage_data.h" |
#include "components/history/core/browser/typed_url_syncable_service.h" |
#include "components/history/core/browser/url_utils.h" |
-#include "components/memory_coordinator/browser/memory_coordinator.h" |
#include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
#include "sql/error_delegate_util.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
@@ -237,11 +236,6 @@ HistoryBackend::~HistoryBackend() { |
FROM_HERE, backend_destroy_task_); |
} |
- if (memory_coordinator::MemoryCoordinator::GetInstance()) { |
- memory_coordinator::MemoryCoordinator::GetInstance()->UnregisterClient( |
- this); |
- } |
- |
#if defined(OS_ANDROID) |
if (backend_client_ && !history_dir_.empty()) |
backend_client_->OnHistoryBackendDestroyed(this, history_dir_); |
@@ -260,12 +254,8 @@ void HistoryBackend::Init( |
InitImpl(history_database_params); |
delegate_->DBLoaded(); |
typed_url_syncable_service_.reset(new TypedUrlSyncableService(this)); |
- if (memory_coordinator::MemoryCoordinator::GetInstance()) { |
- memory_coordinator::MemoryCoordinator::GetInstance()->RegisterClient(this); |
- } else { |
- memory_pressure_listener_.reset(new base::MemoryPressureListener( |
- base::Bind(&HistoryBackend::OnMemoryPressure, base::Unretained(this)))); |
- } |
+ memory_pressure_listener_.reset(new base::MemoryPressureListener( |
+ base::Bind(&HistoryBackend::OnMemoryPressure, base::Unretained(this)))); |
} |
void HistoryBackend::SetOnBackendDestroyTask(base::MessageLoop* message_loop, |
@@ -749,19 +739,15 @@ void HistoryBackend::InitImpl( |
LOCAL_HISTOGRAM_TIMES("History.InitTime", TimeTicks::Now() - beginning_time); |
} |
-void HistoryBackend::TrimMemory(bool trim_aggressively) { |
- if (db_) |
- db_->TrimMemory(trim_aggressively); |
- if (thumbnail_db_) |
- thumbnail_db_->TrimMemory(trim_aggressively); |
-} |
- |
void HistoryBackend::OnMemoryPressure( |
base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { |
bool trim_aggressively = |
memory_pressure_level == |
base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL; |
- TrimMemory(trim_aggressively); |
+ if (db_) |
+ db_->TrimMemory(trim_aggressively); |
+ if (thumbnail_db_) |
+ thumbnail_db_->TrimMemory(trim_aggressively); |
} |
void HistoryBackend::CloseAllDatabases() { |
@@ -921,12 +907,6 @@ bool HistoryBackend::IsExpiredVisitTime(const base::Time& time) { |
return time < expirer_.GetCurrentExpirationTime(); |
} |
-void HistoryBackend::OnMemoryStateChange( |
- memory_coordinator::MemoryState state) { |
- bool trim_aggressively = state == memory_coordinator::MemoryState::SUSPENDED; |
- TrimMemory(trim_aggressively); |
-} |
- |
void HistoryBackend::SetPageTitle(const GURL& url, |
const base::string16& title) { |
if (!db_) |