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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 base::Bind(&CacheStorage::MatchAllCachesDidMatchAll, | 885 base::Bind(&CacheStorage::MatchAllCachesDidMatchAll, |
886 weak_factory_.GetWeakPtr(), | 886 weak_factory_.GetWeakPtr(), |
887 base::Passed(base::WrapUnique(match_responses)), callback)); | 887 base::Passed(base::WrapUnique(match_responses)), callback)); |
888 | 888 |
889 for (size_t i = 0, max = ordered_cache_names_.size(); i < max; ++i) { | 889 for (size_t i = 0, max = ordered_cache_names_.size(); i < max; ++i) { |
890 std::unique_ptr<CacheStorageCacheHandle> cache_handle = | 890 std::unique_ptr<CacheStorageCacheHandle> cache_handle = |
891 GetLoadedCache(ordered_cache_names_[i]); | 891 GetLoadedCache(ordered_cache_names_[i]); |
892 DCHECK(cache_handle); | 892 DCHECK(cache_handle); |
893 | 893 |
894 CacheStorageCache* cache_ptr = cache_handle->value(); | 894 CacheStorageCache* cache_ptr = cache_handle->value(); |
895 cache_ptr->Match(base::WrapUnique(new ServiceWorkerFetchRequest(*request)), | 895 cache_ptr->Match(base::MakeUnique<ServiceWorkerFetchRequest>(*request), |
896 match_params, | 896 match_params, |
897 base::Bind(&CacheStorage::MatchAllCachesDidMatch, | 897 base::Bind(&CacheStorage::MatchAllCachesDidMatch, |
898 weak_factory_.GetWeakPtr(), | 898 weak_factory_.GetWeakPtr(), |
899 base::Passed(std::move(cache_handle)), | 899 base::Passed(std::move(cache_handle)), |
900 &match_responses->at(i), barrier_closure)); | 900 &match_responses->at(i), barrier_closure)); |
901 } | 901 } |
902 } | 902 } |
903 | 903 |
904 void CacheStorage::MatchAllCachesDidMatch( | 904 void CacheStorage::MatchAllCachesDidMatch( |
905 std::unique_ptr<CacheStorageCacheHandle> cache_handle, | 905 std::unique_ptr<CacheStorageCacheHandle> cache_handle, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 std::unique_ptr<CacheStorageCacheHandle> cache_handle = | 1034 std::unique_ptr<CacheStorageCacheHandle> cache_handle = |
1035 GetLoadedCache(cache_name); | 1035 GetLoadedCache(cache_name); |
1036 CacheStorageCache* cache = cache_handle->value(); | 1036 CacheStorageCache* cache = cache_handle->value(); |
1037 cache->Size(base::Bind(&SizeRetrievedFromCache, | 1037 cache->Size(base::Bind(&SizeRetrievedFromCache, |
1038 base::Passed(std::move(cache_handle)), | 1038 base::Passed(std::move(cache_handle)), |
1039 barrier_closure, accumulator_ptr)); | 1039 barrier_closure, accumulator_ptr)); |
1040 } | 1040 } |
1041 } | 1041 } |
1042 | 1042 |
1043 } // namespace content | 1043 } // namespace content |
OLD | NEW |