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

Unified Diff: chrome/browser/net/spdyproxy/data_saving_metrics.cc

Issue 156373002: Support for new data reduction proxy via header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compilation error on unsupported platforms Created 6 years, 10 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/net/spdyproxy/data_saving_metrics.cc
diff --git a/chrome/browser/net/spdyproxy/data_saving_metrics.cc b/chrome/browser/net/spdyproxy/data_saving_metrics.cc
index ffce30fd9a4f5d026324be1c767d51e8105e4c52..ee26d4d022ed04a3d4b625311737e481d5a0fd60 100644
--- a/chrome/browser/net/spdyproxy/data_saving_metrics.cc
+++ b/chrome/browser/net/spdyproxy/data_saving_metrics.cc
@@ -348,28 +348,6 @@ bool IsBypassRequest(const net::URLRequest* request, int64* delay_seconds) {
#endif // defined(OS_ANDROID) || defined(OS_IOS)
}
-// IsDataReductionProxyReponse returns true if response_headers contains the
-// data reduction proxy Via header value.
-bool IsDataReductionProxyReponse(
- const net::HttpResponseHeaders* response_headers) {
- const char kDatReductionProxyViaValue[] = "1.1 Chrome Compression Proxy";
- size_t value_len = strlen(kDatReductionProxyViaValue);
- void* iter = NULL;
- std::string temp;
- while (response_headers->EnumerateHeader(&iter, "Via", &temp)) {
- string::const_iterator it =
- std::search(temp.begin(),
- temp.end(),
- kDatReductionProxyViaValue,
- kDatReductionProxyViaValue + value_len,
- base::CaseInsensitiveCompareASCII<char>());
- if (it != temp.end()) {
- return true;
- }
- }
- return false;
-}
-
} // namespace
namespace spdyproxy {
@@ -387,8 +365,13 @@ DataReductionRequestType GetDataReductionRequestType(
return (bypass_delay > kLongBypassDelayInSeconds) ?
LONG_BYPASS : SHORT_BYPASS;
}
- return IsDataReductionProxyReponse(request->response_info().headers) ?
- VIA_DATA_REDUCTION_PROXY: UNKNOWN_TYPE;
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
+ if (request->response_info().headers &&
+ request->response_info().headers->IsChromeProxyResponse()) {
+ return VIA_DATA_REDUCTION_PROXY;
+ }
+#endif
+ return UNKNOWN_TYPE;
}
int64 GetAdjustedOriginalContentLength(
« no previous file with comments | « chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest.cc ('k') | chrome/renderer/page_load_histograms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698