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

Unified Diff: chrome/browser/resource_coordinator/tab_manager.cc

Issue 2943953002: Don't disable MemoryPressureListener when MemoryCoordinator is enabled (Closed)
Patch Set: Fix namespace Created 3 years, 6 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
« no previous file with comments | « no previous file | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resource_coordinator/tab_manager.cc
diff --git a/chrome/browser/resource_coordinator/tab_manager.cc b/chrome/browser/resource_coordinator/tab_manager.cc
index af8a1774b67285945b79dcfa1788dbfec3a56c75..83dabb938cd144c35e919605ae907ea5fd0e743c 100644
--- a/chrome/browser/resource_coordinator/tab_manager.cc
+++ b/chrome/browser/resource_coordinator/tab_manager.cc
@@ -51,6 +51,7 @@
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_features.h"
#include "content/public/common/page_importance_signals.h"
#if defined(OS_CHROMEOS)
@@ -165,9 +166,11 @@ void TabManager::Start() {
this, &TabManager::RecordRecentTabDiscard);
}
start_time_ = NowTicks();
- // Create a |MemoryPressureListener| to listen for memory events.
+ // Create a |MemoryPressureListener| to listen for memory events when
+ // MemoryCoordinator is disabled. When MemoryCoordinator is enabled
+ // it asks TabManager to tab discarding.
fmeawad 2017/06/19 19:54:59 nit: to "do" tab discarding?
bashi 2017/06/21 23:46:23 Done. Thanks!
base::MemoryPressureMonitor* monitor = base::MemoryPressureMonitor::Get();
- if (monitor) {
+ if (monitor && !base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
memory_pressure_listener_.reset(new base::MemoryPressureListener(
base::Bind(&TabManager::OnMemoryPressure, base::Unretained(this))));
base::MemoryPressureListener::MemoryPressureLevel level =
« no previous file with comments | « no previous file | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698