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

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

Issue 1420053005: Move code in components/safe_browsing_db and chrome/browser/s_b/ under the safe_browsing namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_components_move
Patch Set: Remove '// namespace safe_browsing' for a small fwd decl block. Created 5 years, 1 month 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/data_reduction_proxy_resource_throttle_android.cc
diff --git a/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc b/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc
index 73cf8379c6c0078e95ec99639736442e37935b27..39997230baeaacce78efc187952dbc54da7fafdb 100644
--- a/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc
+++ b/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc
@@ -21,6 +21,9 @@
using content::BrowserThread;
using content::ResourceThrottle;
+using safe_browsing::SafeBrowsingService;
+using safe_browsing::SafeBrowsingUIManager;
+using safe_browsing::SBThreatType;
// TODO(eroman): Downgrade these CHECK()s to DCHECKs once there is more
// unit test coverage.
@@ -72,7 +75,7 @@ void DataReductionProxyResourceThrottle::WillRedirectRequest(
// We need to check the new URL before following the redirect.
SBThreatType threat_type = CheckUrl();
- if (threat_type == SB_THREAT_TYPE_SAFE)
+ if (threat_type == safe_browsing::SB_THREAT_TYPE_SAFE)
return;
if (request_->load_flags() & net::LOAD_PREFETCH) {
@@ -149,22 +152,23 @@ void DataReductionProxyResourceThrottle::OnBlockingPageComplete(bool proceed) {
}
SBThreatType DataReductionProxyResourceThrottle::CheckUrl() {
- SBThreatType result = SB_THREAT_TYPE_SAFE;
+ SBThreatType result = safe_browsing::SB_THREAT_TYPE_SAFE;
// TODO(sgurun) Check for spdy proxy origin.
if (request_->response_headers() == NULL)
return result;
if (request_->response_headers()->HasHeader("X-Phishing-Url"))
- result = SB_THREAT_TYPE_URL_PHISHING;
+ result = safe_browsing::SB_THREAT_TYPE_URL_PHISHING;
else if (request_->response_headers()->HasHeader("X-Malware-Url"))
- result = SB_THREAT_TYPE_URL_MALWARE;
+ result = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
// If safe browsing is disabled and the request is sent to the DRP server,
// we need to break the redirect loop by setting the extra header.
- if (result != SB_THREAT_TYPE_SAFE && !safe_browsing_->enabled()) {
+ if (result != safe_browsing::SB_THREAT_TYPE_SAFE &&
+ !safe_browsing_->enabled()) {
request_->SetExtraRequestHeaderByName(kUnsafeUrlProceedHeader, "1", true);
- result = SB_THREAT_TYPE_SAFE;
+ result = safe_browsing::SB_THREAT_TYPE_SAFE;
}
return result;

Powered by Google App Engine
This is Rietveld 408576698