summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/protocol_manager.h
diff options
context:
space:
mode:
authorpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 21:58:14 +0000
committerpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 21:58:14 +0000
commitdfdb0de71597b036b48fc4b292912bab83a02a94 (patch)
treef47c2d08e30b942c940e79acdff44029b32c0c27 /chrome/browser/safe_browsing/protocol_manager.h
parent070578438aad02cd5857bab0bcb3b3661048a982 (diff)
downloadchromium_src-dfdb0de71597b036b48fc4b292912bab83a02a94.zip
chromium_src-dfdb0de71597b036b48fc4b292912bab83a02a94.tar.gz
chromium_src-dfdb0de71597b036b48fc4b292912bab83a02a94.tar.bz2
Report malware sub resources and their containing page to the
SafeBrowsing service for faster malware detection. Any malware resource that we detect on a page is reported if the page that contains it is not in the blacklist AND the user has opted in to reporting stats. BUG=7607 (http://crbug.com/7607) Review URL: http://codereview.chromium.org/21474 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/protocol_manager.h')
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h
index 6198ed4..3023a2c 100644
--- a/chrome/browser/safe_browsing/protocol_manager.h
+++ b/chrome/browser/safe_browsing/protocol_manager.h
@@ -11,6 +11,7 @@
// The SafeBrowsingProtocolParser class to do the actual parsing.
#include <deque>
+#include <set>
#include "base/hash_tables.h"
#include "base/scoped_ptr.h"
@@ -86,6 +87,11 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate {
// The last time we received an update.
base::Time last_update() const { return last_update_; }
+ // Report a malware resource to the SafeBrowsing service.
+ void ReportMalware(const GURL& malware_url,
+ const GURL& page_url,
+ const GURL& referrer_url);
+
private:
// Internal API for fetching information from the SafeBrowsing servers. The
// GetHash requests are higher priority since they can block user requests
@@ -223,6 +229,9 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate {
// Track the size of each update (in bytes).
int update_size_;
+ // Track outstanding malware report fetchers for clean up.
+ std::set<const URLFetcher*> malware_reports_;
+
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingProtocolManager);
};