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

Unified Diff: chrome/browser/safe_browsing/download_protection_service.h

Issue 12313141: Use DownloadItem directly in DownloadProtectionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 7 years, 10 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/safe_browsing/download_protection_service.h
diff --git a/chrome/browser/safe_browsing/download_protection_service.h b/chrome/browser/safe_browsing/download_protection_service.h
index 0e42884dde759f158c28212846c64ae88b5b3e5e..d7407b24cc9a9d34bf87e56e76d558b41e7724c7 100644
--- a/chrome/browser/safe_browsing/download_protection_service.h
+++ b/chrome/browser/safe_browsing/download_protection_service.h
@@ -39,25 +39,6 @@ class SignatureUtil;
// client download is malicious or not.
class DownloadProtectionService {
public:
- // TODO(noelutz): we're missing some fields here: server IPs,
- // tab URL redirect chain, ...
- struct DownloadInfo {
- base::FilePath local_file; // Where the download is currently stored.
- base::FilePath target_file; // Where it will eventually be stored.
- std::vector<GURL> download_url_chain;
- GURL referrer_url;
- std::string sha256_hash;
- int64 total_bytes;
- bool user_initiated;
- std::string remote_address;
- bool zipped_executable;
- DownloadInfo();
- ~DownloadInfo();
- std::string DebugString() const;
- // Creates a DownloadInfo from a DownloadItem object.
- static DownloadInfo FromDownloadItem(const content::DownloadItem& item);
- };
-
enum DownloadCheckResult {
SAFE,
DANGEROUS,
@@ -82,7 +63,7 @@ class DownloadProtectionService {
// method must be called on the UI thread, and the callback will also be
// invoked on the UI thread. This method must be called once the download
// is finished and written to disk.
- virtual void CheckClientDownload(const DownloadInfo& info,
+ virtual void CheckClientDownload(content::DownloadItem* item,
const CheckDownloadCallback& callback);
// Checks whether any of the URLs in the redirect chain of the
@@ -90,17 +71,18 @@ class DownloadProtectionService {
// delivered asynchronously via the given callback. This method must be
// called on the UI thread, and the callback will also be invoked on the UI
// thread. Pre-condition: !info.download_url_chain.empty().
- virtual void CheckDownloadUrl(const DownloadInfo& info,
+ virtual void CheckDownloadUrl(const content::DownloadItem& item,
const CheckDownloadCallback& callback);
// Returns true iff the download specified by |info| should be scanned by
// CheckClientDownload() for malicious content.
- virtual bool IsSupportedDownload(const DownloadInfo& info) const;
+ virtual bool IsSupportedDownload(const content::DownloadItem& item,
+ const base::FilePath& target_path) const;
// Display more information to the user regarding the download specified by
// |info|. This method is invoked when the user requests more information
// about a download that was marked as malicious.
- void ShowDetailsForDownload(const DownloadInfo& info,
+ void ShowDetailsForDownload(const content::DownloadItem& item,
content::PageNavigator* navigator);
// Enables or disables the service. This is usually called by the
« no previous file with comments | « chrome/browser/download/download_shelf_context_menu.cc ('k') | chrome/browser/safe_browsing/download_protection_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698