Chromium Code Reviews| 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 = |