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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h

Issue 517693002: Add embedder-specific headers to HTTP CONNECT tunnel request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reworked HaveAuth test Created 6 years, 3 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: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
index 855e41c61a69c8b8f909f8f4da91e4fe9f1e9151..3966e052ba50b755383d6dec82c388557b40c00e 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
@@ -16,6 +16,7 @@ class SingleThreadTaskRunner;
}
namespace net {
+class HostPortPair;
class HttpRequestHeaders;
class HttpResponseHeaders;
class ProxyServer;
@@ -54,11 +55,20 @@ class DataReductionProxyAuthRequestHandler {
// Adds a 'Chrome-Proxy' header to |request_headers| with the data reduction
// proxy authentication credentials. Only adds this header if the provided
- // |proxy_server| is a data reduction proxy. Must be called on the IO thread.
+ // |proxy_server| is a data reduction proxy and not the data reduction proxy's
+ // CONNECT server. Must be called on the IO thread.
void MaybeAddRequestHeader(net::URLRequest* request,
const net::ProxyServer& proxy_server,
net::HttpRequestHeaders* request_headers);
+ // Adds a 'Chrome-Proxy' header to |request_headers| with the data reduction
+ // proxy authentication credentials. Only adds this header if the provided
+ // |proxy_server| is the data reduction proxy's CONNECT server. Must be called
+ // on the IO thread.
+ void MaybeAddProxyTunnelRequestHandler(
+ const net::HostPortPair& proxy_server,
+ net::HttpRequestHeaders* request_headers);
+
// Sets a new authentication key. This must be called for platforms that do
// not have a default key defined. See the constructor implementation for
// those platforms. Must be called on the UI thread.
@@ -106,6 +116,14 @@ class DataReductionProxyAuthRequestHandler {
std::string* session,
std::string* credentials);
+ // Adds authentication headers only if |expects_ssl| is true and
+ // |proxy_server| is a data reduction proxy used for ssl tunneling via
+ // HTTP CONNECT, or |expect_ssl| is false and |proxy_server| is a data
+ // reduction proxy for HTTP traffic.
+ void MaybeAddRequestHeaderImpl(const net::HostPortPair& proxy_server,
+ bool expect_ssl,
+ net::HttpRequestHeaders* request_headers);
+
// Authentication state.
std::string key_;

Powered by Google App Engine
This is Rietveld 408576698