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

Unified Diff: components/history/core/browser/history_backend.cc

Issue 2311723002: Move memory_coordinator_client and its registry to base/memory (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
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 f9e2b57d30b84da86b32032e04514abc76979d12..0b697bde970d8b9d2646443dca9d052ca7511128 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -39,7 +39,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"
@@ -235,11 +234,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_);
@@ -258,12 +252,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,
@@ -919,12 +909,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_)
« no previous file with comments | « components/history/core/browser/history_backend.h ('k') | components/memory_coordinator/browser/memory_coordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698