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 // This file declares HttpCache::Transaction, a private class of HttpCache so | 5 // This file declares HttpCache::Transaction, a private class of HttpCache so |
6 // it should only be included by http_cache.cc | 6 // it should only be included by http_cache.cc |
7 | 7 |
8 #ifndef NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 8 #ifndef NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
9 #define NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 9 #define NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
10 | 10 |
11 #include <stddef.h> | 11 #include <stddef.h> |
| 12 #include <stdint.h> |
12 | 13 |
13 #include <string> | 14 #include <string> |
14 | 15 |
15 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
19 #include "base/time/time.h" | 20 #include "base/time/time.h" |
20 #include "net/base/completion_callback.h" | 21 #include "net/base/completion_callback.h" |
21 #include "net/base/io_buffer.h" | 22 #include "net/base/io_buffer.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 const CompletionCallback& callback) override; | 136 const CompletionCallback& callback) override; |
136 int RestartWithAuth(const AuthCredentials& credentials, | 137 int RestartWithAuth(const AuthCredentials& credentials, |
137 const CompletionCallback& callback) override; | 138 const CompletionCallback& callback) override; |
138 bool IsReadyToRestartForAuth() override; | 139 bool IsReadyToRestartForAuth() override; |
139 int Read(IOBuffer* buf, | 140 int Read(IOBuffer* buf, |
140 int buf_len, | 141 int buf_len, |
141 const CompletionCallback& callback) override; | 142 const CompletionCallback& callback) override; |
142 void StopCaching() override; | 143 void StopCaching() override; |
143 bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override; | 144 bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override; |
144 int64 GetTotalReceivedBytes() const override; | 145 int64 GetTotalReceivedBytes() const override; |
| 146 int64_t GetTotalSentBytes() const override; |
145 void DoneReading() override; | 147 void DoneReading() override; |
146 const HttpResponseInfo* GetResponseInfo() const override; | 148 const HttpResponseInfo* GetResponseInfo() const override; |
147 LoadState GetLoadState() const override; | 149 LoadState GetLoadState() const override; |
148 UploadProgress GetUploadProgress(void) const override; | 150 UploadProgress GetUploadProgress(void) const override; |
149 void SetQuicServerInfo(QuicServerInfo* quic_server_info) override; | 151 void SetQuicServerInfo(QuicServerInfo* quic_server_info) override; |
150 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; | 152 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; |
151 void SetPriority(RequestPriority priority) override; | 153 void SetPriority(RequestPriority priority) override; |
152 void SetWebSocketHandshakeStreamCreateHelper( | 154 void SetWebSocketHandshakeStreamCreateHelper( |
153 WebSocketHandshakeStreamBase::CreateHelper* create_helper) override; | 155 WebSocketHandshakeStreamBase::CreateHelper* create_helper) override; |
154 void SetBeforeNetworkStartCallback( | 156 void SetBeforeNetworkStartCallback( |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 UploadProgress final_upload_progress_; | 464 UploadProgress final_upload_progress_; |
463 CompletionCallback io_callback_; | 465 CompletionCallback io_callback_; |
464 | 466 |
465 // Members used to track data for histograms. | 467 // Members used to track data for histograms. |
466 TransactionPattern transaction_pattern_; | 468 TransactionPattern transaction_pattern_; |
467 base::TimeTicks entry_lock_waiting_since_; | 469 base::TimeTicks entry_lock_waiting_since_; |
468 base::TimeTicks first_cache_access_since_; | 470 base::TimeTicks first_cache_access_since_; |
469 base::TimeTicks send_request_since_; | 471 base::TimeTicks send_request_since_; |
470 | 472 |
471 int64 total_received_bytes_; | 473 int64 total_received_bytes_; |
| 474 int64_t total_sent_bytes_; |
472 | 475 |
473 // Load timing information for the last network request, if any. Set in the | 476 // Load timing information for the last network request, if any. Set in the |
474 // 304 and 206 response cases, as the network transaction may be destroyed | 477 // 304 and 206 response cases, as the network transaction may be destroyed |
475 // before the caller requests load timing information. | 478 // before the caller requests load timing information. |
476 scoped_ptr<LoadTimingInfo> old_network_trans_load_timing_; | 479 scoped_ptr<LoadTimingInfo> old_network_trans_load_timing_; |
477 | 480 |
478 ConnectionAttempts old_connection_attempts_; | 481 ConnectionAttempts old_connection_attempts_; |
479 | 482 |
480 // The helper object to use to create WebSocketHandshakeStreamBase | 483 // The helper object to use to create WebSocketHandshakeStreamBase |
481 // objects. Only relevant when establishing a WebSocket connection. | 484 // objects. Only relevant when establishing a WebSocket connection. |
482 // This is passed to the underlying network transaction. It is stored here in | 485 // This is passed to the underlying network transaction. It is stored here in |
483 // case the transaction does not exist yet. | 486 // case the transaction does not exist yet. |
484 WebSocketHandshakeStreamBase::CreateHelper* | 487 WebSocketHandshakeStreamBase::CreateHelper* |
485 websocket_handshake_stream_base_create_helper_; | 488 websocket_handshake_stream_base_create_helper_; |
486 | 489 |
487 BeforeNetworkStartCallback before_network_start_callback_; | 490 BeforeNetworkStartCallback before_network_start_callback_; |
488 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; | 491 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; |
489 | 492 |
490 base::WeakPtrFactory<Transaction> weak_factory_; | 493 base::WeakPtrFactory<Transaction> weak_factory_; |
491 | 494 |
492 DISALLOW_COPY_AND_ASSIGN(Transaction); | 495 DISALLOW_COPY_AND_ASSIGN(Transaction); |
493 }; | 496 }; |
494 | 497 |
495 } // namespace net | 498 } // namespace net |
496 | 499 |
497 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 500 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
OLD | NEW |