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/service_worker/service_worker_cache_storage_manager.h" | 5 #include "content/browser/service_worker/service_worker_cache_storage_manager.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 void StringsAndErrorCallback( | 88 void StringsAndErrorCallback( |
89 base::RunLoop* run_loop, | 89 base::RunLoop* run_loop, |
90 const std::vector<std::string>& strings, | 90 const std::vector<std::string>& strings, |
91 ServiceWorkerCacheStorage::CacheStorageError error) { | 91 ServiceWorkerCacheStorage::CacheStorageError error) { |
92 callback_strings_ = strings; | 92 callback_strings_ = strings; |
93 callback_error_ = error; | 93 callback_error_ = error; |
94 run_loop->Quit(); | 94 run_loop->Quit(); |
95 } | 95 } |
96 | 96 |
97 void CachePutCallback(base::RunLoop* run_loop, | 97 void CachePutCallback( |
98 ServiceWorkerCache::ErrorType error, | 98 base::RunLoop* run_loop, |
99 scoped_ptr<ServiceWorkerResponse> response, | 99 ServiceWorkerCache::ErrorType error, |
100 scoped_ptr<storage::BlobDataHandle> blob_data_handle) { | 100 scoped_ptr<ServiceWorkerResponse> response, |
| 101 scoped_ptr<storage::BlobDataSnapshotHandle> blob_data_handle) { |
101 callback_cache_error_ = error; | 102 callback_cache_error_ = error; |
102 run_loop->Quit(); | 103 run_loop->Quit(); |
103 } | 104 } |
104 | 105 |
105 void CacheMatchCallback( | 106 void CacheMatchCallback( |
106 base::RunLoop* run_loop, | 107 base::RunLoop* run_loop, |
107 ServiceWorkerCache::ErrorType error, | 108 ServiceWorkerCache::ErrorType error, |
108 scoped_ptr<ServiceWorkerResponse> response, | 109 scoped_ptr<ServiceWorkerResponse> response, |
109 scoped_ptr<storage::BlobDataHandle> blob_data_handle) { | 110 scoped_ptr<storage::BlobDataSnapshotHandle> blob_data_handle) { |
110 callback_cache_error_ = error; | 111 callback_cache_error_ = error; |
111 callback_cache_response_ = response.Pass(); | 112 callback_cache_response_ = response.Pass(); |
112 // Deliberately drop the data handle as only the url is being tested. | 113 // Deliberately drop the data handle as only the url is being tested. |
113 run_loop->Quit(); | 114 run_loop->Quit(); |
114 } | 115 } |
115 | 116 |
116 bool Open(const GURL& origin, const std::string& cache_name) { | 117 bool Open(const GURL& origin, const std::string& cache_name) { |
117 scoped_ptr<base::RunLoop> loop(new base::RunLoop()); | 118 scoped_ptr<base::RunLoop> loop(new base::RunLoop()); |
118 cache_manager_->OpenCache( | 119 cache_manager_->OpenCache( |
119 origin, | 120 origin, |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 | 729 |
729 INSTANTIATE_TEST_CASE_P(ServiceWorkerCacheStorageManagerTests, | 730 INSTANTIATE_TEST_CASE_P(ServiceWorkerCacheStorageManagerTests, |
730 ServiceWorkerCacheStorageManagerTestP, | 731 ServiceWorkerCacheStorageManagerTestP, |
731 ::testing::Values(false, true)); | 732 ::testing::Values(false, true)); |
732 | 733 |
733 INSTANTIATE_TEST_CASE_P(ServiceWorkerCacheQuotaClientTests, | 734 INSTANTIATE_TEST_CASE_P(ServiceWorkerCacheQuotaClientTests, |
734 ServiceWorkerCacheQuotaClientTestP, | 735 ServiceWorkerCacheQuotaClientTestP, |
735 ::testing::Values(false, true)); | 736 ::testing::Values(false, true)); |
736 | 737 |
737 } // namespace content | 738 } // namespace content |
OLD | NEW |