From 72a454cd3513ac24fbdd0e0cb9ad70b86a99b801 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Tue, 31 May 2011 20:30:28 +0100 Subject: Merge Chromium.org at r11.0.672.0: Initial merge by git. Change-Id: I8b4aaf611a2a405fe3fe10e8a94ea7658645c192 --- chrome/browser/safe_browsing/safe_browsing_service.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'chrome/browser/safe_browsing/safe_browsing_service.h') 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 #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 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& 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_; -- cgit v1.1