| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ANDROID_DATA_USAGE_TAB_DATA_USE_ENTRY_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_TAB_DATA_USE_ENTRY_H_ |
| 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_TAB_DATA_USE_ENTRY_H_ | 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_TAB_DATA_USE_ENTRY_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // time will be null if no tracking session was ever started or ended. | 77 // time will be null if no tracking session was ever started or ended. |
| 78 const base::TimeTicks GetLatestStartOrEndTime() const; | 78 const base::TimeTicks GetLatestStartOrEndTime() const; |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 friend class TabDataUseEntryTest; | 81 friend class TabDataUseEntryTest; |
| 82 friend class MockTabDataUseEntryTest; | 82 friend class MockTabDataUseEntryTest; |
| 83 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, SingleTabSessionCloseEvent); | 83 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, SingleTabSessionCloseEvent); |
| 84 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, MultipleTabSessionCloseEvent); | 84 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, MultipleTabSessionCloseEvent); |
| 85 FRIEND_TEST_ALL_PREFIXES(DataUseTabModelTest, TabCloseEvent); | 85 FRIEND_TEST_ALL_PREFIXES(DataUseTabModelTest, TabCloseEvent); |
| 86 FRIEND_TEST_ALL_PREFIXES(MockTabDataUseEntryTest, CompactTabSessionHistory); | 86 FRIEND_TEST_ALL_PREFIXES(MockTabDataUseEntryTest, CompactTabSessionHistory); |
| 87 FRIEND_TEST_ALL_PREFIXES(MockTabDataUseEntryTest, |
| 88 OldInactiveSessionRemovaltimeHistogram); |
| 89 FRIEND_TEST_ALL_PREFIXES(MockDataUseTabModelTest, |
| 90 ExpiredInactiveTabEntryRemovaltimeHistogram); |
| 91 FRIEND_TEST_ALL_PREFIXES(MockDataUseTabModelTest, |
| 92 ExpiredActiveTabEntryRemovaltimeHistogram); |
| 87 | 93 |
| 88 typedef std::deque<TabDataUseTrackingSession> TabSessions; | 94 typedef std::deque<TabDataUseTrackingSession> TabSessions; |
| 89 | 95 |
| 90 // Returns the maximum number of tracking sessions to maintain per tab, for | 96 // Returns the maximum number of tracking sessions to maintain per tab, for |
| 91 // testing purposes. | 97 // testing purposes. |
| 92 static size_t GetMaxSessionsPerTabForTests(); | 98 static size_t GetMaxSessionsPerTabForTests(); |
| 93 | 99 |
| 94 // Returns the expiration duration in seconds for a closed tab entry and an | 100 // Returns the expiration duration in seconds for a closed tab entry and an |
| 95 // open tab entry respectively, for testing purposes. | 101 // open tab entry respectively, for testing purposes. |
| 96 static unsigned int GetClosedTabExpirationDurationSecondsForTests(); | 102 static unsigned int GetClosedTabExpirationDurationSecondsForTests(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 111 // Indicates the time the tab was closed. |tab_close_time_| will be null if | 117 // Indicates the time the tab was closed. |tab_close_time_| will be null if |
| 112 // the tab is still open. | 118 // the tab is still open. |
| 113 base::TimeTicks tab_close_time_; | 119 base::TimeTicks tab_close_time_; |
| 114 }; | 120 }; |
| 115 | 121 |
| 116 } // namespace android | 122 } // namespace android |
| 117 | 123 |
| 118 } // namespace chrome | 124 } // namespace chrome |
| 119 | 125 |
| 120 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_TAB_DATA_USE_ENTRY_H_ | 126 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_TAB_DATA_USE_ENTRY_H_ |
| OLD | NEW |