| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // time will be null if no tracking session was ever started or ended. | 81 // time will be null if no tracking session was ever started or ended. |
| 82 const base::TimeTicks GetLatestStartOrEndTime() const; | 82 const base::TimeTicks GetLatestStartOrEndTime() const; |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 friend class TabDataUseEntryTest; | 85 friend class TabDataUseEntryTest; |
| 86 friend class MockTabDataUseEntryTest; | 86 friend class MockTabDataUseEntryTest; |
| 87 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, SingleTabSessionCloseEvent); | 87 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, SingleTabSessionCloseEvent); |
| 88 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, MultipleTabSessionCloseEvent); | 88 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, MultipleTabSessionCloseEvent); |
| 89 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, EndTrackingWithLabel); | 89 FRIEND_TEST_ALL_PREFIXES(TabDataUseEntryTest, EndTrackingWithLabel); |
| 90 FRIEND_TEST_ALL_PREFIXES(DataUseTabModelTest, TabCloseEvent); | 90 FRIEND_TEST_ALL_PREFIXES(DataUseTabModelTest, TabCloseEvent); |
| 91 FRIEND_TEST_ALL_PREFIXES(DataUseTabModelTest, |
| 92 ExpiredInactiveTabEntryRemovaltimeHistogram); |
| 93 FRIEND_TEST_ALL_PREFIXES(DataUseTabModelTest, |
| 94 ExpiredActiveTabEntryRemovaltimeHistogram); |
| 91 FRIEND_TEST_ALL_PREFIXES(MockTabDataUseEntryTest, CompactTabSessionHistory); | 95 FRIEND_TEST_ALL_PREFIXES(MockTabDataUseEntryTest, CompactTabSessionHistory); |
| 96 FRIEND_TEST_ALL_PREFIXES(MockTabDataUseEntryTest, |
| 97 OldInactiveSessionRemovaltimeHistogram); |
| 92 | 98 |
| 93 typedef std::deque<TabDataUseTrackingSession> TabSessions; | 99 typedef std::deque<TabDataUseTrackingSession> TabSessions; |
| 94 | 100 |
| 95 // Virtualized for unit test support. | 101 // Virtualized for unit test support. |
| 96 virtual base::TimeTicks Now() const; | 102 virtual base::TimeTicks Now() const; |
| 97 | 103 |
| 98 // Compacts the history of tracking sessions by removing oldest sessions to | 104 // Compacts the history of tracking sessions by removing oldest sessions to |
| 99 // keep the size of |sessions_| within |kMaxSessionsPerTab| entries. | 105 // keep the size of |sessions_| within |kMaxSessionsPerTab| entries. |
| 100 void CompactSessionHistory(); | 106 void CompactSessionHistory(); |
| 101 | 107 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 115 // respectively. | 121 // respectively. |
| 116 const base::TimeDelta closed_tab_expiration_duration_; | 122 const base::TimeDelta closed_tab_expiration_duration_; |
| 117 const base::TimeDelta open_tab_expiration_duration_; | 123 const base::TimeDelta open_tab_expiration_duration_; |
| 118 }; | 124 }; |
| 119 | 125 |
| 120 } // namespace android | 126 } // namespace android |
| 121 | 127 |
| 122 } // namespace chrome | 128 } // namespace chrome |
| 123 | 129 |
| 124 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_TAB_DATA_USE_ENTRY_H_ | 130 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_TAB_DATA_USE_ENTRY_H_ |
| OLD | NEW |