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

Unified Diff: chrome/browser/download/download_history.h

Issue 7065015: For downloads requiring a user gesture, also require... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_history.h
===================================================================
--- chrome/browser/download/download_history.h (revision 86341)
+++ chrome/browser/download/download_history.h (working copy)
@@ -20,6 +20,8 @@
// Interacts with the HistoryService on behalf of the download subsystem.
class DownloadHistory {
public:
+ typedef Callback2<int32, bool>::Type VisitedBeforeDoneCallback;
+
// A fake download table ID which represents a download that has started,
// but is not yet in the table.
static const int kUninitializedHandle;
@@ -30,6 +32,11 @@
// Retrieves DownloadCreateInfos saved in the history.
void Load(HistoryService::DownloadQueryCallback* callback);
+ // Checks whether |info|'s referrer has been visited before today.
Randy Smith (Not in Mondays) 2011/05/24 18:28:25 |info| looks like a typo/left over from previous C
+ void CheckVisitedReferrerBefore(int32 download_id,
+ const GURL& referrer_url,
+ VisitedBeforeDoneCallback* callback);
+
// Adds a new entry for a download to the history database.
void AddEntry(DownloadItem* download_item,
HistoryService::DownloadCreateCallback* callback);
@@ -52,6 +59,15 @@
int64 GetNextFakeDbHandle();
private:
+ typedef std::map<HistoryService::Handle,
+ std::pair<int32, VisitedBeforeDoneCallback*> >
+ VisitedBeforeRequestsMap;
+
+ void OnGotVisitCountToHost(HistoryService::Handle handle,
+ bool found_visits,
+ int count,
+ base::Time first_visit);
+
Profile* profile_;
// In case we don't have a valid db_handle, we use |fake_db_handle_| instead.
@@ -62,6 +78,9 @@
CancelableRequestConsumer history_consumer_;
+ // The outstanding requests made by CheckVisitedReferrerBefore().
+ VisitedBeforeRequestsMap visited_before_requests_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadHistory);
};

Powered by Google App Engine
This is Rietveld 408576698