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

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

Issue 1424003006: DataReductionProxyNavigationThrottle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merge-session-throttle
Patch Set: Created 5 years 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_throttling_utils_android.cc
diff --git a/chrome/browser/renderer_host/data_reduction_proxy_throttling_utils_android.cc b/chrome/browser/renderer_host/data_reduction_proxy_throttling_utils_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3d5d323f17ac45c8d945a59cff4745f41b7cd6be
--- /dev/null
+++ b/chrome/browser/renderer_host/data_reduction_proxy_throttling_utils_android.cc
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/renderer_host/data_reduction_proxy_throttling_utils_android.h"
+
+#include "net/http/http_response_headers.h"
+#include "url/gurl.h"
+
+namespace data_reduction_proxy_throttling_utils {
+
+const char kUnsafeUrlProceedHeader[] = "X-Unsafe-Url-Proceed";
+
+bool CanCreateThrottle(bool is_incognito,
+ bool is_data_reduction_proxy_available,
+ const GURL& url) {
+ if (is_incognito || !is_data_reduction_proxy_available ||
+ url.SchemeIsCryptographic()) {
+ return false;
+ }
+ return true;
+}
+
+safe_browsing::SBThreatType CheckHeaders(
+ const net::HttpResponseHeaders* headers) {
+ safe_browsing::SBThreatType result = safe_browsing::SB_THREAT_TYPE_SAFE;
+
+ // TODO(sgurun) Check for spdy proxy origin.
+ if (headers == NULL)
+ return result;
+
+ if (headers->HasHeader("X-Phishing-Url"))
+ result = safe_browsing::SB_THREAT_TYPE_URL_PHISHING;
+ else if (headers->HasHeader("X-Malware-Url"))
+ result = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
+
+ return result;
+}
+
+} // namespace data_reduction_proxy_throttling_utils
« no previous file with comments | « chrome/browser/renderer_host/data_reduction_proxy_throttling_utils_android.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698