Skip to content

Commit

Permalink
Place SessionRestore/MemoryPressure interactions behind a field trial…
Browse files Browse the repository at this point in the history
… on Mac/Win platforms.

BUG=472772

Review URL: https://codereview.chromium.org/1134783002

Cr-Commit-Position: refs/heads/master@{#329183}
  • Loading branch information
chhamilton authored and Commit bot committed May 11, 2015
1 parent 0b68593 commit 20a481c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions chrome/browser/sessions/tab_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 20a481c

Please sign in to comment.