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_DOWNLOAD_DOWNLOAD_HISTORY_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 // A fake download table ID which represents a download that has started, | 27 // A fake download table ID which represents a download that has started, |
28 // but is not yet in the table. | 28 // but is not yet in the table. |
29 static const int kUninitializedHandle; | 29 static const int kUninitializedHandle; |
30 | 30 |
31 explicit DownloadHistory(Profile* profile); | 31 explicit DownloadHistory(Profile* profile); |
32 ~DownloadHistory(); | 32 ~DownloadHistory(); |
33 | 33 |
34 // Retrieves DownloadCreateInfos saved in the history. | 34 // Retrieves DownloadCreateInfos saved in the history. |
35 void Load(HistoryService::DownloadQueryCallback* callback); | 35 void Load(HistoryService::DownloadQueryCallback* callback); |
36 | 36 |
37 // Checks whether |referrer_url| has been visited before today. | 37 // Checks whether |referrer_url| has been visited before today. This takes |
| 38 // ownership of |callback|. |
38 void CheckVisitedReferrerBefore(int32 download_id, | 39 void CheckVisitedReferrerBefore(int32 download_id, |
39 const GURL& referrer_url, | 40 const GURL& referrer_url, |
40 VisitedBeforeDoneCallback* callback); | 41 VisitedBeforeDoneCallback* callback); |
41 | 42 |
42 // Adds a new entry for a download to the history database. | 43 // Adds a new entry for a download to the history database. |
43 void AddEntry(DownloadItem* download_item, | 44 void AddEntry(DownloadItem* download_item, |
44 HistoryService::DownloadCreateCallback* callback); | 45 HistoryService::DownloadCreateCallback* callback); |
45 | 46 |
46 // Updates the history entry for |download_item|. | 47 // Updates the history entry for |download_item|. |
47 void UpdateEntry(DownloadItem* download_item); | 48 void UpdateEntry(DownloadItem* download_item); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 81 |
81 CancelableRequestConsumer history_consumer_; | 82 CancelableRequestConsumer history_consumer_; |
82 | 83 |
83 // The outstanding requests made by CheckVisitedReferrerBefore(). | 84 // The outstanding requests made by CheckVisitedReferrerBefore(). |
84 VisitedBeforeRequestsMap visited_before_requests_; | 85 VisitedBeforeRequestsMap visited_before_requests_; |
85 | 86 |
86 DISALLOW_COPY_AND_ASSIGN(DownloadHistory); | 87 DISALLOW_COPY_AND_ASSIGN(DownloadHistory); |
87 }; | 88 }; |
88 | 89 |
89 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ | 90 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_HISTORY_H_ |
OLD | NEW |