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

Unified Diff: chrome/browser/sessions/tab_loader.cc

Issue 1134783002: Place SessionRestore/MemoryPressure interactions behind a field trial on Mac/Win platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/tab_loader.cc
diff --git a/chrome/browser/sessions/tab_loader.cc b/chrome/browser/sessions/tab_loader.cc
index 28b80ef4ae29c5ea9bf497e1afe7528a7eac47f4..810c6427606e98ce2953833c9ce06e3ec465f0f4 100644
--- a/chrome/browser/sessions/tab_loader.cc
+++ b/chrome/browser/sessions/tab_loader.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <string>
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/ui/browser.h"
@@ -183,6 +184,16 @@ void TabLoader::HandleTabClosedOrLoaded(NavigationController* controller) {
void TabLoader::OnMemoryPressure(
base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) {
+ // On Windows and Mac this mechanism is only experimentally enabled.
+#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS))
sky 2015/05/08 17:37:24 The problem with memory pressure or network discon
+ // If memory pressure integration isn't explicitly enabled then ignore these
+ // calls.
+ std::string react_to_memory_pressure = variations::GetVariationParamValue(
+ "IntelligentSessionRestore", "ReactToMemoryPressure");
+ if (react_to_memory_pressure != "true")
+ return;
+#endif
+
// When receiving a resource pressure level warning, we stop pre-loading more
// tabs since we are running in danger of loading more tabs by throwing out
// old ones.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698