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 CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 class BookmarkService; | 28 class BookmarkService; |
29 struct DownloadPersistentStoreInfo; | 29 struct DownloadPersistentStoreInfo; |
30 class TestingProfile; | 30 class TestingProfile; |
31 struct ThumbnailScore; | 31 struct ThumbnailScore; |
32 | 32 |
33 namespace history { | 33 namespace history { |
34 | 34 |
35 class CommitLaterTask; | 35 class CommitLaterTask; |
36 class HistoryPublisher; | 36 class HistoryPublisher; |
| 37 class TimeFilter; |
37 | 38 |
38 // *See the .cc file for more information on the design.* | 39 // *See the .cc file for more information on the design.* |
39 // | 40 // |
40 // Internal history implementation which does most of the work of the history | 41 // Internal history implementation which does most of the work of the history |
41 // system. This runs on a background thread (to not block the browser when we | 42 // system. This runs on a background thread (to not block the browser when we |
42 // do expensive operations) and is NOT threadsafe, so it must only be called | 43 // do expensive operations) and is NOT threadsafe, so it must only be called |
43 // from message handlers on the background thread. Invoking on another thread | 44 // from message handlers on the background thread. Invoking on another thread |
44 // requires threadsafe refcounting. | 45 // requires threadsafe refcounting. |
45 // | 46 // |
46 // Most functions here are just the implementations of the corresponding | 47 // Most functions here are just the implementations of the corresponding |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 int result_count); | 167 int result_count); |
167 | 168 |
168 // Request the |result_count| most visited URLs and the chain of | 169 // Request the |result_count| most visited URLs and the chain of |
169 // redirects leading to each of these URLs. |days_back| is the | 170 // redirects leading to each of these URLs. |days_back| is the |
170 // number of days of history to use. Used by TopSites. | 171 // number of days of history to use. Used by TopSites. |
171 void QueryMostVisitedURLs( | 172 void QueryMostVisitedURLs( |
172 scoped_refptr<QueryMostVisitedURLsRequest> request, | 173 scoped_refptr<QueryMostVisitedURLsRequest> request, |
173 int result_count, | 174 int result_count, |
174 int days_back); | 175 int days_back); |
175 | 176 |
| 177 // Request the |result_count| most visited URLs and the chain of redirects |
| 178 // leading to each of these URLs, during the time peiods specified in the |
| 179 // |filter|. |
| 180 void QueryMostVisitedURLsDuringTime( |
| 181 scoped_refptr<QueryMostVisitedURLsRequest> request, |
| 182 int result_count, |
| 183 const history::TimeFilter& filter); |
| 184 |
176 // QueryMostVisitedURLs without the request. | 185 // QueryMostVisitedURLs without the request. |
177 void QueryMostVisitedURLsImpl(int result_count, | 186 void QueryMostVisitedURLsImpl(int result_count, |
178 int days_back, | 187 int days_back, |
179 MostVisitedURLList* result); | 188 MostVisitedURLList* result); |
180 | 189 |
181 // Computes the most recent URL(s) that the given canonical URL has | 190 // Computes the most recent URL(s) that the given canonical URL has |
182 // redirected to and returns true on success. There may be more than one | 191 // redirected to and returns true on success. There may be more than one |
183 // redirect in a row, so this function will fill the given array with the | 192 // redirect in a row, so this function will fill the given array with the |
184 // entire chain. If there are no redirects for the most recent visit of the | 193 // entire chain. If there are no redirects for the most recent visit of the |
185 // URL, or the URL is not in history, returns false. | 194 // URL, or the URL is not in history, returns false. |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 // Publishes the history to all indexers which are registered to receive | 653 // Publishes the history to all indexers which are registered to receive |
645 // history data from us. Can be NULL if there are no listeners. | 654 // history data from us. Can be NULL if there are no listeners. |
646 scoped_ptr<HistoryPublisher> history_publisher_; | 655 scoped_ptr<HistoryPublisher> history_publisher_; |
647 | 656 |
648 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 657 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
649 }; | 658 }; |
650 | 659 |
651 } // namespace history | 660 } // namespace history |
652 | 661 |
653 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 662 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |