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

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

Issue 902613003: Record the number of tabs in a session restore in SampledProfile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more detailed description of meaning of num tabs, given by sky Created 5 years, 10 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/metrics/perf_provider_chromeos.cc ('k') | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore.h
diff --git a/chrome/browser/sessions/session_restore.h b/chrome/browser/sessions/session_restore.h
index f756f10a0e6ae9940f161e5a749bd4630f71a451..8e7193aa462e7d6cfd0e3a03b3a690529f2dd09a 100644
--- a/chrome/browser/sessions/session_restore.h
+++ b/chrome/browser/sessions/session_restore.h
@@ -40,12 +40,12 @@ class SessionRestore {
};
// Notification callback list.
- using CallbackList = base::CallbackList<void(void)>;
+ using CallbackList = base::CallbackList<void(int)>;
// Used by objects calling RegisterOnSessionRestoredCallback() to de-register
// themselves when they are destroyed.
using CallbackSubscription =
- scoped_ptr<base::CallbackList<void(void)>::Subscription>;
+ scoped_ptr<base::CallbackList<void(int)>::Subscription>;
// Restores the last session. |behavior| is a bitmask of Behaviors, see it
// for details. If |browser| is non-null the tabs for the first window are
@@ -92,9 +92,20 @@ class SessionRestore {
static bool IsRestoringSynchronously();
// Register callbacks for session restore events. These callbacks are stored
- // in on_session_restored_callbacks_.
+ // in |on_session_restored_callbacks_|.
+ // The callback is supplied an integer arg representing a tab count. The exact
+ // meaning and timing depend upon the restore type:
+ // - SessionRestore::SYNCHRONOUS: the parameter is the number of tabs that
+ // were created. Additionally the callback is invoked immediately after the
+ // tabs have been created. That is, the tabs are not necessarily loading.
+ // - For all other restore types the parameter is the number of tabs that were
+ // restored and is sent after all tabs have started loading. Additionally if a
+ // request to restore tabs comes in while a previous request to restore tabs
+ // has not yet completed (loading tabs is throttled), then the callback is
+ // only notified once both sets of tabs have started loading and with the
+ // total number of tabs for both restores.
static CallbackSubscription RegisterOnSessionRestoredCallback(
- const base::Closure& callback);
+ const base::Callback<void(int)>& callback);
// The max number of non-selected tabs SessionRestore loads when restoring
// a session. A value of 0 indicates all tabs are loaded at once.
« no previous file with comments | « chrome/browser/metrics/perf_provider_chromeos.cc ('k') | chrome/browser/sessions/session_restore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698