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_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "ui/base/layout.h" | 32 #include "ui/base/layout.h" |
33 | 33 |
34 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
35 #include "chrome/browser/history/android/android_history_provider_service.h" | 35 #include "chrome/browser/history/android/android_history_provider_service.h" |
36 #endif | 36 #endif |
37 | 37 |
38 class BookmarkService; | 38 class BookmarkService; |
39 class FilePath; | 39 class FilePath; |
40 class GURL; | 40 class GURL; |
41 class HistoryURLProvider; | 41 class HistoryURLProvider; |
42 struct HistoryURLProviderParams; | |
43 class PageUsageData; | 42 class PageUsageData; |
44 class PageUsageRequest; | 43 class PageUsageRequest; |
45 class Profile; | 44 class Profile; |
| 45 struct HistoryURLProviderParams; |
46 | 46 |
47 namespace base { | 47 namespace base { |
48 class Thread; | 48 class Thread; |
49 } | 49 } |
50 | 50 |
51 namespace content { | |
52 struct DownloadPersistentStoreInfo; | |
53 } | |
54 | 51 |
55 namespace history { | 52 namespace history { |
| 53 |
| 54 class HistoryBackend; |
| 55 class HistoryDatabase; |
| 56 class HistoryQueryTest; |
56 class InMemoryHistoryBackend; | 57 class InMemoryHistoryBackend; |
57 class InMemoryURLIndex; | 58 class InMemoryURLIndex; |
58 class InMemoryURLIndexTest; | 59 class InMemoryURLIndexTest; |
59 struct HistoryAddPageArgs; | |
60 class HistoryBackend; | |
61 class HistoryDatabase; | |
62 struct HistoryDetails; | |
63 class HistoryQueryTest; | |
64 class VisitFilter; | |
65 class URLDatabase; | 60 class URLDatabase; |
66 class VisitDatabaseObserver; | 61 class VisitDatabaseObserver; |
| 62 class VisitFilter; |
| 63 struct DownloadRow; |
| 64 struct HistoryAddPageArgs; |
| 65 struct HistoryDetails; |
| 66 |
67 } // namespace history | 67 } // namespace history |
68 | 68 |
69 namespace sync_pb { | 69 namespace sync_pb { |
70 class HistoryDeleteDirectiveSpecifics; | 70 class HistoryDeleteDirectiveSpecifics; |
71 } | 71 } |
72 | 72 |
73 // HistoryDBTask can be used to process arbitrary work on the history backend | 73 // HistoryDBTask can be used to process arbitrary work on the history backend |
74 // thread. HistoryDBTask is scheduled using HistoryService::ScheduleDBTask. | 74 // thread. HistoryDBTask is scheduled using HistoryService::ScheduleDBTask. |
75 // When HistoryBackend processes the task it invokes RunOnDBThread. Once the | 75 // When HistoryBackend processes the task it invokes RunOnDBThread. Once the |
76 // task completes and has not been canceled, DoneRunOnMainThread is invoked back | 76 // task completes and has not been canceled, DoneRunOnMainThread is invoked back |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 // removed. | 447 // removed. |
448 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls, | 448 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls, |
449 base::Time begin_time, base::Time end_time, | 449 base::Time begin_time, base::Time end_time, |
450 CancelableRequestConsumerBase* consumer, | 450 CancelableRequestConsumerBase* consumer, |
451 const base::Closure& callback); | 451 const base::Closure& callback); |
452 | 452 |
453 // Downloads ----------------------------------------------------------------- | 453 // Downloads ----------------------------------------------------------------- |
454 | 454 |
455 // Implemented by the caller of 'CreateDownload' below, and is called when the | 455 // Implemented by the caller of 'CreateDownload' below, and is called when the |
456 // history service has created a new entry for a download in the history db. | 456 // history service has created a new entry for a download in the history db. |
457 typedef base::Callback<void(int32, int64)> DownloadCreateCallback; | 457 typedef base::Callback<void(int64)> DownloadCreateCallback; |
458 | 458 |
459 // Begins a history request to create a new persistent entry for a download. | 459 // Begins a history request to create a new row for a download. 'info' |
460 // 'info' contains all the download's creation state, and 'callback' runs | 460 // contains all the download's creation state, and 'callback' runs when the |
461 // when the history service request is complete. | 461 // history service request is complete. |
462 Handle CreateDownload(int32 id, | 462 Handle CreateDownload( |
463 const content::DownloadPersistentStoreInfo& info, | 463 const history::DownloadRow& info, |
464 CancelableRequestConsumerBase* consumer, | 464 CancelableRequestConsumerBase* consumer, |
465 const DownloadCreateCallback& callback); | 465 const DownloadCreateCallback& callback); |
466 | 466 |
467 // Implemented by the caller of 'GetNextDownloadId' below. | 467 // Implemented by the caller of 'GetNextDownloadId' below. |
468 typedef base::Callback<void(int)> DownloadNextIdCallback; | 468 typedef base::Callback<void(int)> DownloadNextIdCallback; |
469 | 469 |
470 // Runs the callback with the next available download id. | 470 // Runs the callback with the next available download id. |
471 Handle GetNextDownloadId(CancelableRequestConsumerBase* consumer, | 471 Handle GetNextDownloadId(CancelableRequestConsumerBase* consumer, |
472 const DownloadNextIdCallback& callback); | 472 const DownloadNextIdCallback& callback); |
473 | 473 |
474 // Implemented by the caller of 'QueryDownloads' below, and is called when the | 474 // Implemented by the caller of 'QueryDownloads' below, and is called when the |
475 // history service has retrieved a list of all download state. The call | 475 // history service has retrieved a list of all download state. The call |
476 typedef base::Callback<void( | 476 typedef base::Callback<void( |
477 std::vector<content::DownloadPersistentStoreInfo>*)> | 477 std::vector<history::DownloadRow>*)> |
478 DownloadQueryCallback; | 478 DownloadQueryCallback; |
479 | 479 |
480 // Begins a history request to retrieve the state of all downloads in the | 480 // Begins a history request to retrieve the state of all downloads in the |
481 // history db. 'callback' runs when the history service request is complete, | 481 // history db. 'callback' runs when the history service request is complete, |
482 // at which point 'info' contains an array of DownloadPersistentStoreInfo, one | 482 // at which point 'info' contains an array of history::DownloadRow, one |
483 // per download. | 483 // per download. |
484 Handle QueryDownloads(CancelableRequestConsumerBase* consumer, | 484 Handle QueryDownloads(CancelableRequestConsumerBase* consumer, |
485 const DownloadQueryCallback& callback); | 485 const DownloadQueryCallback& callback); |
486 | 486 |
487 // Begins a request to clean up entries that has been corrupted (because of | 487 // Begins a request to clean up entries that has been corrupted (because of |
488 // the crash, for example). | 488 // the crash, for example). |
489 void CleanUpInProgressEntries(); | 489 void CleanUpInProgressEntries(); |
490 | 490 |
491 // Called to update the history service about the current state of a download. | 491 // Called to update the history service about the current state of a download. |
492 // This is a 'fire and forget' query, so just pass the relevant state info to | 492 // This is a 'fire and forget' query, so just pass the relevant state info to |
493 // the database with no need for a callback. | 493 // the database with no need for a callback. |
494 void UpdateDownload(const content::DownloadPersistentStoreInfo& data); | 494 void UpdateDownload(const history::DownloadRow& data); |
495 | 495 |
496 // Called to update the history service about the path of a download. | 496 // Permanently remove some downloads from the history system. This is a 'fire |
497 // This is a 'fire and forget' query. | 497 // and forget' operation. |
498 void UpdateDownloadPath(const FilePath& path, int64 db_handle); | 498 void RemoveDownloads(const std::set<int64>& db_handles); |
499 | |
500 // Permanently remove a download from the history system. This is a 'fire and | |
501 // forget' operation. | |
502 void RemoveDownload(int64 db_handle); | |
503 | |
504 // Permanently removes all completed download from the history system within | |
505 // the specified range. This function does not delete downloads that are in | |
506 // progress or in the process of being cancelled. This is a 'fire and forget' | |
507 // operation. You can pass is_null times to get unbounded time in either or | |
508 // both directions. | |
509 void RemoveDownloadsBetween(base::Time remove_begin, base::Time remove_end); | |
510 | 499 |
511 // Visit Segments ------------------------------------------------------------ | 500 // Visit Segments ------------------------------------------------------------ |
512 | 501 |
513 typedef base::Callback<void(Handle, std::vector<PageUsageData*>*)> | 502 typedef base::Callback<void(Handle, std::vector<PageUsageData*>*)> |
514 SegmentQueryCallback; | 503 SegmentQueryCallback; |
515 | 504 |
516 // Query usage data for all visit segments since the provided time. | 505 // Query usage data for all visit segments since the provided time. |
517 // | 506 // |
518 // The request is performed asynchronously and can be cancelled by using the | 507 // The request is performed asynchronously and can be cancelled by using the |
519 // returned handle. | 508 // returned handle. |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 // TODO(mrossetti): Move in_memory_url_index out of history_service. | 1112 // TODO(mrossetti): Move in_memory_url_index out of history_service. |
1124 // See http://crbug.com/138321 | 1113 // See http://crbug.com/138321 |
1125 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 1114 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
1126 | 1115 |
1127 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; | 1116 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; |
1128 | 1117 |
1129 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 1118 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
1130 }; | 1119 }; |
1131 | 1120 |
1132 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 1121 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
OLD | NEW |