diff options
author | Kristian Monsen <kristianm@google.com> | 2011-05-31 20:30:28 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-06-14 20:31:41 -0700 |
commit | 72a454cd3513ac24fbdd0e0cb9ad70b86a99b801 (patch) | |
tree | 382278a54ce7a744d62fa510a9a80688cc12434b /chrome/browser/safe_browsing/safe_browsing_service.h | |
parent | c4becdd46e31d261b930e4b5a539cbc1d45c23a6 (diff) | |
download | external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.zip external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.gz external_chromium-72a454cd3513ac24fbdd0e0cb9ad70b86a99b801.tar.bz2 |
Merge Chromium.org at r11.0.672.0: Initial merge by git.
Change-Id: I8b4aaf611a2a405fe3fe10e8a94ea7658645c192
Diffstat (limited to 'chrome/browser/safe_browsing/safe_browsing_service.h')
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_service.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h index 73eb201..abebc32 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.h +++ b/chrome/browser/safe_browsing/safe_browsing_service.h @@ -15,9 +15,9 @@ #include <vector> #include "base/hash_tables.h" -#include "base/lock.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "base/synchronization/lock.h" #include "base/time.h" #include "chrome/browser/safe_browsing/safe_browsing_util.h" #include "googleurl/src/gurl.h" @@ -84,6 +84,7 @@ class SafeBrowsingService GURL url; GURL original_url; + std::vector<GURL> redirect_urls; ResourceType::Type resource_type; UrlCheckResult threat_type; Client* client; @@ -117,6 +118,10 @@ class SafeBrowsingService // Create an instance of the safe browsing service. static SafeBrowsingService* CreateSafeBrowsingService(); + // Called on UI thread to decide if safe browsing related stats + // could be reported. + bool CanReportStats() const; + // Called on the UI thread to initialize the service. void Initialize(); @@ -126,6 +131,10 @@ class SafeBrowsingService // Returns true if the url's scheme can be checked. bool CanCheckUrl(const GURL& url) const; + // Called on UI thread to decide if the download file's sha256 hash + // should be calculated for safebrowsing. + bool DownloadBinHashNeeded() const; + // Called on the IO thread to check if the given url is safe or not. If we // can synchronously determine that the url is safe, CheckUrl returns true. // Otherwise it returns false, and "client" is called asynchronously with the @@ -147,6 +156,7 @@ class SafeBrowsingService // chain). Otherwise, |original_url| = |url|. void DisplayBlockingPage(const GURL& url, const GURL& original_url, + const std::vector<GURL>& redirect_urls, ResourceType::Type resource_type, UrlCheckResult result, Client* client, @@ -340,12 +350,12 @@ class SafeBrowsingService // Used for issuing only one GetHash request for a given prefix. GetHashRequests gethash_requests_; - // The sqlite database. We don't use a scoped_ptr because it needs to be - // destructed on a different thread than this object. + // The persistent database. We don't use a scoped_ptr because it + // needs to be destructed on a different thread than this object. SafeBrowsingDatabase* database_; // Lock used to prevent possible data races due to compiler optimizations. - mutable Lock database_lock_; + mutable base::Lock database_lock_; // Handles interaction with SafeBrowsing servers. SafeBrowsingProtocolManager* protocol_manager_; |