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_SERVICE_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 typedef base::Callback<void(const FilteredURLList*)> | 324 typedef base::Callback<void(const FilteredURLList*)> |
325 QueryFilteredURLsCallback; | 325 QueryFilteredURLsCallback; |
326 | 326 |
327 base::CancelableTaskTracker::TaskId QueryFilteredURLs( | 327 base::CancelableTaskTracker::TaskId QueryFilteredURLs( |
328 int result_count, | 328 int result_count, |
329 const VisitFilter& filter, | 329 const VisitFilter& filter, |
330 bool extended_info, | 330 bool extended_info, |
331 const QueryFilteredURLsCallback& callback, | 331 const QueryFilteredURLsCallback& callback, |
332 base::CancelableTaskTracker* tracker); | 332 base::CancelableTaskTracker* tracker); |
333 | 333 |
| 334 // Statistics ---------------------------------------------------------------- |
| 335 |
| 336 // Returns the count of URLs in the url database. The argument is the count. |
| 337 // The count is zero if query to the database failed. |
| 338 typedef base::Callback<void(int)> CountURLsCallback; |
| 339 |
| 340 // Returns the count of URLs in the url database. |
| 341 base::CancelableTaskTracker::TaskId HistoryService::CountURLs( |
| 342 const CountURLsCallback& callback, |
| 343 base::CancelableTaskTracker* tracker); |
| 344 |
334 // Database management operations -------------------------------------------- | 345 // Database management operations -------------------------------------------- |
335 | 346 |
336 // Delete all the information related to a single url. | 347 // Delete all the information related to a single url. |
337 void DeleteURL(const GURL& url); | 348 void DeleteURL(const GURL& url); |
338 | 349 |
339 // Delete all the information related to a list of urls. (Deleting | 350 // Delete all the information related to a list of urls. (Deleting |
340 // URLs one by one is slow as it has to flush to disk each time.) | 351 // URLs one by one is slow as it has to flush to disk each time.) |
341 void DeleteURLsForTest(const std::vector<GURL>& urls); | 352 void DeleteURLsForTest(const std::vector<GURL>& urls); |
342 | 353 |
343 // Removes all visits in the selected time range (including the | 354 // Removes all visits in the selected time range (including the |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 void DeleteAllSearchTermsForKeyword(KeywordID keyword_id); | 442 void DeleteAllSearchTermsForKeyword(KeywordID keyword_id); |
432 | 443 |
433 // Deletes any search term corresponding to |url|. | 444 // Deletes any search term corresponding to |url|. |
434 void DeleteKeywordSearchTermForURL(const GURL& url); | 445 void DeleteKeywordSearchTermForURL(const GURL& url); |
435 | 446 |
436 // Deletes all URL and search term entries matching the given |term| and | 447 // Deletes all URL and search term entries matching the given |term| and |
437 // |keyword_id|. | 448 // |keyword_id|. |
438 void DeleteMatchingURLsForKeyword(KeywordID keyword_id, | 449 void DeleteMatchingURLsForKeyword(KeywordID keyword_id, |
439 const base::string16& term); | 450 const base::string16& term); |
440 | 451 |
| 452 // Statistics ---------------------------------------------------------------- |
| 453 void HistoryService::CountURLs(size_t* count); |
| 454 |
441 // Bookmarks ----------------------------------------------------------------- | 455 // Bookmarks ----------------------------------------------------------------- |
442 | 456 |
443 // Notification that a URL is no longer bookmarked. | 457 // Notification that a URL is no longer bookmarked. |
444 void URLsNoLongerBookmarked(const std::set<GURL>& urls); | 458 void URLsNoLongerBookmarked(const std::set<GURL>& urls); |
445 | 459 |
446 // Observers ----------------------------------------------------------------- | 460 // Observers ----------------------------------------------------------------- |
447 | 461 |
448 // Adds/Removes an Observer. | 462 // Adds/Removes an Observer. |
449 void AddObserver(HistoryServiceObserver* observer); | 463 void AddObserver(HistoryServiceObserver* observer); |
450 void RemoveObserver(HistoryServiceObserver* observer); | 464 void RemoveObserver(HistoryServiceObserver* observer); |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 | 841 |
828 // All vended weak pointers are invalidated in Cleanup(). | 842 // All vended weak pointers are invalidated in Cleanup(). |
829 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 843 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
830 | 844 |
831 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 845 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
832 }; | 846 }; |
833 | 847 |
834 } // namespace history | 848 } // namespace history |
835 | 849 |
836 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ | 850 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_ |
OLD | NEW |