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

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

Issue 2727663004: Use TabLoader in TabRestoreService. (Closed)
Patch Set: Fix review notes: comments, namings etc. Created 3 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 | « no previous file | chrome/browser/sessions/tab_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/tab_loader.h
diff --git a/chrome/browser/sessions/tab_loader.h b/chrome/browser/sessions/tab_loader.h
index 81c6dd0b1e18fc89ea341b176cf3fc1deac35578..c3528f3e0181fe4296275331874eac9d806fc3a1 100644
--- a/chrome/browser/sessions/tab_loader.h
+++ b/chrome/browser/sessions/tab_loader.h
@@ -63,6 +63,8 @@ class TabLoader : public content::NotificationObserver,
private:
FRIEND_TEST_ALL_PREFIXES(TabLoaderTest, OnMemoryStateChange);
+ FRIEND_TEST_ALL_PREFIXES(TabRestoreTest,
+ TabsFromRestoredWindowsAreLoadedGradually);
friend class base::RefCounted<TabLoader>;
@@ -123,6 +125,11 @@ class TabLoader : public content::NotificationObserver,
// Stops loading tabs to purge memory by stopping to load any more tabs.
void StopLoadingTabs();
+ // Limit the number of loaded tabs.
+ // Value of 0 restores default behavior. In test mode command line flags and
+ // free memory size are not taken into account.
+ static void SetMaxLoadedTabCountForTest(size_t value);
+
std::unique_ptr<TabLoaderDelegate> delegate_;
// Listens for system under memory pressure notifications and stops loading
@@ -144,6 +151,10 @@ class TabLoader : public content::NotificationObserver,
// The tabs we need to load.
TabsToLoad tabs_to_load_;
+ // The number of tabs started to load.
+ // (This value never decreases.)
+ size_t started_to_load_count_;
+
base::OneShotTimer force_load_timer_;
// The time the restore process started.
« no previous file with comments | « no previous file | chrome/browser/sessions/tab_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698