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

Side by Side Diff: net/http/http_transaction.h

Issue 333113002: Move data reduction proxy to Chrome-Proxy header for authentication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@flywheel-refactor-net-fake-a-redirect-response-headers-chrome-proxy-auth
Patch Set: Created 6 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_HTTP_HTTP_TRANSACTION_H_ 5 #ifndef NET_HTTP_HTTP_TRANSACTION_H_
6 #define NET_HTTP_HTTP_TRANSACTION_H_ 6 #define NET_HTTP_HTTP_TRANSACTION_H_
7 7
8 #include "net/base/completion_callback.h" 8 #include "net/base/completion_callback.h"
9 #include "net/base/load_states.h" 9 #include "net/base/load_states.h"
10 #include "net/base/net_export.h" 10 #include "net/base/net_export.h"
11 #include "net/base/request_priority.h" 11 #include "net/base/request_priority.h"
12 #include "net/base/upload_progress.h" 12 #include "net/base/upload_progress.h"
13 #include "net/websockets/websocket_handshake_stream_base.h" 13 #include "net/websockets/websocket_handshake_stream_base.h"
14 14
15 namespace net { 15 namespace net {
16 16
17 class AuthCredentials; 17 class AuthCredentials;
18 class BoundNetLog; 18 class BoundNetLog;
19 class HttpRequestHeaders; 19 class HttpRequestHeaders;
20 struct HttpRequestInfo; 20 struct HttpRequestInfo;
21 class HttpResponseInfo; 21 class HttpResponseInfo;
22 class IOBuffer; 22 class IOBuffer;
23 struct LoadTimingInfo; 23 struct LoadTimingInfo;
24 class ProxyInfo;
24 class QuicServerInfo; 25 class QuicServerInfo;
25 class X509Certificate; 26 class X509Certificate;
26 27
27 // Represents a single HTTP transaction (i.e., a single request/response pair). 28 // Represents a single HTTP transaction (i.e., a single request/response pair).
28 // HTTP redirects are not followed and authentication challenges are not 29 // HTTP redirects are not followed and authentication challenges are not
29 // answered. Cookies are assumed to be managed by the caller. 30 // answered. Cookies are assumed to be managed by the caller.
30 class NET_EXPORT_PRIVATE HttpTransaction { 31 class NET_EXPORT_PRIVATE HttpTransaction {
31 public: 32 public:
32 // If |*defer| is set to true, the transaction will wait until 33 // If |*defer| is set to true, the transaction will wait until
33 // ResumeNetworkStart is called before establishing a connection. 34 // ResumeNetworkStart is called before establishing a connection.
34 typedef base::Callback<void(bool* defer)> BeforeNetworkStartCallback; 35 typedef base::Callback<void(bool* defer)> BeforeNetworkStartCallback;
35 36
37 typedef base::Callback<void(const ProxyInfo*)> BeforeProxyHeadersSentCallback;
38
36 // Stops any pending IO and destroys the transaction object. 39 // Stops any pending IO and destroys the transaction object.
37 virtual ~HttpTransaction() {} 40 virtual ~HttpTransaction() {}
38 41
39 // Starts the HTTP transaction (i.e., sends the HTTP request). 42 // Starts the HTTP transaction (i.e., sends the HTTP request).
40 // 43 //
41 // Returns OK if the transaction could be started synchronously, which means 44 // Returns OK if the transaction could be started synchronously, which means
42 // that the request was served from the cache. ERR_IO_PENDING is returned to 45 // that the request was served from the cache. ERR_IO_PENDING is returned to
43 // indicate that the CompletionCallback will be notified once response info is 46 // indicate that the CompletionCallback will be notified once response info is
44 // available or if an IO error occurs. Any other return value indicates that 47 // available or if an IO error occurs. Any other return value indicates that
45 // the transaction could not be started. 48 // the transaction could not be started.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Set the WebSocketHandshakeStreamBase::CreateHelper to be used for the 154 // Set the WebSocketHandshakeStreamBase::CreateHelper to be used for the
152 // request. Only relevant to WebSocket transactions. Must be called before 155 // request. Only relevant to WebSocket transactions. Must be called before
153 // Start(). Ownership of |create_helper| remains with the caller. 156 // Start(). Ownership of |create_helper| remains with the caller.
154 virtual void SetWebSocketHandshakeStreamCreateHelper( 157 virtual void SetWebSocketHandshakeStreamCreateHelper(
155 WebSocketHandshakeStreamBase::CreateHelper* create_helper) = 0; 158 WebSocketHandshakeStreamBase::CreateHelper* create_helper) = 0;
156 159
157 // Set the callback to receive notification just before network use. 160 // Set the callback to receive notification just before network use.
158 virtual void SetBeforeNetworkStartCallback( 161 virtual void SetBeforeNetworkStartCallback(
159 const BeforeNetworkStartCallback& callback) = 0; 162 const BeforeNetworkStartCallback& callback) = 0;
160 163
164 // Set the callback to receive notification just before a proxy request
165 // is to be sent.
166 virtual void SetBeforeProxyHeadersSentCallback(
167 const BeforeProxyHeadersSentCallback& callback) = 0;
168
161 // Resumes the transaction after being deferred. 169 // Resumes the transaction after being deferred.
162 virtual int ResumeNetworkStart() = 0; 170 virtual int ResumeNetworkStart() = 0;
163 }; 171 };
164 172
165 } // namespace net 173 } // namespace net
166 174
167 #endif // NET_HTTP_HTTP_TRANSACTION_H_ 175 #endif // NET_HTTP_HTTP_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698