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

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

Issue 2605213002: componentize SafeBrowsingService (Closed)
Patch Set: Remove explicit return statements Created 3 years, 12 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: 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 666d7aacaeb6124b377c49efd443836bcd46832e..d036c6c060be2087cbc7c06da9b54aa714352407 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -13,15 +13,11 @@
#include <string>
#include "base/callback.h"
-#include "base/callback_list.h"
#include "base/files/file_path.h"
#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/observer_list.h"
#include "base/sequenced_task_runner_helpers.h"
#include "chrome/browser/safe_browsing/services_delegate.h"
-#include "components/safe_browsing_db/util.h"
-#include "content/public/browser/browser_thread.h"
+#include "components/safe_browsing/base_safe_browsing_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -63,9 +59,7 @@ struct V4ProtocolConfig;
// the heavylifting of safebrowsing service. Both of these managers stay
// alive until SafeBrowsingService is destroyed, however, they are disabled
// permanently when Shutdown method is called.
-class SafeBrowsingService : public base::RefCountedThreadSafe<
- SafeBrowsingService,
- content::BrowserThread::DeleteOnUIThread>,
+class SafeBrowsingService : public BaseSafeBrowsingService,
public content::NotificationObserver {
public:
// Makes the passed |factory| the factory used to instanciate
@@ -82,10 +76,10 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
static SafeBrowsingService* CreateSafeBrowsingService();
// Called on the UI thread to initialize the service.
- void Initialize();
+ void Initialize() override;
// Called on the main thread to let us know that the io_thread is going away.
- void ShutDown();
+ void ShutDown() override;
// Called on UI thread to decide if the download file's sha256 hash
// should be calculated for safebrowsing.
@@ -100,12 +94,6 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
// Returns the client_name field for both V3 and V4 protocol manager configs.
std::string GetProtocolConfigClientName() const;
- // Get current enabled status. Must be called on IO thread.
- bool enabled() const {
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- return enabled_;
- }
-
// Whether the service is enabled by the current set of profiles.
bool enabled_by_prefs() const {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -122,13 +110,14 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
return services_delegate_->GetDownloadService();
}
- scoped_refptr<net::URLRequestContextGetter> url_request_context();
+ scoped_refptr<net::URLRequestContextGetter> url_request_context() override;
const scoped_refptr<SafeBrowsingUIManager>& ui_manager() const;
// This returns either the v3 or the v4 database manager, depending on
// the experiment settings.
- const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager() const;
+ const scoped_refptr<SafeBrowsingDatabaseManager>& database_manager()
+ const override;
scoped_refptr<SafeBrowsingNavigationObserverManager>
navigation_observer_manager();
@@ -186,7 +175,7 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
~SafeBrowsingService() override;
- virtual SafeBrowsingDatabaseManager* CreateDatabaseManager();
+ SafeBrowsingDatabaseManager* CreateDatabaseManager() override;
virtual SafeBrowsingUIManager* CreateUIManager();
@@ -201,8 +190,6 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
private:
friend class SafeBrowsingServiceFactoryImpl;
- friend struct content::BrowserThread::DeleteOnThread<
- content::BrowserThread::UI>;
friend class base::DeleteHelper<SafeBrowsingService>;
friend class SafeBrowsingServerTest;
friend class SafeBrowsingServiceTest;
@@ -269,10 +256,6 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
// Provides phishing and malware statistics. Accessed on IO thread.
std::unique_ptr<SafeBrowsingPingManager> ping_manager_;
- // Whether the service is running. 'enabled_' is used by SafeBrowsingService
- // on the IO thread during normal operations.
- bool enabled_;
-
// Whether SafeBrowsing is enabled by the current set of profiles.
// Accessed on UI thread.
bool enabled_by_prefs_;
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698