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

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

Issue 1110014: Reland r42300: "HttpRequestHeaders refactor."" (Closed)
Patch Set: Created 10 years, 9 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_NETWORK_TRANSACTION_H_ 5 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 15 matching lines...) Expand all
26 #include "net/proxy/proxy_service.h" 26 #include "net/proxy/proxy_service.h"
27 #include "net/socket/client_socket_pool.h" 27 #include "net/socket/client_socket_pool.h"
28 #include "testing/gtest/include/gtest/gtest_prod.h" 28 #include "testing/gtest/include/gtest/gtest_prod.h"
29 29
30 namespace net { 30 namespace net {
31 31
32 class ClientSocketFactory; 32 class ClientSocketFactory;
33 class ClientSocketHandle; 33 class ClientSocketHandle;
34 class SpdyStream; 34 class SpdyStream;
35 class HttpNetworkSession; 35 class HttpNetworkSession;
36 class HttpRequestHeaders;
36 class HttpStream; 37 class HttpStream;
37 38
38 class HttpNetworkTransaction : public HttpTransaction { 39 class HttpNetworkTransaction : public HttpTransaction {
39 public: 40 public:
40 explicit HttpNetworkTransaction(HttpNetworkSession* session); 41 explicit HttpNetworkTransaction(HttpNetworkSession* session);
41 42
42 virtual ~HttpNetworkTransaction(); 43 virtual ~HttpNetworkTransaction();
43 44
44 // Sets the next protocol negotiation value used during the SSL handshake. 45 // Sets the next protocol negotiation value used during the SSL handshake.
45 static void SetNextProtos(const std::string& next_protos); 46 static void SetNextProtos(const std::string& next_protos);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 208
208 // Resets the members of the transaction so it can be restarted. 209 // Resets the members of the transaction so it can be restarted.
209 void ResetStateForRestart(); 210 void ResetStateForRestart();
210 211
211 // Returns true if we should try to add a Proxy-Authorization header 212 // Returns true if we should try to add a Proxy-Authorization header
212 bool ShouldApplyProxyAuth() const; 213 bool ShouldApplyProxyAuth() const;
213 214
214 // Returns true if we should try to add an Authorization header. 215 // Returns true if we should try to add an Authorization header.
215 bool ShouldApplyServerAuth() const; 216 bool ShouldApplyServerAuth() const;
216 217
217 // Builds either the proxy auth header, or the origin server auth header, 218 // Adds either the proxy auth header, or the origin server auth header,
218 // as specified by |target|. 219 // as specified by |target|.
219 std::string BuildAuthorizationHeader(HttpAuth::Target target) const; 220 void AddAuthorizationHeader(
221 HttpAuth::Target target, HttpRequestHeaders* authorization_headers) const;
220 222
221 // Returns a log message for all the response headers related to the auth 223 // Returns a log message for all the response headers related to the auth
222 // challenge. 224 // challenge.
223 std::string AuthChallengeLogMessage() const; 225 std::string AuthChallengeLogMessage() const;
224 226
225 // Handles HTTP status code 401 or 407. 227 // Handles HTTP status code 401 or 407.
226 // HandleAuthChallenge() returns a network error code, or OK on success. 228 // HandleAuthChallenge() returns a network error code, or OK on success.
227 // May update |pending_auth_target_| or |response_.auth_challenge|. 229 // May update |pending_auth_target_| or |response_.auth_challenge|.
228 int HandleAuthChallenge(); 230 int HandleAuthChallenge();
229 231
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // The time the DoSSLConnect() method was called (if it got called). 356 // The time the DoSSLConnect() method was called (if it got called).
355 base::TimeTicks ssl_connect_start_time_; 357 base::TimeTicks ssl_connect_start_time_;
356 358
357 // The next state in the state machine. 359 // The next state in the state machine.
358 State next_state_; 360 State next_state_;
359 }; 361 };
360 362
361 } // namespace net 363 } // namespace net
362 364
363 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ 365 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698