| OLD | NEW |
| 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 COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
| 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 void ClearCachedDataForContextID(ContextID context_id); | 206 void ClearCachedDataForContextID(ContextID context_id); |
| 207 | 207 |
| 208 // Computes the |num_hosts| most-visited hostnames in the past 30 days. See | 208 // Computes the |num_hosts| most-visited hostnames in the past 30 days. See |
| 209 // history_service.h for details. Returns an empty list if db_ is not | 209 // history_service.h for details. Returns an empty list if db_ is not |
| 210 // initialized. | 210 // initialized. |
| 211 // | 211 // |
| 212 // As a side effect, caches the list of top hosts for the purposes of | 212 // As a side effect, caches the list of top hosts for the purposes of |
| 213 // generating internal metrics. | 213 // generating internal metrics. |
| 214 TopHostsList TopHosts(size_t num_hosts) const; | 214 TopHostsList TopHosts(size_t num_hosts) const; |
| 215 | 215 |
| 216 // Gets the counts of URLs that belong to |origins| in the history database. | 216 // Gets the counts and last last time of URLs that belong to |origins| in the |
| 217 // Origins that are not in the history database will be in the map with a | 217 // history database. Origins that are not in the history database will be in |
| 218 // count of 0. | 218 // the map with a count and time of 0. |
| 219 // Returns an empty map if db_ is not initialized. | 219 // Returns an empty map if db_ is not initialized. |
| 220 OriginCountMap GetCountsForOrigins(const std::set<GURL>& origins) const; | 220 OriginCountAndLastVisitMap GetCountsAndLastVisitForOrigins( |
| 221 const std::set<GURL>& origins) const; |
| 221 | 222 |
| 222 // Returns, for the given URL, a 0-based index into the list produced by | 223 // Returns, for the given URL, a 0-based index into the list produced by |
| 223 // TopHosts(), corresponding to that URL's host. If TopHosts() has not | 224 // TopHosts(), corresponding to that URL's host. If TopHosts() has not |
| 224 // previously been run, or the host is not in the top kMaxTopHosts, returns | 225 // previously been run, or the host is not in the top kMaxTopHosts, returns |
| 225 // kMaxTopHosts. | 226 // kMaxTopHosts. |
| 226 int HostRankIfAvailable(const GURL& url) const; | 227 int HostRankIfAvailable(const GURL& url) const; |
| 227 | 228 |
| 228 // Navigation ---------------------------------------------------------------- | 229 // Navigation ---------------------------------------------------------------- |
| 229 | 230 |
| 230 // |request.time| must be unique with high probability. | 231 // |request.time| must be unique with high probability. |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 UpdateFaviconMappingsAndFetchNoDB); | 551 UpdateFaviconMappingsAndFetchNoDB); |
| 551 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, QueryFilteredURLs); | 552 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, QueryFilteredURLs); |
| 552 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts); | 553 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts); |
| 553 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_ElidePortAndScheme); | 554 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_ElidePortAndScheme); |
| 554 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_ElideWWW); | 555 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_ElideWWW); |
| 555 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_OnlyLast30Days); | 556 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_OnlyLast30Days); |
| 556 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_MaxNumHosts); | 557 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_MaxNumHosts); |
| 557 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_IgnoreUnusualURLs); | 558 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, TopHosts_IgnoreUnusualURLs); |
| 558 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, HostRankIfAvailable); | 559 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, HostRankIfAvailable); |
| 559 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, RecordTopHostsMetrics); | 560 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, RecordTopHostsMetrics); |
| 560 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetCountsForOrigins); | 561 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetCountsAndLastVisitForOrigins); |
| 561 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, UpdateVisitDuration); | 562 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, UpdateVisitDuration); |
| 562 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, ExpireHistoryForTimes); | 563 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, ExpireHistoryForTimes); |
| 563 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteFTSIndexDatabases); | 564 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteFTSIndexDatabases); |
| 564 FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTypedUrlTest, | 565 FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceTypedUrlTest, |
| 565 ProcessUserChangeRemove); | 566 ProcessUserChangeRemove); |
| 566 friend class ::TestingProfile; | 567 friend class ::TestingProfile; |
| 567 | 568 |
| 568 // Computes the name of the specified database on disk. | 569 // Computes the name of the specified database on disk. |
| 569 base::FilePath GetThumbnailFileName() const; | 570 base::FilePath GetThumbnailFileName() const; |
| 570 | 571 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 | 888 |
| 888 // List of observers | 889 // List of observers |
| 889 base::ObserverList<HistoryBackendObserver> observers_; | 890 base::ObserverList<HistoryBackendObserver> observers_; |
| 890 | 891 |
| 891 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 892 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 892 }; | 893 }; |
| 893 | 894 |
| 894 } // namespace history | 895 } // namespace history |
| 895 | 896 |
| 896 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ | 897 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_ |
| OLD | NEW |