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

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

Issue 10914300: net: Enable the infinite cache simulation. (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 | « no previous file | no next file » | 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 #include "net/http/http_cache.h" 5 #include "net/http/http_cache.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 10
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 request_info.url = url; 384 request_info.url = url;
385 request_info.method = http_method; 385 request_info.method = http_method;
386 std::string key = GenerateCacheKey(&request_info); 386 std::string key = GenerateCacheKey(&request_info);
387 disk_cache_->OnExternalCacheHit(key); 387 disk_cache_->OnExternalCacheHit(key);
388 } 388 }
389 389
390 void HttpCache::InitializeInfiniteCache(const FilePath& path) { 390 void HttpCache::InitializeInfiniteCache(const FilePath& path) {
391 if (base::FieldTrialList::FindFullName("InfiniteCache") != "Yes") 391 if (base::FieldTrialList::FindFullName("InfiniteCache") != "Yes")
392 return; 392 return;
393 // To be enabled after everything is fully wired. 393 // To be enabled after everything is fully wired.
394 // infinite_cache_.Init(path); 394 infinite_cache_.Init(path);
395 } 395 }
396 396
397 int HttpCache::CreateTransaction(scoped_ptr<HttpTransaction>* trans, 397 int HttpCache::CreateTransaction(scoped_ptr<HttpTransaction>* trans,
398 HttpTransactionDelegate* delegate) { 398 HttpTransactionDelegate* delegate) {
399 // Do lazy initialization of disk cache if needed. 399 // Do lazy initialization of disk cache if needed.
400 if (!disk_cache_.get()) { 400 if (!disk_cache_.get()) {
401 // We don't care about the result. 401 // We don't care about the result.
402 CreateBackend(NULL, net::CompletionCallback()); 402 CreateBackend(NULL, net::CompletionCallback());
403 } 403 }
404 404
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 building_backend_ = false; 1100 building_backend_ = false;
1101 DeletePendingOp(pending_op); 1101 DeletePendingOp(pending_op);
1102 } 1102 }
1103 1103
1104 // The cache may be gone when we return from the callback. 1104 // The cache may be gone when we return from the callback.
1105 if (!item->DoCallback(result, backend)) 1105 if (!item->DoCallback(result, backend))
1106 item->NotifyTransaction(result, NULL); 1106 item->NotifyTransaction(result, NULL);
1107 } 1107 }
1108 1108
1109 } // namespace net 1109 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698