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

Unified Diff: chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc

Issue 431433002: Make SafeBrowsingResourceThrottleFactory::RegisterFactory() not optional. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc
diff --git a/chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc b/chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc
index c4906c18ac21058146fbe9e6afccdbc1533908ed..7b1fe0930180d6d5919c5850ca146464e844d507 100644
--- a/chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc
+++ b/chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc
@@ -16,21 +16,24 @@ SafeBrowsingResourceThrottleFactory*
SafeBrowsingResourceThrottleFactory::factory_ = NULL;
// static
+void SafeBrowsingResourceThrottleFactory::RegisterFactory(
+ SafeBrowsingResourceThrottleFactory* factory) {
+ factory_ = factory;
+}
+
+// static
ResourceThrottle* SafeBrowsingResourceThrottleFactory::Create(
net::URLRequest* request,
content::ResourceContext* resource_context,
bool is_subresource,
SafeBrowsingService* service) {
-
-#if defined(FULL_SAFE_BROWSING)
if (factory_)
return factory_->CreateResourceThrottle(
request, resource_context, is_subresource, service);
+
+#if defined(FULL_SAFE_BROWSING)
return new SafeBrowsingResourceThrottle(request, is_subresource, service);
#elif defined(MOBILE_SAFE_BROWSING)
- if (factory_)
- return factory_->CreateResourceThrottle(
- request, resource_context, is_subresource, service);
return NULL;
#else
#error Need to define {FULL|MOBILE} SAFE_BROWSING mode.
« no previous file with comments | « chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698