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

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

Issue 8536041: This CL integrates the new SafeBrowsing download service class (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix uninitialized variable issue. Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/chrome_download_manager_delegate.h
diff --git a/chrome/browser/download/chrome_download_manager_delegate.h b/chrome/browser/download/chrome_download_manager_delegate.h
index c5c4007a1a1578d5ac304fade3f4483234500bd3..284284ea95c2b51fd0edcff287e66dea0874b50e 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.h
+++ b/chrome/browser/download/chrome_download_manager_delegate.h
@@ -100,7 +100,14 @@ class ChromeDownloadManagerDelegate
const content::NotificationDetails& details) OVERRIDE;
// Callback function after url is checked with safebrowsing service.
- void CheckDownloadUrlDone(int32 download_id, bool is_dangerous_url);
+ void CheckDownloadUrlDone(
+ int32 download_id,
+ safe_browsing::DownloadProtectionService::DownloadCheckResult result);
+
+ // Callback function after the DownloadProtectionService completes.
+ void CheckClientDownloadDone(
+ int32 download_id,
+ safe_browsing::DownloadProtectionService::DownloadCheckResult result);
// Callback function after we check whether the referrer URL has been visited
// before today.
@@ -130,15 +137,6 @@ class ChromeDownloadManagerDelegate
// Callback from history system.
void OnItemAddedToPersistentStore(int32 download_id, int64 db_handle);
- // Callback function after download file hash is checked with safebrowsing
- // service.
- void CheckDownloadHashDone(int32 download_id, bool is_dangerous_hash);
-
- // Callback function after the DownloadProtectionService completes.
- void CheckClientDownloadDone(
- int32 download_id,
- safe_browsing::DownloadProtectionService::DownloadCheckResult result);
-
Profile* profile_;
scoped_ptr<DownloadPrefs> download_prefs_;
scoped_ptr<DownloadHistory> download_history_;
@@ -147,6 +145,16 @@ class ChromeDownloadManagerDelegate
typedef base::hash_map<CrxInstaller*, int> CrxInstallerMap;
CrxInstallerMap crx_installers_;
+ // Maps the SafeBrowsing download check state to a DownloadItem ID.
+ struct SafeBrowsingState {
+ // If true the SafeBrowsing check is not done yet.
+ bool pending;
+ // The verdict that we got from calling CheckClientDownload.
+ safe_browsing::DownloadProtectionService::DownloadCheckResult verdict;
+ };
+ typedef base::hash_map<int, SafeBrowsingState> SafeBrowsingStateMap;
+ SafeBrowsingStateMap safe_browsing_state_;
+
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerDelegate);

Powered by Google App Engine
This is Rietveld 408576698