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

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

Issue 397853002: Refactor safe-browsing build-config definitions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to satiate trybots 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
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 7b1fe0930180d6d5919c5850ca146464e844d507..5bf90c7e077a8a4f6fa295ae6faf7da32fc76f6d 100644
--- a/chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc
+++ b/chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc
@@ -5,7 +5,8 @@
#include "chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.h"
#include "content/public/browser/resource_context.h"
-#if defined(FULL_SAFE_BROWSING)
+
+#if defined(SAFE_BROWSING_DATABASE)
#include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
#endif
@@ -27,15 +28,23 @@ ResourceThrottle* SafeBrowsingResourceThrottleFactory::Create(
content::ResourceContext* resource_context,
bool is_subresource,
SafeBrowsingService* service) {
+#if defined(SAFE_BROWSING_SERVICE)
if (factory_)
return factory_->CreateResourceThrottle(
request, resource_context, is_subresource, service);
-#if defined(FULL_SAFE_BROWSING)
+#if defined(SAFE_BROWSING_DATABASE)
+ // Throttle consults a local database before proceeding.
return new SafeBrowsingResourceThrottle(request, is_subresource, service);
-#elif defined(MOBILE_SAFE_BROWSING)
+#else
return NULL;
+#endif // SAFE_BROWSING_DATABASE
+
#else
-#error Need to define {FULL|MOBILE} SAFE_BROWSING mode.
-#endif
+ // Compiling this file only makes sense if SAFE_BROWSING_SERVICE is enabled.
+ // If the build is breaking here, it probably means that a gyp or gn file has
+ // been modified to build this file with safe_browsing=0 (gn
+ // safe_browsing_mode=0).
+#error Need to define safe_browsing mode.
+#endif // SAFE_BROWSING_SERVICE
}

Powered by Google App Engine
This is Rietveld 408576698