| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 50   enum Mode { | 50   enum Mode { | 
| 51     NONE            = 0, | 51     NONE            = 0, | 
| 52     READ_META       = 1 << 0, | 52     READ_META       = 1 << 0, | 
| 53     READ_DATA       = 1 << 1, | 53     READ_DATA       = 1 << 1, | 
| 54     READ            = READ_META | READ_DATA, | 54     READ            = READ_META | READ_DATA, | 
| 55     WRITE           = 1 << 2, | 55     WRITE           = 1 << 2, | 
| 56     READ_WRITE      = READ | WRITE, | 56     READ_WRITE      = READ | WRITE, | 
| 57     UPDATE          = READ_META | WRITE,  // READ_WRITE & ~READ_DATA | 57     UPDATE          = READ_META | WRITE,  // READ_WRITE & ~READ_DATA | 
| 58   }; | 58   }; | 
| 59 | 59 | 
| 60   Transaction(HttpCache* cache, HttpTransactionDelegate* transaction_delegate); | 60   Transaction(HttpCache* cache, | 
|  | 61               HttpTransactionDelegate* transaction_delegate, | 
|  | 62               InfiniteCacheTransaction* infinite_cache_transaction); | 
| 61   virtual ~Transaction(); | 63   virtual ~Transaction(); | 
| 62 | 64 | 
| 63   Mode mode() const { return mode_; } | 65   Mode mode() const { return mode_; } | 
| 64 | 66 | 
| 65   const std::string& key() const { return cache_key_; } | 67   const std::string& key() const { return cache_key_; } | 
| 66 | 68 | 
| 67   // Writes |buf_len| bytes of meta-data from the provided buffer |buf|. to the | 69   // Writes |buf_len| bytes of meta-data from the provided buffer |buf|. to the | 
| 68   // HTTP cache entry that backs this transaction (if any). | 70   // HTTP cache entry that backs this transaction (if any). | 
| 69   // Returns the number of bytes actually written, or a net error code. If the | 71   // Returns the number of bytes actually written, or a net error code. If the | 
| 70   // operation cannot complete immediately, returns ERR_IO_PENDING, grabs a | 72   // operation cannot complete immediately, returns ERR_IO_PENDING, grabs a | 
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 365   BoundNetLog net_log_; | 367   BoundNetLog net_log_; | 
| 366   scoped_ptr<HttpRequestInfo> custom_request_; | 368   scoped_ptr<HttpRequestInfo> custom_request_; | 
| 367   HttpRequestHeaders request_headers_copy_; | 369   HttpRequestHeaders request_headers_copy_; | 
| 368   // If extra_headers specified a "if-modified-since" or "if-none-match", | 370   // If extra_headers specified a "if-modified-since" or "if-none-match", | 
| 369   // |external_validation_| contains the value of those headers. | 371   // |external_validation_| contains the value of those headers. | 
| 370   ValidationHeaders external_validation_; | 372   ValidationHeaders external_validation_; | 
| 371   base::WeakPtr<HttpCache> cache_; | 373   base::WeakPtr<HttpCache> cache_; | 
| 372   HttpCache::ActiveEntry* entry_; | 374   HttpCache::ActiveEntry* entry_; | 
| 373   HttpCache::ActiveEntry* new_entry_; | 375   HttpCache::ActiveEntry* new_entry_; | 
| 374   scoped_ptr<HttpTransaction> network_trans_; | 376   scoped_ptr<HttpTransaction> network_trans_; | 
|  | 377   scoped_ptr<InfiniteCacheTransaction> infinite_cache_transaction_; | 
| 375   CompletionCallback callback_;  // Consumer's callback. | 378   CompletionCallback callback_;  // Consumer's callback. | 
| 376   HttpResponseInfo response_; | 379   HttpResponseInfo response_; | 
| 377   HttpResponseInfo auth_response_; | 380   HttpResponseInfo auth_response_; | 
| 378   const HttpResponseInfo* new_response_; | 381   const HttpResponseInfo* new_response_; | 
| 379   std::string cache_key_; | 382   std::string cache_key_; | 
| 380   Mode mode_; | 383   Mode mode_; | 
| 381   State target_state_; | 384   State target_state_; | 
| 382   bool reading_;  // We are already reading. | 385   bool reading_;  // We are already reading. | 
| 383   bool invalid_range_;  // We may bypass the cache for this request. | 386   bool invalid_range_;  // We may bypass the cache for this request. | 
| 384   bool truncated_;  // We don't have all the response data. | 387   bool truncated_;  // We don't have all the response data. | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
| 404   base::TimeTicks entry_lock_waiting_since_; | 407   base::TimeTicks entry_lock_waiting_since_; | 
| 405   base::TimeTicks first_cache_access_since_; | 408   base::TimeTicks first_cache_access_since_; | 
| 406   base::TimeTicks send_request_since_; | 409   base::TimeTicks send_request_since_; | 
| 407 | 410 | 
| 408   HttpTransactionDelegate* transaction_delegate_; | 411   HttpTransactionDelegate* transaction_delegate_; | 
| 409 }; | 412 }; | 
| 410 | 413 | 
| 411 }  // namespace net | 414 }  // namespace net | 
| 412 | 415 | 
| 413 #endif  // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 416 #endif  // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 
| OLD | NEW | 
|---|