| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 11 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 15 #include "net/base/request_priority.h" | 17 #include "net/base/request_priority.h" |
| 16 #include "net/http/http_auth.h" | 18 #include "net/http/http_auth.h" |
| 17 #include "net/http/http_request_headers.h" | 19 #include "net/http/http_request_headers.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 int RestartWithAuth(const AuthCredentials& credentials, | 58 int RestartWithAuth(const AuthCredentials& credentials, |
| 57 const CompletionCallback& callback) override; | 59 const CompletionCallback& callback) override; |
| 58 bool IsReadyToRestartForAuth() override; | 60 bool IsReadyToRestartForAuth() override; |
| 59 | 61 |
| 60 int Read(IOBuffer* buf, | 62 int Read(IOBuffer* buf, |
| 61 int buf_len, | 63 int buf_len, |
| 62 const CompletionCallback& callback) override; | 64 const CompletionCallback& callback) override; |
| 63 void StopCaching() override; | 65 void StopCaching() override; |
| 64 bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override; | 66 bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override; |
| 65 int64 GetTotalReceivedBytes() const override; | 67 int64 GetTotalReceivedBytes() const override; |
| 68 int64_t GetTotalSentBytes() const override; |
| 66 void DoneReading() override; | 69 void DoneReading() override; |
| 67 const HttpResponseInfo* GetResponseInfo() const override; | 70 const HttpResponseInfo* GetResponseInfo() const override; |
| 68 LoadState GetLoadState() const override; | 71 LoadState GetLoadState() const override; |
| 69 UploadProgress GetUploadProgress() const override; | 72 UploadProgress GetUploadProgress() const override; |
| 70 void SetQuicServerInfo(QuicServerInfo* quic_server_info) override; | 73 void SetQuicServerInfo(QuicServerInfo* quic_server_info) override; |
| 71 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; | 74 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; |
| 72 void SetPriority(RequestPriority priority) override; | 75 void SetPriority(RequestPriority priority) override; |
| 73 void SetWebSocketHandshakeStreamCreateHelper( | 76 void SetWebSocketHandshakeStreamCreateHelper( |
| 74 WebSocketHandshakeStreamBase::CreateHelper* create_helper) override; | 77 WebSocketHandshakeStreamBase::CreateHelper* create_helper) override; |
| 75 void SetBeforeNetworkStartCallback( | 78 void SetBeforeNetworkStartCallback( |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 315 |
| 313 // The size in bytes of the buffer we use to drain the response body that | 316 // The size in bytes of the buffer we use to drain the response body that |
| 314 // we want to throw away. The response body is typically a small error | 317 // we want to throw away. The response body is typically a small error |
| 315 // page just a few hundred bytes long. | 318 // page just a few hundred bytes long. |
| 316 static const int kDrainBodyBufferSize = 1024; | 319 static const int kDrainBodyBufferSize = 1024; |
| 317 | 320 |
| 318 // User buffer and length passed to the Read method. | 321 // User buffer and length passed to the Read method. |
| 319 scoped_refptr<IOBuffer> read_buf_; | 322 scoped_refptr<IOBuffer> read_buf_; |
| 320 int read_buf_len_; | 323 int read_buf_len_; |
| 321 | 324 |
| 322 // Total number of bytes received on streams for this transaction. | 325 // Total number of bytes received on all destroyed HttpStreams for this |
| 326 // transaction. |
| 323 int64 total_received_bytes_; | 327 int64 total_received_bytes_; |
| 324 | 328 |
| 329 // Total number of bytes sent on all destroyed HttpStreams for this |
| 330 // transaction. |
| 331 int64_t total_sent_bytes_; |
| 332 |
| 325 // When the transaction started / finished sending the request, including | 333 // When the transaction started / finished sending the request, including |
| 326 // the body, if present. | 334 // the body, if present. |
| 327 base::TimeTicks send_start_time_; | 335 base::TimeTicks send_start_time_; |
| 328 base::TimeTicks send_end_time_; | 336 base::TimeTicks send_end_time_; |
| 329 | 337 |
| 330 // The next state in the state machine. | 338 // The next state in the state machine. |
| 331 State next_state_; | 339 State next_state_; |
| 332 | 340 |
| 333 // True when the tunnel is in the process of being established - we can't | 341 // True when the tunnel is in the process of being established - we can't |
| 334 // read from the socket until the tunnel is done. | 342 // read from the socket until the tunnel is done. |
| 335 bool establishing_tunnel_; | 343 bool establishing_tunnel_; |
| 336 | 344 |
| 337 // The helper object to use to create WebSocketHandshakeStreamBase | 345 // The helper object to use to create WebSocketHandshakeStreamBase |
| 338 // objects. Only relevant when establishing a WebSocket connection. | 346 // objects. Only relevant when establishing a WebSocket connection. |
| 339 WebSocketHandshakeStreamBase::CreateHelper* | 347 WebSocketHandshakeStreamBase::CreateHelper* |
| 340 websocket_handshake_stream_base_create_helper_; | 348 websocket_handshake_stream_base_create_helper_; |
| 341 | 349 |
| 342 BeforeNetworkStartCallback before_network_start_callback_; | 350 BeforeNetworkStartCallback before_network_start_callback_; |
| 343 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; | 351 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; |
| 344 | 352 |
| 345 ConnectionAttempts connection_attempts_; | 353 ConnectionAttempts connection_attempts_; |
| 346 | 354 |
| 347 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); | 355 DISALLOW_COPY_AND_ASSIGN(HttpNetworkTransaction); |
| 348 }; | 356 }; |
| 349 | 357 |
| 350 } // namespace net | 358 } // namespace net |
| 351 | 359 |
| 352 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 360 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| OLD | NEW |