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

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: Revise session restore start signal. 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 // Returns a unique ID for a WebContents. Do not cast back to a pointer, as 157 // Returns a unique ID for a WebContents. Do not cast back to a pointer, as
158 // the WebContents could be deleted if the user closed the tab. 158 // the WebContents could be deleted if the user closed the tab.
159 static int64_t IdFromWebContents(content::WebContents* web_contents); 159 static int64_t IdFromWebContents(content::WebContents* web_contents);
160 160
161 // Return whether tabs are being loaded during session restore. 161 // Return whether tabs are being loaded during session restore.
162 bool IsSessionRestoreLoadingTabs() const { 162 bool IsSessionRestoreLoadingTabs() const {
163 return is_session_restore_loading_tabs_; 163 return is_session_restore_loading_tabs_;
164 } 164 }
165 165
166 bool HasSessionRestoreInitialForegroundTabChanged() const {
167 return initial_session_restore_foreground_tab_changed_;
168 }
169
166 private: 170 private:
167 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, PurgeBackgroundRenderer); 171 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, PurgeBackgroundRenderer);
168 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ActivateTabResetPurgeState); 172 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ActivateTabResetPurgeState);
169 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ShouldPurgeAtDefaultTime); 173 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ShouldPurgeAtDefaultTime);
170 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DefaultTimeToPurgeInCorrectRange); 174 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DefaultTimeToPurgeInCorrectRange);
171 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, AutoDiscardable); 175 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, AutoDiscardable);
172 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CanOnlyDiscardOnce); 176 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CanOnlyDiscardOnce);
173 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ChildProcessNotifications); 177 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ChildProcessNotifications);
174 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, Comparator); 178 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, Comparator);
175 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DiscardedTabKeepsLastActiveTime); 179 FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DiscardedTabKeepsLastActiveTime);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 std::vector<BrowserInfo> test_browser_info_list_; 402 std::vector<BrowserInfo> test_browser_info_list_;
399 403
400 // List of observers that will receive notifications on state changes. 404 // List of observers that will receive notifications on state changes.
401 base::ObserverList<TabManagerObserver> observers_; 405 base::ObserverList<TabManagerObserver> observers_;
402 406
403 bool is_session_restore_loading_tabs_; 407 bool is_session_restore_loading_tabs_;
404 408
405 class TabManagerSessionRestoreObserver; 409 class TabManagerSessionRestoreObserver;
406 std::unique_ptr<TabManagerSessionRestoreObserver> session_restore_observer_; 410 std::unique_ptr<TabManagerSessionRestoreObserver> session_restore_observer_;
407 411
412 // True if the initial foreground tab is switched away.
413 bool initial_session_restore_foreground_tab_changed_;
414
408 // Weak pointer factory used for posting delayed tasks. 415 // Weak pointer factory used for posting delayed tasks.
409 base::WeakPtrFactory<TabManager> weak_ptr_factory_; 416 base::WeakPtrFactory<TabManager> weak_ptr_factory_;
410 417
411 DISALLOW_COPY_AND_ASSIGN(TabManager); 418 DISALLOW_COPY_AND_ASSIGN(TabManager);
412 }; 419 };
413 420
414 } // namespace resource_coordinator 421 } // namespace resource_coordinator
415 422
416 #endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_ 423 #endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698