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