Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: chrome/browser/history/history.h

Issue 10915180: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r166680 Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 DownloadPersistentStoreInfo;
46 struct HistoryURLProviderParams;
46 47
47 namespace base { 48 namespace base {
48 class Thread; 49 class Thread;
49 } 50 }
50 51
51 namespace content {
52 struct DownloadPersistentStoreInfo;
53 }
54 52
55 namespace history { 53 namespace history {
56 class InMemoryHistoryBackend; 54 class InMemoryHistoryBackend;
57 class InMemoryURLIndex; 55 class InMemoryURLIndex;
58 class InMemoryURLIndexTest; 56 class InMemoryURLIndexTest;
59 struct HistoryAddPageArgs; 57 struct HistoryAddPageArgs;
60 class HistoryBackend; 58 class HistoryBackend;
61 class HistoryDatabase; 59 class HistoryDatabase;
62 struct HistoryDetails; 60 struct HistoryDetails;
63 class HistoryQueryTest; 61 class HistoryQueryTest;
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 // removed. 445 // removed.
448 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls, 446 void ExpireHistoryBetween(const std::set<GURL>& restrict_urls,
449 base::Time begin_time, base::Time end_time, 447 base::Time begin_time, base::Time end_time,
450 CancelableRequestConsumerBase* consumer, 448 CancelableRequestConsumerBase* consumer,
451 const base::Closure& callback); 449 const base::Closure& callback);
452 450
453 // Downloads ----------------------------------------------------------------- 451 // Downloads -----------------------------------------------------------------
454 452
455 // Implemented by the caller of 'CreateDownload' below, and is called when the 453 // 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. 454 // history service has created a new entry for a download in the history db.
457 typedef base::Callback<void(int32, int64)> DownloadCreateCallback; 455 typedef base::Callback<void(int64)> DownloadCreateCallback;
458 456
459 // Begins a history request to create a new persistent entry for a download. 457 // Begins a history request to create a new persistent entry for a download.
460 // 'info' contains all the download's creation state, and 'callback' runs 458 // 'info' contains all the download's creation state, and 'callback' runs
461 // when the history service request is complete. 459 // when the history service request is complete.
462 Handle CreateDownload(int32 id, 460 Handle CreateDownload(
463 const content::DownloadPersistentStoreInfo& info, 461 const DownloadPersistentStoreInfo& info,
464 CancelableRequestConsumerBase* consumer, 462 CancelableRequestConsumerBase* consumer,
465 const DownloadCreateCallback& callback); 463 const DownloadCreateCallback& callback);
466 464
467 // Implemented by the caller of 'GetNextDownloadId' below. 465 // Implemented by the caller of 'GetNextDownloadId' below.
468 typedef base::Callback<void(int)> DownloadNextIdCallback; 466 typedef base::Callback<void(int)> DownloadNextIdCallback;
469 467
470 // Runs the callback with the next available download id. 468 // Runs the callback with the next available download id.
471 Handle GetNextDownloadId(CancelableRequestConsumerBase* consumer, 469 Handle GetNextDownloadId(CancelableRequestConsumerBase* consumer,
472 const DownloadNextIdCallback& callback); 470 const DownloadNextIdCallback& callback);
473 471
474 // Implemented by the caller of 'QueryDownloads' below, and is called when the 472 // 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 473 // history service has retrieved a list of all download state. The call
476 typedef base::Callback<void( 474 typedef base::Callback<void(
477 std::vector<content::DownloadPersistentStoreInfo>*)> 475 std::vector<DownloadPersistentStoreInfo>*)>
478 DownloadQueryCallback; 476 DownloadQueryCallback;
479 477
480 // Begins a history request to retrieve the state of all downloads in the 478 // 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, 479 // history db. 'callback' runs when the history service request is complete,
482 // at which point 'info' contains an array of DownloadPersistentStoreInfo, one 480 // at which point 'info' contains an array of DownloadPersistentStoreInfo, one
483 // per download. 481 // per download.
484 Handle QueryDownloads(CancelableRequestConsumerBase* consumer, 482 Handle QueryDownloads(CancelableRequestConsumerBase* consumer,
485 const DownloadQueryCallback& callback); 483 const DownloadQueryCallback& callback);
486 484
487 // Begins a request to clean up entries that has been corrupted (because of 485 // Begins a request to clean up entries that has been corrupted (because of
488 // the crash, for example). 486 // the crash, for example).
489 void CleanUpInProgressEntries(); 487 void CleanUpInProgressEntries();
490 488
491 // Called to update the history service about the current state of a download. 489 // 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 490 // This is a 'fire and forget' query, so just pass the relevant state info to
493 // the database with no need for a callback. 491 // the database with no need for a callback.
494 void UpdateDownload(const content::DownloadPersistentStoreInfo& data); 492 void UpdateDownload(const DownloadPersistentStoreInfo& data);
495 493
496 // Called to update the history service about the path of a download. 494 // Permanently remove some downloads from the history system. This is a 'fire
497 // This is a 'fire and forget' query. 495 // and forget' operation.
498 void UpdateDownloadPath(const FilePath& path, int64 db_handle); 496 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);
sky 2012/11/08 20:55:17 Isn't browsing_data_remover using this?
benjhayden 2012/11/08 21:40:03 browsing_data_remover is using DownloadManager::Re
sky 2012/11/09 16:45:50 My mistake.
510 497
511 // Visit Segments ------------------------------------------------------------ 498 // Visit Segments ------------------------------------------------------------
512 499
513 typedef base::Callback<void(Handle, std::vector<PageUsageData*>*)> 500 typedef base::Callback<void(Handle, std::vector<PageUsageData*>*)>
514 SegmentQueryCallback; 501 SegmentQueryCallback;
515 502
516 // Query usage data for all visit segments since the provided time. 503 // Query usage data for all visit segments since the provided time.
517 // 504 //
518 // The request is performed asynchronously and can be cancelled by using the 505 // The request is performed asynchronously and can be cancelled by using the
519 // returned handle. 506 // returned handle.
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 // TODO(mrossetti): Move in_memory_url_index out of history_service. 1110 // TODO(mrossetti): Move in_memory_url_index out of history_service.
1124 // See http://crbug.com/138321 1111 // See http://crbug.com/138321
1125 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; 1112 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_;
1126 1113
1127 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; 1114 ObserverList<history::VisitDatabaseObserver> visit_database_observers_;
1128 1115
1129 DISALLOW_COPY_AND_ASSIGN(HistoryService); 1116 DISALLOW_COPY_AND_ASSIGN(HistoryService);
1130 }; 1117 };
1131 1118
1132 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ 1119 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698