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

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

Issue 1087063003: [Session restore] Expose lazy mode and fix browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky@ review. Created 5 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/sessions/session_restore.h ('k') | chrome/browser/sessions/session_restore_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore.cc
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index 82d6432b38bc273c043928e2093f387a7f7fa0f1..b1f27335cceafe75034aa52f6562f9a1c5d4e1d3 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -16,6 +16,7 @@
#include "base/debug/alias.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
@@ -298,7 +299,9 @@ class SessionRestoreImpl : public content::NotificationObserver {
if (succeeded) {
// Start Loading tabs.
- SessionRestoreDelegate::RestoreTabs(contents_created, restore_started_);
+ bool active_only = SessionRestore::WillLoadActiveTabsOnly();
+ SessionRestoreDelegate::RestoreTabs(contents_created, restore_started_,
+ active_only);
}
if (!synchronous_) {
@@ -818,5 +821,14 @@ SessionRestore::CallbackSubscription
}
// static
+bool SessionRestore::WillLoadActiveTabsOnly() {
+ base::FieldTrial* trial =
+ base::FieldTrialList::Find("SessionRestoreBackgroundLoading");
+ if (!trial || trial->group_name() == "Restore")
+ return false;
+ return true;
+}
+
+// static
base::CallbackList<void(int)>*
SessionRestore::on_session_restored_callbacks_ = nullptr;
« no previous file with comments | « chrome/browser/sessions/session_restore.h ('k') | chrome/browser/sessions/session_restore_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698