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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // Returns network error code. | 338 // Returns network error code. |
339 int RestartNetworkRequestWithAuth(const AuthCredentials& credentials); | 339 int RestartNetworkRequestWithAuth(const AuthCredentials& credentials); |
340 | 340 |
341 // Called to determine if we need to validate the cache entry before using it. | 341 // Called to determine if we need to validate the cache entry before using it. |
342 bool RequiresValidation(); | 342 bool RequiresValidation(); |
343 | 343 |
344 // Called to make the request conditional (to ask the server if the cached | 344 // Called to make the request conditional (to ask the server if the cached |
345 // copy is valid). Returns true if able to make the request conditional. | 345 // copy is valid). Returns true if able to make the request conditional. |
346 bool ConditionalizeRequest(); | 346 bool ConditionalizeRequest(); |
347 | 347 |
| 348 // Determins if saved response permits conditionalization, and extracts |
| 349 // etag/last-modified values. Only depends on response_.headers. |
| 350 bool ResponseConditionalizable(std::string* etag_value, |
| 351 std::string* last_modified_value); |
| 352 |
348 // Makes sure that a 206 response is expected. Returns true on success. | 353 // Makes sure that a 206 response is expected. Returns true on success. |
349 // On success, handling_206_ will be set to true if we are processing a | 354 // On success, handling_206_ will be set to true if we are processing a |
350 // partial entry. | 355 // partial entry. |
351 bool ValidatePartialResponse(); | 356 bool ValidatePartialResponse(); |
352 | 357 |
353 // Handles a response validation error by bypassing the cache. | 358 // Handles a response validation error by bypassing the cache. |
354 void IgnoreRangeRequest(); | 359 void IgnoreRangeRequest(); |
355 | 360 |
356 // Fixes the response headers to match expectations for a HEAD request. | 361 // Fixes the response headers to match expectations for a HEAD request. |
357 void FixHeadersForHead(); | 362 void FixHeadersForHead(); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 bool in_do_loop_; | 520 bool in_do_loop_; |
516 | 521 |
517 base::WeakPtrFactory<Transaction> weak_factory_; | 522 base::WeakPtrFactory<Transaction> weak_factory_; |
518 | 523 |
519 DISALLOW_COPY_AND_ASSIGN(Transaction); | 524 DISALLOW_COPY_AND_ASSIGN(Transaction); |
520 }; | 525 }; |
521 | 526 |
522 } // namespace net | 527 } // namespace net |
523 | 528 |
524 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ | 529 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ |
OLD | NEW |