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

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

Issue 138513002: Plumb network stack information about existence of cached copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to r248769. Created 6 years, 10 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/failing_http_transaction_factory.cc ('k') | net/http/http_cache.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 a HttpTransactionFactory implementation that can be 5 // This file declares a HttpTransactionFactory implementation that can be
6 // layered on top of another HttpTransactionFactory to add HTTP caching. The 6 // layered on top of another HttpTransactionFactory to add HTTP caching. The
7 // caching logic follows RFC 2616 (any exceptions are called out in the code). 7 // caching logic follows RFC 2616 (any exceptions are called out in the code).
8 // 8 //
9 // The HttpCache takes a disk_cache::Backend as a parameter, and uses that for 9 // The HttpCache takes a disk_cache::Backend as a parameter, and uses that for
10 // the cache storage. 10 // the cache storage.
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 // Initializes the Infinite Cache, if selected by the field trial. 189 // Initializes the Infinite Cache, if selected by the field trial.
190 void InitializeInfiniteCache(const base::FilePath& path); 190 void InitializeInfiniteCache(const base::FilePath& path);
191 191
192 // HttpTransactionFactory implementation: 192 // HttpTransactionFactory implementation:
193 virtual int CreateTransaction(RequestPriority priority, 193 virtual int CreateTransaction(RequestPriority priority,
194 scoped_ptr<HttpTransaction>* trans) OVERRIDE; 194 scoped_ptr<HttpTransaction>* trans) OVERRIDE;
195 virtual HttpCache* GetCache() OVERRIDE; 195 virtual HttpCache* GetCache() OVERRIDE;
196 virtual HttpNetworkSession* GetSession() OVERRIDE; 196 virtual HttpNetworkSession* GetSession() OVERRIDE;
197 197
198 // Resets the network layer to allow for tests that probe
199 // network changes (e.g. host unreachable). The old network layer is
200 // returned to allow for filter patterns that only intercept
201 // some creation requests. Note ownership exchange.
202 scoped_ptr<HttpTransactionFactory>
203 SetHttpNetworkTransactionFactoryForTesting(
204 scoped_ptr<HttpTransactionFactory> new_network_layer);
205
198 protected: 206 protected:
199 // Disk cache entry data indices. 207 // Disk cache entry data indices.
200 enum { 208 enum {
201 kResponseInfoIndex = 0, 209 kResponseInfoIndex = 0,
202 kResponseContentIndex, 210 kResponseContentIndex,
203 kMetadataIndex, 211 kMetadataIndex,
204 212
205 // Must remain at the end of the enum. 213 // Must remain at the end of the enum.
206 kNumCacheEntryDataIndices 214 kNumCacheEntryDataIndices
207 }; 215 };
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 NetLog* net_log_; 385 NetLog* net_log_;
378 386
379 // Used when lazily constructing the disk_cache_. 387 // Used when lazily constructing the disk_cache_.
380 scoped_ptr<BackendFactory> backend_factory_; 388 scoped_ptr<BackendFactory> backend_factory_;
381 bool building_backend_; 389 bool building_backend_;
382 390
383 Mode mode_; 391 Mode mode_;
384 392
385 const scoped_ptr<QuicServerInfoFactoryAdaptor> quic_server_info_factory_; 393 const scoped_ptr<QuicServerInfoFactoryAdaptor> quic_server_info_factory_;
386 394
387 const scoped_ptr<HttpTransactionFactory> network_layer_; 395 scoped_ptr<HttpTransactionFactory> network_layer_;
396
388 scoped_ptr<disk_cache::Backend> disk_cache_; 397 scoped_ptr<disk_cache::Backend> disk_cache_;
389 398
390 // The set of active entries indexed by cache key. 399 // The set of active entries indexed by cache key.
391 ActiveEntriesMap active_entries_; 400 ActiveEntriesMap active_entries_;
392 401
393 // The set of doomed entries. 402 // The set of doomed entries.
394 ActiveEntriesSet doomed_entries_; 403 ActiveEntriesSet doomed_entries_;
395 404
396 // The set of entries "under construction". 405 // The set of entries "under construction".
397 PendingOpsMap pending_ops_; 406 PendingOpsMap pending_ops_;
398 407
399 scoped_ptr<PlaybackCacheMap> playback_cache_map_; 408 scoped_ptr<PlaybackCacheMap> playback_cache_map_;
400 409
401 DISALLOW_COPY_AND_ASSIGN(HttpCache); 410 DISALLOW_COPY_AND_ASSIGN(HttpCache);
402 }; 411 };
403 412
404 } // namespace net 413 } // namespace net
405 414
406 #endif // NET_HTTP_HTTP_CACHE_H_ 415 #endif // NET_HTTP_HTTP_CACHE_H_
OLDNEW
« no previous file with comments | « net/http/failing_http_transaction_factory.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698