| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 int RestartNetworkRequestWithAuth(const std::wstring& username, | 149 int RestartNetworkRequestWithAuth(const std::wstring& username, |
| 150 const std::wstring& password); | 150 const std::wstring& password); |
| 151 | 151 |
| 152 // Called to determine if we need to validate the cache entry before using it. | 152 // Called to determine if we need to validate the cache entry before using it. |
| 153 bool RequiresValidation(); | 153 bool RequiresValidation(); |
| 154 | 154 |
| 155 // Called to make the request conditional (to ask the server if the cached | 155 // Called to make the request conditional (to ask the server if the cached |
| 156 // copy is valid). Returns true if able to make the request conditional. | 156 // copy is valid). Returns true if able to make the request conditional. |
| 157 bool ConditionalizeRequest(); | 157 bool ConditionalizeRequest(); |
| 158 | 158 |
| 159 // Makes sure that a 206 response is expected. Returns a network error code. | 159 // Makes sure that a 206 response is expected. Returns true on success. |
| 160 bool ValidatePartialResponse(const HttpResponseHeaders* headers); | 160 // On success, |partial_content| will be set to true if we are processing a |
| 161 // partial entry. |
| 162 bool ValidatePartialResponse(const HttpResponseHeaders* headers, |
| 163 bool* partial_content); |
| 161 | 164 |
| 162 // Handles a response validation error by bypassing the cache. | 165 // Handles a response validation error by bypassing the cache. |
| 163 void IgnoreRangeRequest(); | 166 void IgnoreRangeRequest(); |
| 164 | 167 |
| 165 // Reads data from the network. | 168 // Reads data from the network. |
| 166 int ReadFromNetwork(IOBuffer* data, int data_len); | 169 int ReadFromNetwork(IOBuffer* data, int data_len); |
| 167 | 170 |
| 168 // Reads data from the cache entry. | 171 // Reads data from the cache entry. |
| 169 int ReadFromEntry(IOBuffer* data, int data_len); | 172 int ReadFromEntry(IOBuffer* data, int data_len); |
| 170 | 173 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 cache_read_callback_; | 261 cache_read_callback_; |
| 259 scoped_refptr<CancelableCompletionCallback<Transaction> > | 262 scoped_refptr<CancelableCompletionCallback<Transaction> > |
| 260 cache_write_callback_; | 263 cache_write_callback_; |
| 261 scoped_refptr<CancelableCompletionCallback<Transaction> > | 264 scoped_refptr<CancelableCompletionCallback<Transaction> > |
| 262 entry_ready_callback_; | 265 entry_ready_callback_; |
| 263 }; | 266 }; |
| 264 | 267 |
| 265 } // namespace net | 268 } // namespace net |
| 266 | 269 |
| 267 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 270 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
| OLD | NEW |