| 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 // Returns the LoadState of the writer transaction of a given ActiveEntry. In | 112 // Returns the LoadState of the writer transaction of a given ActiveEntry. In |
| 113 // other words, returns the LoadState of this transaction without asking the | 113 // other words, returns the LoadState of this transaction without asking the |
| 114 // http cache, because this transaction should be the one currently writing | 114 // http cache, because this transaction should be the one currently writing |
| 115 // to the cache entry. | 115 // to the cache entry. |
| 116 LoadState GetWriterLoadState() const; | 116 LoadState GetWriterLoadState() const; |
| 117 | 117 |
| 118 const CompletionCallback& io_callback() { return io_callback_; } | 118 const CompletionCallback& io_callback() { return io_callback_; } |
| 119 | 119 |
| 120 const BoundNetLog& net_log() const; | 120 const BoundNetLog& net_log() const; |
| 121 | 121 |
| 122 // Bypasses the cache lock whenever there is lock contention. | |
| 123 void BypassLockForTest() { | |
| 124 bypass_lock_for_test_ = true; | |
| 125 } | |
| 126 | |
| 127 // Generates a failure when attempting to conditionalize a network request. | 122 // Generates a failure when attempting to conditionalize a network request. |
| 128 void FailConditionalizationForTest() { | 123 void FailConditionalizationForTest() { |
| 129 fail_conditionalization_for_test_ = true; | 124 fail_conditionalization_for_test_ = true; |
| 130 } | 125 } |
| 131 | 126 |
| 132 // HttpTransaction methods: | 127 // HttpTransaction methods: |
| 133 int Start(const HttpRequestInfo* request_info, | 128 int Start(const HttpRequestInfo* request_info, |
| 134 const CompletionCallback& callback, | 129 const CompletionCallback& callback, |
| 135 const BoundNetLog& net_log) override; | 130 const BoundNetLog& net_log) override; |
| 136 int RestartIgnoringLastError(const CompletionCallback& callback) override; | 131 int RestartIgnoringLastError(const CompletionCallback& callback) override; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 bool reading_; // We are already reading. Never reverts to false once set. | 446 bool reading_; // We are already reading. Never reverts to false once set. |
| 452 bool invalid_range_; // We may bypass the cache for this request. | 447 bool invalid_range_; // We may bypass the cache for this request. |
| 453 bool truncated_; // We don't have all the response data. | 448 bool truncated_; // We don't have all the response data. |
| 454 bool is_sparse_; // The data is stored in sparse byte ranges. | 449 bool is_sparse_; // The data is stored in sparse byte ranges. |
| 455 bool range_requested_; // The user requested a byte range. | 450 bool range_requested_; // The user requested a byte range. |
| 456 bool handling_206_; // We must deal with this 206 response. | 451 bool handling_206_; // We must deal with this 206 response. |
| 457 bool cache_pending_; // We are waiting for the HttpCache. | 452 bool cache_pending_; // We are waiting for the HttpCache. |
| 458 bool done_reading_; // All available data was read. | 453 bool done_reading_; // All available data was read. |
| 459 bool vary_mismatch_; // The request doesn't match the stored vary data. | 454 bool vary_mismatch_; // The request doesn't match the stored vary data. |
| 460 bool couldnt_conditionalize_request_; | 455 bool couldnt_conditionalize_request_; |
| 461 bool bypass_lock_for_test_; // A test is exercising the cache lock. | |
| 462 bool fail_conditionalization_for_test_; // Fail ConditionalizeRequest. | 456 bool fail_conditionalization_for_test_; // Fail ConditionalizeRequest. |
| 463 scoped_refptr<IOBuffer> read_buf_; | 457 scoped_refptr<IOBuffer> read_buf_; |
| 464 int io_buf_len_; | 458 int io_buf_len_; |
| 465 int read_offset_; | 459 int read_offset_; |
| 466 int effective_load_flags_; | 460 int effective_load_flags_; |
| 467 int write_len_; | 461 int write_len_; |
| 468 scoped_ptr<PartialData> partial_; // We are dealing with range requests. | 462 scoped_ptr<PartialData> partial_; // We are dealing with range requests. |
| 469 UploadProgress final_upload_progress_; | 463 UploadProgress final_upload_progress_; |
| 470 CompletionCallback io_callback_; | 464 CompletionCallback io_callback_; |
| 471 | 465 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 497 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; | 491 BeforeProxyHeadersSentCallback before_proxy_headers_sent_callback_; |
| 498 | 492 |
| 499 base::WeakPtrFactory<Transaction> weak_factory_; | 493 base::WeakPtrFactory<Transaction> weak_factory_; |
| 500 | 494 |
| 501 DISALLOW_COPY_AND_ASSIGN(Transaction); | 495 DISALLOW_COPY_AND_ASSIGN(Transaction); |
| 502 }; | 496 }; |
| 503 | 497 |
| 504 } // namespace net | 498 } // namespace net |
| 505 | 499 |
| 506 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 500 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
| OLD | NEW |