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); |