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

Unified Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc

Issue 2871913004: net: add IsMethodIdempotent() to HttpUtil (Closed)
Patch Set: RFC Created 3 years, 7 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
« no previous file with comments | « components/data_reduction_proxy/core/common/data_reduction_proxy_util.h ('k') | net/http/http_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc
index 9af46dd61dffdb1927faf14f439ed5fa9f0808cf..ed6759db08d899a1814d6910d92b992fd02a599a 100644
--- a/components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_util.cc
@@ -13,6 +13,7 @@
#include "net/base/net_errors.h"
#include "net/base/url_util.h"
#include "net/http/http_response_headers.h"
+#include "net/http/http_util.h"
#include "net/proxy/proxy_config.h"
#include "net/proxy/proxy_info.h"
#include "net/url_request/url_request.h"
@@ -131,11 +132,6 @@ const char* GetStringForClient(Client client) {
}
}
-bool IsMethodIdempotent(const std::string& method) {
- return method == "GET" || method == "OPTIONS" || method == "HEAD" ||
- method == "PUT" || method == "DELETE" || method == "TRACE";
-}
-
GURL AddApiKeyToUrl(const GURL& url) {
GURL new_url = url;
#if defined(USE_GOOGLE_API_KEYS)
@@ -151,7 +147,7 @@ bool EligibleForDataReductionProxy(const net::ProxyInfo& proxy_info,
const GURL& url,
const std::string& method) {
return proxy_info.is_direct() && proxy_info.proxy_list().size() == 1 &&
- !url.SchemeIsWSOrWSS() && IsMethodIdempotent(method);
+ !url.SchemeIsWSOrWSS() && net::HttpUtil::IsMethodIdempotent(method);
}
bool ApplyProxyConfigToProxyInfo(const net::ProxyConfig& proxy_config,
« no previous file with comments | « components/data_reduction_proxy/core/common/data_reduction_proxy_util.h ('k') | net/http/http_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698