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_manager.h" | 5 #include "content/browser/cache_storage/cache_storage_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 const ServiceWorkerFetchRequest& request, | 277 const ServiceWorkerFetchRequest& request, |
278 int status_code, | 278 int status_code, |
279 const ServiceWorkerHeaderMap& response_headers = | 279 const ServiceWorkerHeaderMap& response_headers = |
280 ServiceWorkerHeaderMap()) { | 280 ServiceWorkerHeaderMap()) { |
281 std::unique_ptr<storage::BlobDataBuilder> blob_data( | 281 std::unique_ptr<storage::BlobDataBuilder> blob_data( |
282 new storage::BlobDataBuilder(base::GenerateGUID())); | 282 new storage::BlobDataBuilder(base::GenerateGUID())); |
283 blob_data->AppendData(request.url.spec()); | 283 blob_data->AppendData(request.url.spec()); |
284 | 284 |
285 std::unique_ptr<storage::BlobDataHandle> blob_handle = | 285 std::unique_ptr<storage::BlobDataHandle> blob_handle = |
286 blob_storage_context_->AddFinishedBlob(blob_data.get()); | 286 blob_storage_context_->AddFinishedBlob(blob_data.get()); |
| 287 std::unique_ptr<std::vector<GURL>> url_list = |
| 288 base::MakeUnique<std::vector<GURL>>(); |
| 289 url_list->push_back(request.url); |
287 ServiceWorkerResponse response( | 290 ServiceWorkerResponse response( |
288 request.url, status_code, "OK", | 291 std::move(url_list), status_code, "OK", |
289 blink::WebServiceWorkerResponseTypeDefault, response_headers, | 292 blink::WebServiceWorkerResponseTypeDefault, |
| 293 base::MakeUnique<ServiceWorkerHeaderMap>(response_headers), |
290 blob_handle->uuid(), request.url.spec().size(), GURL(), | 294 blob_handle->uuid(), request.url.spec().size(), GURL(), |
291 blink::WebServiceWorkerResponseErrorUnknown, base::Time(), | 295 blink::WebServiceWorkerResponseErrorUnknown, base::Time(), |
292 false /* is_in_cache_storage */, | 296 false /* is_in_cache_storage */, |
293 std::string() /* cache_storage_cache_name */, | 297 std::string() /* cache_storage_cache_name */, |
294 ServiceWorkerHeaderList() /* cors_exposed_header_names */); | 298 base::MakeUnique< |
| 299 ServiceWorkerHeaderList>() /* cors_exposed_header_names */); |
295 | 300 |
296 CacheStorageBatchOperation operation; | 301 CacheStorageBatchOperation operation; |
297 operation.operation_type = CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT; | 302 operation.operation_type = CACHE_STORAGE_CACHE_OPERATION_TYPE_PUT; |
298 operation.request = request; | 303 operation.request = request; |
299 operation.response = response; | 304 operation.response = response; |
300 | 305 |
301 base::RunLoop loop; | 306 base::RunLoop loop; |
302 cache->BatchOperation( | 307 cache->BatchOperation( |
303 std::vector<CacheStorageBatchOperation>(1, operation), | 308 std::vector<CacheStorageBatchOperation>(1, operation), |
304 base::Bind(&CacheStorageManagerTest::CachePutCallback, | 309 base::Bind(&CacheStorageManagerTest::CachePutCallback, |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 | 1242 |
1238 INSTANTIATE_TEST_CASE_P(CacheStorageManagerTests, | 1243 INSTANTIATE_TEST_CASE_P(CacheStorageManagerTests, |
1239 CacheStorageManagerTestP, | 1244 CacheStorageManagerTestP, |
1240 ::testing::Values(false, true)); | 1245 ::testing::Values(false, true)); |
1241 | 1246 |
1242 INSTANTIATE_TEST_CASE_P(CacheStorageQuotaClientTests, | 1247 INSTANTIATE_TEST_CASE_P(CacheStorageQuotaClientTests, |
1243 CacheStorageQuotaClientTestP, | 1248 CacheStorageQuotaClientTestP, |
1244 ::testing::Values(false, true)); | 1249 ::testing::Values(false, true)); |
1245 | 1250 |
1246 } // namespace content | 1251 } // namespace content |
OLD | NEW |