| 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 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 virtual int RestartWithAuth(const AuthCredentials& credentials, | 112 virtual int RestartWithAuth(const AuthCredentials& credentials, |
| 113 const CompletionCallback& callback) OVERRIDE; | 113 const CompletionCallback& callback) OVERRIDE; |
| 114 virtual bool IsReadyToRestartForAuth() OVERRIDE; | 114 virtual bool IsReadyToRestartForAuth() OVERRIDE; |
| 115 virtual int Read(IOBuffer* buf, | 115 virtual int Read(IOBuffer* buf, |
| 116 int buf_len, | 116 int buf_len, |
| 117 const CompletionCallback& callback) OVERRIDE; | 117 const CompletionCallback& callback) OVERRIDE; |
| 118 virtual void StopCaching() OVERRIDE; | 118 virtual void StopCaching() OVERRIDE; |
| 119 virtual void DoneReading() OVERRIDE; | 119 virtual void DoneReading() OVERRIDE; |
| 120 virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE; | 120 virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE; |
| 121 virtual LoadState GetLoadState() const OVERRIDE; | 121 virtual LoadState GetLoadState() const OVERRIDE; |
| 122 virtual uint64 GetUploadProgress(void) const OVERRIDE; | 122 virtual UploadProgress GetUploadProgress(void) const OVERRIDE; |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 static const size_t kNumValidationHeaders = 2; | 125 static const size_t kNumValidationHeaders = 2; |
| 126 // Helper struct to pair a header name with its value, for | 126 // Helper struct to pair a header name with its value, for |
| 127 // headers used to validate cache entries. | 127 // headers used to validate cache entries. |
| 128 struct ValidationHeaders { | 128 struct ValidationHeaders { |
| 129 ValidationHeaders() : initialized(false) {} | 129 ValidationHeaders() : initialized(false) {} |
| 130 | 130 |
| 131 std::string values[kNumValidationHeaders]; | 131 std::string values[kNumValidationHeaders]; |
| 132 bool initialized; | 132 bool initialized; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 bool range_requested_; // The user requested a byte range. | 384 bool range_requested_; // The user requested a byte range. |
| 385 bool handling_206_; // We must deal with this 206 response. | 385 bool handling_206_; // We must deal with this 206 response. |
| 386 bool cache_pending_; // We are waiting for the HttpCache. | 386 bool cache_pending_; // We are waiting for the HttpCache. |
| 387 bool done_reading_; | 387 bool done_reading_; |
| 388 scoped_refptr<IOBuffer> read_buf_; | 388 scoped_refptr<IOBuffer> read_buf_; |
| 389 int io_buf_len_; | 389 int io_buf_len_; |
| 390 int read_offset_; | 390 int read_offset_; |
| 391 int effective_load_flags_; | 391 int effective_load_flags_; |
| 392 int write_len_; | 392 int write_len_; |
| 393 scoped_ptr<PartialData> partial_; // We are dealing with range requests. | 393 scoped_ptr<PartialData> partial_; // We are dealing with range requests. |
| 394 uint64 final_upload_progress_; | 394 UploadProgress final_upload_progress_; |
| 395 base::WeakPtrFactory<Transaction> weak_factory_; | 395 base::WeakPtrFactory<Transaction> weak_factory_; |
| 396 CompletionCallback io_callback_; | 396 CompletionCallback io_callback_; |
| 397 | 397 |
| 398 // Members used to track data for histograms. | 398 // Members used to track data for histograms. |
| 399 TransactionPattern transaction_pattern_; | 399 TransactionPattern transaction_pattern_; |
| 400 int bytes_read_from_cache_; | 400 int bytes_read_from_cache_; |
| 401 int bytes_read_from_network_; | 401 int bytes_read_from_network_; |
| 402 base::TimeTicks entry_lock_waiting_since_; | 402 base::TimeTicks entry_lock_waiting_since_; |
| 403 base::TimeTicks first_cache_access_since_; | 403 base::TimeTicks first_cache_access_since_; |
| 404 base::TimeTicks send_request_since_; | 404 base::TimeTicks send_request_since_; |
| 405 | 405 |
| 406 HttpTransactionDelegate* transaction_delegate_; | 406 HttpTransactionDelegate* transaction_delegate_; |
| 407 }; | 407 }; |
| 408 | 408 |
| 409 } // namespace net | 409 } // namespace net |
| 410 | 410 |
| 411 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 411 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
| OLD | NEW |