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

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

Issue 1909903002: Enable TabManager on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/memory/tab_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory/tab_manager.cc
diff --git a/chrome/browser/memory/tab_manager.cc b/chrome/browser/memory/tab_manager.cc
index a2299862de6deec44a10eb2a4db511c985a7d215..1c64eccf2d91db2943a0410efeec80ab74d86b40 100644
--- a/chrome/browser/memory/tab_manager.cc
+++ b/chrome/browser/memory/tab_manager.cc
@@ -70,10 +70,12 @@ namespace {
// value.
const int kAdjustmentIntervalSeconds = 10;
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
// For each period of this length record a statistic to indicate whether or not
// the user experienced a low memory event. If this interval is changed,
// Tabs.Discard.DiscardInLastMinute must be replaced with a new statistic.
const int kRecentTabDiscardIntervalSeconds = 60;
+#endif
// If there has been no priority adjustment in this interval, assume the
// machine was suspended and correct the timing statistics.
@@ -197,6 +199,10 @@ void TabManager::Start() {
TimeDelta::FromSeconds(kAdjustmentIntervalSeconds),
this, &TabManager::UpdateTimerCallback);
}
+
+ // MemoryPressureMonitor is not implemented on Linux so far and tabs are never
+ // discarded.
+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
if (!recent_tab_discard_timer_.IsRunning()) {
recent_tab_discard_timer_.Start(
FROM_HERE, TimeDelta::FromSeconds(kRecentTabDiscardIntervalSeconds),
@@ -214,6 +220,7 @@ void TabManager::Start() {
OnMemoryPressure(level);
}
}
+#endif
}
void TabManager::Stop() {
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/memory/tab_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698