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

Unified Diff: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc

Issue 2876473003: [ABANDONED] [WIP] Refactor SafeBrowsingResourceThrottle in preparation for WebSocket (Closed)
Patch Set: Minor fixes Created 3 years, 6 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/loader/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
index 0d8316eed6fea7513c43009212d015ce7de86141..bcf0912d20a2295fd41fa7c843b4b9cd62531626 100644
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -55,6 +55,7 @@
#include "components/previews/core/previews_io_data.h"
#include "components/rappor/public/rappor_utils.h"
#include "components/rappor/rappor_service_impl.h"
+#include "components/safe_browsing/resource_throttle.h"
#include "components/search_engines/template_url_service.h"
#include "components/variations/net/variations_http_headers.h"
#include "content/public/browser/browser_thread.h"
@@ -651,21 +652,22 @@ void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles(
// Insert either safe browsing or data reduction proxy throttle at the front
// of the list, so one of them gets to decide if the resource is safe.
- content::ResourceThrottle* first_throttle = NULL;
+ std::unique_ptr<content::ResourceThrottle> first_throttle;
#if defined(OS_ANDROID)
- first_throttle = DataReductionProxyResourceThrottle::MaybeCreate(
- request, resource_context, resource_type, safe_browsing_.get());
+ first_throttle =
+ base::WrapUnique(DataReductionProxyResourceThrottle::MaybeCreate(
+ request, resource_context, resource_type, safe_browsing_.get()));
#endif // defined(OS_ANDROID)
#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
if (!first_throttle && io_data->safe_browsing_enabled()->GetValue()) {
- first_throttle = SafeBrowsingResourceThrottle::MaybeCreate(
+ first_throttle = MaybeCreateSafeBrowsingResourceThrottle(
request, resource_type, safe_browsing_.get());
}
#endif // defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
if (first_throttle)
- throttles->push_back(base::WrapUnique(first_throttle));
+ throttles->push_back(std::move(first_throttle));
#if BUILDFLAG(ENABLE_EXTENSIONS)
content::ResourceThrottle* wait_for_extensions_init_throttle =

Powered by Google App Engine
This is Rietveld 408576698