| 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 #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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |