| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/cache_storage/cache_storage.h" | 5 #include "content/browser/cache_storage/cache_storage.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 base::SequencedTaskRunner* cache_task_runner, | 463 base::SequencedTaskRunner* cache_task_runner, |
| 464 scoped_refptr<net::URLRequestContextGetter> request_context, | 464 scoped_refptr<net::URLRequestContextGetter> request_context, |
| 465 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, | 465 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, |
| 466 base::WeakPtr<storage::BlobStorageContext> blob_context, | 466 base::WeakPtr<storage::BlobStorageContext> blob_context, |
| 467 const GURL& origin) | 467 const GURL& origin) |
| 468 : initialized_(false), | 468 : initialized_(false), |
| 469 initializing_(false), | 469 initializing_(false), |
| 470 scheduler_(new CacheStorageScheduler()), | 470 scheduler_(new CacheStorageScheduler()), |
| 471 origin_path_(path), | 471 origin_path_(path), |
| 472 cache_task_runner_(cache_task_runner), | 472 cache_task_runner_(cache_task_runner), |
| 473 memory_only_(memory_only), | |
| 474 quota_manager_proxy_(quota_manager_proxy), | 473 quota_manager_proxy_(quota_manager_proxy), |
| 475 origin_(origin), | 474 origin_(origin), |
| 476 weak_factory_(this) { | 475 weak_factory_(this) { |
| 477 if (memory_only) | 476 if (memory_only) |
| 478 cache_loader_.reset( | 477 cache_loader_.reset( |
| 479 new MemoryLoader(cache_task_runner_.get(), std::move(request_context), | 478 new MemoryLoader(cache_task_runner_.get(), std::move(request_context), |
| 480 quota_manager_proxy.get(), blob_context, origin)); | 479 quota_manager_proxy.get(), blob_context, origin)); |
| 481 else | 480 else |
| 482 cache_loader_.reset(new SimpleCacheLoader( | 481 cache_loader_.reset(new SimpleCacheLoader( |
| 483 origin_path_, cache_task_runner_.get(), std::move(request_context), | 482 origin_path_, cache_task_runner_.get(), std::move(request_context), |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 void CacheStorage::PendingSizeCallback(const SizeCallback& callback, | 1032 void CacheStorage::PendingSizeCallback(const SizeCallback& callback, |
| 1034 int64_t size) { | 1033 int64_t size) { |
| 1035 base::WeakPtr<CacheStorage> cache_storage = weak_factory_.GetWeakPtr(); | 1034 base::WeakPtr<CacheStorage> cache_storage = weak_factory_.GetWeakPtr(); |
| 1036 | 1035 |
| 1037 callback.Run(size); | 1036 callback.Run(size); |
| 1038 if (cache_storage) | 1037 if (cache_storage) |
| 1039 scheduler_->CompleteOperationAndRunNext(); | 1038 scheduler_->CompleteOperationAndRunNext(); |
| 1040 } | 1039 } |
| 1041 | 1040 |
| 1042 } // namespace content | 1041 } // namespace content |
| OLD | NEW |