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

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: Fix wrong include. 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 48db5d619d93abaad2c8e1dbd6186358d7601c6f..bf1b00a0258d2b777399dc95c5984891bc02b319 100644
--- a/chrome/browser/sessions/tab_loader.cc
+++ b/chrome/browser/sessions/tab_loader.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/favicon/content/content_favicon_driver.h"
+#include "components/variations/variations_associated_data.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
@@ -195,6 +196,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))
+ // 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