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

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

Issue 1241583009: Async Safe Browsing check, on mobile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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 cb87b59d9f52f79154862289d123d4a94ed9b772..8b16d1ce7c14f8aa765708d9a6537450ec3a542a 100644
--- a/chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc
+++ b/chrome/browser/renderer_host/safe_browsing_resource_throttle_factory.cc
@@ -40,9 +40,22 @@ ResourceThrottle* SafeBrowsingResourceThrottleFactory::Create(
return factory_->CreateResourceThrottle(
request, resource_context, resource_type, service);
-#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
- // Throttle consults a local or remote database before proceeding.
- return new SafeBrowsingResourceThrottle(request, resource_type, service);
+ return CreateWithoutRegisteredFactory(request, resource_type, service);
+}
+
+ResourceThrottle*
+SafeBrowsingResourceThrottleFactory::CreateWithoutRegisteredFactory(
+ net::URLRequest* request,
+ content::ResourceType resource_type,
+ SafeBrowsingService* service) {
+#if defined(SAFE_BROWSING_DB_LOCAL)
+ // Throttle consults a local database before starting the resource request.
+ return new SafeBrowsingResourceThrottle(request, resource_type, service,
+ true /* defer_at_start */);
+#elif defined(SAFE_BROWSING_DB_REMOTE)
+ // Throttle consults a remote database before processing the response.
+ return new SafeBrowsingResourceThrottle(request, resource_type, service,
+ false /* defer_at_start */);
#else
return NULL;
#endif
« 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