diff options
Diffstat (limited to 'components/safe_browsing_db')
-rw-r--r-- | components/safe_browsing_db/BUILD.gn | 5 | ||||
-rw-r--r-- | components/safe_browsing_db/database_manager.cc | 19 | ||||
-rw-r--r-- | components/safe_browsing_db/database_manager.h | 19 | ||||
-rw-r--r-- | components/safe_browsing_db/remote_database_manager.cc | 10 | ||||
-rw-r--r-- | components/safe_browsing_db/remote_database_manager.h | 13 |
5 files changed, 3 insertions, 63 deletions
diff --git a/components/safe_browsing_db/BUILD.gn b/components/safe_browsing_db/BUILD.gn index 5a58fe2..ad32884 100644 --- a/components/safe_browsing_db/BUILD.gn +++ b/components/safe_browsing_db/BUILD.gn @@ -49,12 +49,9 @@ source_set("database_manager") { ] deps = [ ":hit_report", - ":proto", ":util", - ":v4_get_hash_protocol_manager", "//base:base", "//content/public/common", - "//net", "//url:url", ] } @@ -103,9 +100,7 @@ source_set("remote_database_manager") { ] deps = [ ":database_manager", - ":proto", ":safe_browsing_api_handler", - ":v4_get_hash_protocol_manager", "//base:base", "//components/variations", "//content/public/browser", diff --git a/components/safe_browsing_db/database_manager.cc b/components/safe_browsing_db/database_manager.cc index 6412cf0..b818722 100644 --- a/components/safe_browsing_db/database_manager.cc +++ b/components/safe_browsing_db/database_manager.cc @@ -4,29 +4,10 @@ #include "components/safe_browsing_db/database_manager.h" -#include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" -#include "net/url_request/url_request_context_getter.h" #include "url/gurl.h" namespace safe_browsing { -SafeBrowsingDatabaseManager::SafeBrowsingDatabaseManager() - : SafeBrowsingDatabaseManager(NULL, V4GetHashProtocolConfig()) { -} - -SafeBrowsingDatabaseManager::SafeBrowsingDatabaseManager( - net::URLRequestContextGetter* request_context_getter, - const V4GetHashProtocolConfig& config) { - // Instantiate a V4GetHashProtocolManager. - if (request_context_getter) { - v4_get_hash_protocol_manager_.reset(V4GetHashProtocolManager::Create( - request_context_getter, config)); - } -} - -SafeBrowsingDatabaseManager::~SafeBrowsingDatabaseManager() { -} - void SafeBrowsingDatabaseManager::CheckApiBlacklistUrl(const GURL& url, Client* client) { // TODO(kcarattini): Implement this. diff --git a/components/safe_browsing_db/database_manager.h b/components/safe_browsing_db/database_manager.h index a4c229f..8167b3a 100644 --- a/components/safe_browsing_db/database_manager.h +++ b/components/safe_browsing_db/database_manager.h @@ -20,15 +20,8 @@ #include "content/public/common/resource_type.h" #include "url/gurl.h" -namespace net { -class URLRequestContextGetter; -} // namespace net - namespace safe_browsing { -struct V4GetHashProtocolConfig; -class V4GetHashProtocolManager; - // Base class to either the locally-managed or a remotely-managed database. class SafeBrowsingDatabaseManager : public base::RefCountedThreadSafe<SafeBrowsingDatabaseManager> { @@ -159,19 +152,9 @@ class SafeBrowsingDatabaseManager virtual void StopOnIOThread(bool shutdown) = 0; protected: - // Use this constructor for testing only. - SafeBrowsingDatabaseManager(); - - // Constructs the database manager. - SafeBrowsingDatabaseManager( - net::URLRequestContextGetter* request_context_getter, - const V4GetHashProtocolConfig& config); - - virtual ~SafeBrowsingDatabaseManager(); + virtual ~SafeBrowsingDatabaseManager() {} friend class base::RefCountedThreadSafe<SafeBrowsingDatabaseManager>; - - std::unique_ptr<V4GetHashProtocolManager> v4_get_hash_protocol_manager_; }; // class SafeBrowsingDatabaseManager } // namespace safe_browsing diff --git a/components/safe_browsing_db/remote_database_manager.cc b/components/safe_browsing_db/remote_database_manager.cc index d812200..8b1c480 100644 --- a/components/safe_browsing_db/remote_database_manager.cc +++ b/components/safe_browsing_db/remote_database_manager.cc @@ -11,7 +11,6 @@ #include "base/strings/string_split.h" #include "base/timer/elapsed_timer.h" #include "components/safe_browsing_db/safe_browsing_api_handler.h" -#include "components/safe_browsing_db/v4_get_hash_protocol_manager.h" #include "components/variations/variations_associated_data.h" #include "content/public/browser/browser_thread.h" @@ -94,14 +93,7 @@ void RemoteSafeBrowsingDatabaseManager::ClientRequest::OnRequestDone( // TODO(nparker): Add more tests for this class RemoteSafeBrowsingDatabaseManager::RemoteSafeBrowsingDatabaseManager() - : RemoteSafeBrowsingDatabaseManager(NULL, V4GetHashProtocolConfig()) { -} - -RemoteSafeBrowsingDatabaseManager::RemoteSafeBrowsingDatabaseManager( - net::URLRequestContextGetter* request_context_getter, - const V4GetHashProtocolConfig& config) - : SafeBrowsingDatabaseManager(request_context_getter, config), - enabled_(false) { + : enabled_(false) { // Decide which resource types to check. These two are the minimum. resource_types_to_check_.insert(content::RESOURCE_TYPE_MAIN_FRAME); resource_types_to_check_.insert(content::RESOURCE_TYPE_SUB_FRAME); diff --git a/components/safe_browsing_db/remote_database_manager.h b/components/safe_browsing_db/remote_database_manager.h index 766a7a9..89c71f5 100644 --- a/components/safe_browsing_db/remote_database_manager.h +++ b/components/safe_browsing_db/remote_database_manager.h @@ -18,26 +18,15 @@ #include "components/safe_browsing_db/database_manager.h" #include "url/gurl.h" -namespace net { -class URLRequestContextGetter; -} - namespace safe_browsing { -struct V4GetHashProtocolConfig; - // An implementation that proxies requests to a service outside of Chromium. // Does not manage a local database. class RemoteSafeBrowsingDatabaseManager : public SafeBrowsingDatabaseManager { public: - // Use this constructor for testing only. - RemoteSafeBrowsingDatabaseManager(); - // Construct RemoteSafeBrowsingDatabaseManager. // Must be initialized by calling StartOnIOThread() before using. - RemoteSafeBrowsingDatabaseManager( - net::URLRequestContextGetter* request_context_getter, - const V4GetHashProtocolConfig& config); + RemoteSafeBrowsingDatabaseManager(); // // SafeBrowsingDatabaseManager implementation |