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

Unified Diff: chrome/renderer/safe_browsing/renderer_url_loader_throttle.cc

Issue 2924723002: Network service: SafeBrowsing check for frame-resources from browser. (Closed)
Patch Set: . 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/renderer/safe_browsing/renderer_url_loader_throttle.cc
diff --git a/chrome/renderer/safe_browsing/safe_browsing_url_loader_throttle.cc b/chrome/renderer/safe_browsing/renderer_url_loader_throttle.cc
similarity index 73%
rename from chrome/renderer/safe_browsing/safe_browsing_url_loader_throttle.cc
rename to chrome/renderer/safe_browsing/renderer_url_loader_throttle.cc
index 16837d579b66681121b2b00c83bed23619377a54..d2ea46c24a7cdd0c83a23502c4f7fcef9027f44e 100644
--- a/chrome/renderer/safe_browsing/safe_browsing_url_loader_throttle.cc
+++ b/chrome/renderer/safe_browsing/renderer_url_loader_throttle.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/renderer/safe_browsing/safe_browsing_url_loader_throttle.h"
+#include "chrome/renderer/safe_browsing/renderer_url_loader_throttle.h"
#include "base/logging.h"
#include "mojo/public/cpp/bindings/interface_request.h"
@@ -10,16 +10,16 @@
namespace safe_browsing {
-SafeBrowsingURLLoaderThrottle::SafeBrowsingURLLoaderThrottle(
+RendererURLLoaderThrottle::RendererURLLoaderThrottle(
mojom::SafeBrowsing* safe_browsing,
int render_frame_id)
: safe_browsing_(safe_browsing),
render_frame_id_(render_frame_id),
weak_factory_(this) {}
-SafeBrowsingURLLoaderThrottle::~SafeBrowsingURLLoaderThrottle() = default;
+RendererURLLoaderThrottle::~RendererURLLoaderThrottle() = default;
-void SafeBrowsingURLLoaderThrottle::WillStartRequest(
+void RendererURLLoaderThrottle::WillStartRequest(
const GURL& url,
int load_flags,
content::ResourceType resource_type,
@@ -34,16 +34,15 @@ void SafeBrowsingURLLoaderThrottle::WillStartRequest(
safe_browsing_->CreateCheckerAndCheck(
render_frame_id_, mojo::MakeRequest(&url_checker_), url, load_flags,
resource_type,
- base::BindOnce(&SafeBrowsingURLLoaderThrottle::OnCheckUrlResult,
+ base::BindOnce(&RendererURLLoaderThrottle::OnCheckUrlResult,
weak_factory_.GetWeakPtr()));
safe_browsing_ = nullptr;
- url_checker_.set_connection_error_handler(
- base::Bind(&SafeBrowsingURLLoaderThrottle::OnConnectionError,
- base::Unretained(this)));
+ url_checker_.set_connection_error_handler(base::Bind(
+ &RendererURLLoaderThrottle::OnConnectionError, base::Unretained(this)));
}
-void SafeBrowsingURLLoaderThrottle::WillRedirectRequest(
+void RendererURLLoaderThrottle::WillRedirectRequest(
const net::RedirectInfo& redirect_info,
bool* defer) {
// If |blocked_| is true, the resource load has been canceled and there
@@ -58,11 +57,11 @@ void SafeBrowsingURLLoaderThrottle::WillRedirectRequest(
pending_checks_++;
url_checker_->CheckUrl(
redirect_info.new_url,
- base::BindOnce(&SafeBrowsingURLLoaderThrottle::OnCheckUrlResult,
+ base::BindOnce(&RendererURLLoaderThrottle::OnCheckUrlResult,
base::Unretained(this)));
}
-void SafeBrowsingURLLoaderThrottle::WillProcessResponse(bool* defer) {
+void RendererURLLoaderThrottle::WillProcessResponse(bool* defer) {
// If |blocked_| is true, the resource load has been canceled and there
// shouldn't be such a notification.
DCHECK(!blocked_);
@@ -71,7 +70,7 @@ void SafeBrowsingURLLoaderThrottle::WillProcessResponse(bool* defer) {
*defer = true;
}
-void SafeBrowsingURLLoaderThrottle::OnCheckUrlResult(bool safe) {
+void RendererURLLoaderThrottle::OnCheckUrlResult(bool safe) {
if (blocked_ || !url_checker_)
return;
@@ -92,7 +91,7 @@ void SafeBrowsingURLLoaderThrottle::OnCheckUrlResult(bool safe) {
}
}
-void SafeBrowsingURLLoaderThrottle::OnConnectionError() {
+void RendererURLLoaderThrottle::OnConnectionError() {
DCHECK(!blocked_);
// If a service-side disconnect happens, treat all URLs as if they are safe.

Powered by Google App Engine
This is Rietveld 408576698