OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 // removed. | 407 // removed. |
408 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls, | 408 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls, |
409 base::Time begin_time, base::Time end_time, | 409 base::Time begin_time, base::Time end_time, |
410 CancelableRequestConsumerBase* consumer, | 410 CancelableRequestConsumerBase* consumer, |
411 ExpireHistoryCallback* callback); | 411 ExpireHistoryCallback* callback); |
412 | 412 |
413 // Downloads ----------------------------------------------------------------- | 413 // Downloads ----------------------------------------------------------------- |
414 | 414 |
415 // Implemented by the caller of 'CreateDownload' below, and is called when the | 415 // Implemented by the caller of 'CreateDownload' below, and is called when the |
416 // history service has created a new entry for a download in the history db. | 416 // history service has created a new entry for a download in the history db. |
417 typedef Callback2<int32, int64>::Type | 417 typedef Callback1<int32/*id*/>::Type DownloadCreateCallback; |
418 DownloadCreateCallback; | |
419 | 418 |
420 // Begins a history request to create a new persistent entry for a download. | 419 // Begins a history request to create a new persistent entry for a download. |
421 // 'info' contains all the download's creation state, and 'callback' runs | 420 // 'info' contains all the download's creation state, and 'callback' runs |
422 // when the history service request is complete. | 421 // when the history service request is complete. |
423 Handle CreateDownload(int32 id, | 422 Handle CreateDownload(int32 id, |
424 const DownloadHistoryInfo& info, | 423 const DownloadHistoryInfo& info, |
425 CancelableRequestConsumerBase* consumer, | 424 CancelableRequestConsumerBase* consumer, |
426 DownloadCreateCallback* callback); | 425 DownloadCreateCallback* callback); |
427 | 426 |
428 // Implemented by the caller of 'QueryDownloads' below, and is called when the | 427 // Implemented by the caller of 'QueryDownloads' below, and is called when the |
429 // history service has retrieved a list of all download state. The call | 428 // history service has retrieved a list of all download state. The call |
430 typedef Callback1<std::vector<DownloadHistoryInfo>*>::Type | 429 typedef Callback1<std::vector<DownloadHistoryInfo>*>::Type |
431 DownloadQueryCallback; | 430 DownloadQueryCallback; |
432 | 431 |
433 // Begins a history request to retrieve the state of all downloads in the | 432 // Begins a history request to retrieve the state of all downloads in the |
434 // history db. 'callback' runs when the history service request is complete, | 433 // history db. 'callback' runs when the history service request is complete, |
435 // at which point 'info' contains an array of DownloadHistoryInfo, one per | 434 // at which point 'info' contains an array of DownloadHistoryInfo, one per |
436 // download. | 435 // download. |
437 Handle QueryDownloads(CancelableRequestConsumerBase* consumer, | 436 Handle QueryDownloads(CancelableRequestConsumerBase* consumer, |
| 437 history::DownloadQueryParameters::GetNextIdThunk gnit, |
438 DownloadQueryCallback* callback); | 438 DownloadQueryCallback* callback); |
439 | 439 |
440 // Begins a request to clean up entries that has been corrupted (because of | 440 // Begins a request to clean up entries that has been corrupted (because of |
441 // the crash, for example). | 441 // the crash, for example). |
442 void CleanUpInProgressEntries(); | 442 void CleanUpInProgressEntries(); |
443 | 443 |
444 // Called to update the history service about the current state of a download. | 444 // Called to update the history service about the current state of a download. |
445 // This is a 'fire and forget' query, so just pass the relevant state info to | 445 // This is a 'fire and forget' query, so just pass the relevant state info to |
446 // the database with no need for a callback. | 446 // the database with no need for a callback. |
447 void UpdateDownload(int64 received_bytes, int32 state, int64 db_handle); | 447 void UpdateDownload(int64 received_bytes, int32 state, int64 db_handle); |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 BookmarkService* bookmark_service_; | 869 BookmarkService* bookmark_service_; |
870 bool no_db_; | 870 bool no_db_; |
871 | 871 |
872 // True if needs top site migration. | 872 // True if needs top site migration. |
873 bool needs_top_sites_migration_; | 873 bool needs_top_sites_migration_; |
874 | 874 |
875 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 875 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
876 }; | 876 }; |
877 | 877 |
878 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 878 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
OLD | NEW |