| Index: net/http/http_cache.cc
|
| ===================================================================
|
| --- net/http/http_cache.cc (revision 155282)
|
| +++ net/http/http_cache.cc (working copy)
|
| @@ -19,6 +19,7 @@
|
| #include "base/location.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/message_loop.h"
|
| +#include "base/metrics/field_trial.h"
|
| #include "base/pickle.h"
|
| #include "base/stl_util.h"
|
| #include "base/string_number_conversions.h"
|
| @@ -409,7 +410,7 @@
|
| CreateBackend(NULL, net::CompletionCallback());
|
| }
|
|
|
| - HttpCache::Transaction* trans = new HttpCache::Transaction(this, NULL);
|
| + HttpCache::Transaction* trans = new HttpCache::Transaction(this, NULL, NULL);
|
| MetadataWriter* writer = new MetadataWriter(trans);
|
|
|
| // The writer will self destruct when done.
|
| @@ -444,6 +445,13 @@
|
| disk_cache_->OnExternalCacheHit(key);
|
| }
|
|
|
| +void HttpCache::InitializeInfiniteCache(const FilePath& path) {
|
| + if (base::FieldTrialList::FindFullName("InfiniteCache") != "Yes")
|
| + return;
|
| + // To be enabled after everything is fully wired.
|
| + // infinite_cache_.Init(path);
|
| +}
|
| +
|
| int HttpCache::CreateTransaction(scoped_ptr<HttpTransaction>* trans,
|
| HttpTransactionDelegate* delegate) {
|
| // Do lazy initialization of disk cache if needed.
|
| @@ -452,7 +460,10 @@
|
| CreateBackend(NULL, net::CompletionCallback());
|
| }
|
|
|
| - trans->reset(new HttpCache::Transaction(this, delegate));
|
| + InfiniteCacheTransaction* infinite_cache_transaction =
|
| + infinite_cache_.CreateInfiniteCacheTransaction();
|
| + trans->reset(new HttpCache::Transaction(this, delegate,
|
| + infinite_cache_transaction));
|
| return OK;
|
| }
|
|
|
|
|