Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: net/http/http_cache_transaction.h

Issue 10907241: Revert 156846 - Http Cache: Add code for simulating an infinite HTTP cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_cache.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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, 60 Transaction(HttpCache* cache, HttpTransactionDelegate* transaction_delegate);
61 HttpTransactionDelegate* transaction_delegate,
62 InfiniteCacheTransaction* infinite_cache_transaction);
63 virtual ~Transaction(); 61 virtual ~Transaction();
64 62
65 Mode mode() const { return mode_; } 63 Mode mode() const { return mode_; }
66 64
67 const std::string& key() const { return cache_key_; } 65 const std::string& key() const { return cache_key_; }
68 66
69 // Writes |buf_len| bytes of meta-data from the provided buffer |buf|. to the 67 // Writes |buf_len| bytes of meta-data from the provided buffer |buf|. to the
70 // HTTP cache entry that backs this transaction (if any). 68 // HTTP cache entry that backs this transaction (if any).
71 // Returns the number of bytes actually written, or a net error code. If the 69 // Returns the number of bytes actually written, or a net error code. If the
72 // operation cannot complete immediately, returns ERR_IO_PENDING, grabs a 70 // operation cannot complete immediately, returns ERR_IO_PENDING, grabs a
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 BoundNetLog net_log_; 365 BoundNetLog net_log_;
368 scoped_ptr<HttpRequestInfo> custom_request_; 366 scoped_ptr<HttpRequestInfo> custom_request_;
369 HttpRequestHeaders request_headers_copy_; 367 HttpRequestHeaders request_headers_copy_;
370 // If extra_headers specified a "if-modified-since" or "if-none-match", 368 // If extra_headers specified a "if-modified-since" or "if-none-match",
371 // |external_validation_| contains the value of those headers. 369 // |external_validation_| contains the value of those headers.
372 ValidationHeaders external_validation_; 370 ValidationHeaders external_validation_;
373 base::WeakPtr<HttpCache> cache_; 371 base::WeakPtr<HttpCache> cache_;
374 HttpCache::ActiveEntry* entry_; 372 HttpCache::ActiveEntry* entry_;
375 HttpCache::ActiveEntry* new_entry_; 373 HttpCache::ActiveEntry* new_entry_;
376 scoped_ptr<HttpTransaction> network_trans_; 374 scoped_ptr<HttpTransaction> network_trans_;
377 scoped_ptr<InfiniteCacheTransaction> infinite_cache_transaction_;
378 CompletionCallback callback_; // Consumer's callback. 375 CompletionCallback callback_; // Consumer's callback.
379 HttpResponseInfo response_; 376 HttpResponseInfo response_;
380 HttpResponseInfo auth_response_; 377 HttpResponseInfo auth_response_;
381 const HttpResponseInfo* new_response_; 378 const HttpResponseInfo* new_response_;
382 std::string cache_key_; 379 std::string cache_key_;
383 Mode mode_; 380 Mode mode_;
384 State target_state_; 381 State target_state_;
385 bool reading_; // We are already reading. 382 bool reading_; // We are already reading.
386 bool invalid_range_; // We may bypass the cache for this request. 383 bool invalid_range_; // We may bypass the cache for this request.
387 bool truncated_; // We don't have all the response data. 384 bool truncated_; // We don't have all the response data.
(...skipping 19 matching lines...) Expand all
407 base::TimeTicks entry_lock_waiting_since_; 404 base::TimeTicks entry_lock_waiting_since_;
408 base::TimeTicks first_cache_access_since_; 405 base::TimeTicks first_cache_access_since_;
409 base::TimeTicks send_request_since_; 406 base::TimeTicks send_request_since_;
410 407
411 HttpTransactionDelegate* transaction_delegate_; 408 HttpTransactionDelegate* transaction_delegate_;
412 }; 409 };
413 410
414 } // namespace net 411 } // namespace net
415 412
416 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_ 413 #endif // NET_HTTP_HTTP_CACHE_TRANSACTION_H_
OLDNEW
« no previous file with comments | « net/http/http_cache.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698