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

Side by Side Diff: chrome/browser/resource_coordinator/tab_manager.h

Issue 2930013005: [Tab Metrics] Measure FP, FCP and FMP for Foreground Tab during Session Restore (Closed)
Patch Set: Reset the initial-foreground-tab-changed flag for each session restore. Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ 5 #ifndef CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_
6 #define CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ 6 #define CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 // Returns a unique ID for a WebContents. Do not cast back to a pointer, as 156 // Returns a unique ID for a WebContents. Do not cast back to a pointer, as
157 // the WebContents could be deleted if the user closed the tab. 157 // the WebContents could be deleted if the user closed the tab.
158 static int64_t IdFromWebContents(content::WebContents* web_contents); 158 static int64_t IdFromWebContents(content::WebContents* web_contents);
159 159
160 // Return whether tabs are being loaded during session restore. 160 // Return whether tabs are being loaded during session restore.
161 bool IsSessionRestoreLoadingTabs() const { 161 bool IsSessionRestoreLoadingTabs() const {
162 return is_session_restore_loading_tabs_; 162 return is_session_restore_loading_tabs_;
163 } 163 }
164 164
165 bool HasSessionRestoreInitialForegroundTabChanged() const {
166 return initial_session_restore_foreground_tab_changed_;
167 }
168
165 private: 169 private:
166 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, PurgeBackgroundRenderer); 170 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, PurgeBackgroundRenderer);
167 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ActivateTabResetPurgeState); 171 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ActivateTabResetPurgeState);
168 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ShouldPurgeAtDefaultTime); 172 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ShouldPurgeAtDefaultTime);
169 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DefaultTimeToPurgeInCorrectRange); 173 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DefaultTimeToPurgeInCorrectRange);
170 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, AutoDiscardable); 174 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, AutoDiscardable);
171 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CanOnlyDiscardOnce); 175 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CanOnlyDiscardOnce);
172 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ChildProcessNotifications); 176 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ChildProcessNotifications);
173 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, Comparator); 177 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, Comparator);
174 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DiscardedTabKeepsLastActiveTime); 178 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DiscardedTabKeepsLastActiveTime);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 std::vector<BrowserInfo> test_browser_info_list_; 394 std::vector<BrowserInfo> test_browser_info_list_;
391 395
392 // List of observers that will receive notifications on state changes. 396 // List of observers that will receive notifications on state changes.
393 base::ObserverList<TabManagerObserver> observers_; 397 base::ObserverList<TabManagerObserver> observers_;
394 398
395 bool is_session_restore_loading_tabs_; 399 bool is_session_restore_loading_tabs_;
396 400
397 class TabManagerSessionRestoreObserver; 401 class TabManagerSessionRestoreObserver;
398 std::unique_ptr<TabManagerSessionRestoreObserver> session_restore_observer_; 402 std::unique_ptr<TabManagerSessionRestoreObserver> session_restore_observer_;
399 403
404 // Whether the user has switched from the initial foreground tab or not.
405 bool initial_session_restore_foreground_tab_changed_;
406
400 // Weak pointer factory used for posting delayed tasks. 407 // Weak pointer factory used for posting delayed tasks.
401 base::WeakPtrFactory<TabManager> weak_ptr_factory_; 408 base::WeakPtrFactory<TabManager> weak_ptr_factory_;
402 409
403 DISALLOW_COPY_AND_ASSIGN(TabManager); 410 DISALLOW_COPY_AND_ASSIGN(TabManager);
404 }; 411 };
405 412
406 } // namespace resource_coordinator 413 } // namespace resource_coordinator
407 414
408 #endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ 415 #endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698