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

Unified Diff: android_webview/browser/renderer_host/aw_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: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
index 4a07d00a7e4f5c9daad627000ce1b30a6ca2fda5..ddf1902f6a902e6e4364b60968f31a749f9e7eaa 100644
--- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
@@ -25,6 +25,7 @@
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/browser/resource_dispatcher_host_login_delegate.h"
#include "content/public/browser/resource_request_info.h"
+#include "content/public/browser/resource_throttle.h"
#include "content/public/browser/web_contents.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -297,17 +298,13 @@ void AwResourceDispatcherHostDelegate::RequestBeginning(
request);
if (ioThreadThrottle->GetSafeBrowsingEnabled()) {
- content::ResourceThrottle* throttle =
- AwSafeBrowsingResourceThrottle::MaybeCreate(
+ std::unique_ptr<content::ResourceThrottle> throttle =
+ MaybeCreateAwSafeBrowsingResourceThrottle(
request, resource_type,
AwBrowserContext::GetDefault()->GetSafeBrowsingDBManager(),
AwBrowserContext::GetDefault()->GetSafeBrowsingUIManager());
- if (throttle == nullptr) {
- // Should not happen
- DLOG(WARNING) << "Failed creating safebrowsing throttle";
- } else {
- throttles->push_back(base::WrapUnique(throttle));
- }
+ DCHECK(throttle);
+ throttles->push_back(std::move(throttle));
}
// We always push the throttles here. Checking the existence of io_client

Powered by Google App Engine
This is Rietveld 408576698