OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_dispatcher_host.h" | 5 #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 scoped_ptr<CacheStorageCache::Responses> responses( | 426 scoped_ptr<CacheStorageCache::Responses> responses( |
427 new CacheStorageCache::Responses); | 427 new CacheStorageCache::Responses); |
428 scoped_ptr<CacheStorageCache::BlobDataHandles> blob_data_handles( | 428 scoped_ptr<CacheStorageCache::BlobDataHandles> blob_data_handles( |
429 new CacheStorageCache::BlobDataHandles); | 429 new CacheStorageCache::BlobDataHandles); |
430 if (error == CACHE_STORAGE_OK) { | 430 if (error == CACHE_STORAGE_OK) { |
431 DCHECK(response); | 431 DCHECK(response); |
432 responses->push_back(*response); | 432 responses->push_back(*response); |
433 if (blob_data_handle) | 433 if (blob_data_handle) |
434 blob_data_handles->push_back(*blob_data_handle); | 434 blob_data_handles->push_back(*blob_data_handle); |
435 } | 435 } |
436 OnCacheMatchAllCallback(thread_id, request_id, cache, error, | 436 //OnCacheMatchAllCallback(thread_id, request_id, cache, error, |
437 std::move(responses), std::move(blob_data_handles)); | 437 // std::move(responses), std::move(blob_data_handles)); |
438 } | 438 } |
439 | 439 |
440 void CacheStorageDispatcherHost::OnCacheMatchAllCallback( | 440 void CacheStorageDispatcherHost::OnCacheMatchAllCallback( |
441 int thread_id, | 441 int thread_id, |
442 int request_id, | 442 int request_id, |
443 const scoped_refptr<CacheStorageCache>& cache, | 443 const scoped_refptr<CacheStorageCache>& cache, |
444 CacheStorageError error, | 444 CacheStorageError error, |
445 scoped_ptr<CacheStorageCache::Responses> responses, | 445 scoped_ptr<CacheStorageCache::QueryCacheResults> results) { |
446 scoped_ptr<CacheStorageCache::BlobDataHandles> blob_data_handles) { | |
447 if (error != CACHE_STORAGE_OK && error != CACHE_STORAGE_ERROR_NOT_FOUND) { | 446 if (error != CACHE_STORAGE_OK && error != CACHE_STORAGE_ERROR_NOT_FOUND) { |
448 Send(new CacheStorageMsg_CacheMatchAllError( | 447 Send(new CacheStorageMsg_CacheMatchAllError( |
449 thread_id, request_id, ToWebServiceWorkerCacheError(error))); | 448 thread_id, request_id, ToWebServiceWorkerCacheError(error))); |
450 return; | 449 return; |
451 } | 450 } |
452 | 451 |
453 for (const storage::BlobDataHandle& handle : *blob_data_handles) | 452 for (const storage::BlobDataHandle& handle : *results->blob_data_handles) |
454 StoreBlobDataHandle(handle); | 453 StoreBlobDataHandle(handle); |
455 | 454 |
456 Send(new CacheStorageMsg_CacheMatchAllSuccess(thread_id, request_id, | 455 Send(new CacheStorageMsg_CacheMatchAllSuccess(thread_id, request_id, |
457 *responses)); | 456 *results->responses)); |
458 } | 457 } |
459 | 458 |
460 void CacheStorageDispatcherHost::OnCacheKeysCallback( | 459 void CacheStorageDispatcherHost::OnCacheKeysCallback( |
461 int thread_id, | 460 int thread_id, |
462 int request_id, | 461 int request_id, |
463 const scoped_refptr<CacheStorageCache>& cache, | 462 const scoped_refptr<CacheStorageCache>& cache, |
464 CacheStorageError error, | 463 CacheStorageError error, |
465 scoped_ptr<CacheStorageCache::Requests> requests) { | 464 scoped_ptr<CacheStorageCache::Requests> requests) { |
466 if (error != CACHE_STORAGE_OK) { | 465 if (error != CACHE_STORAGE_OK) { |
467 Send(new CacheStorageMsg_CacheKeysError( | 466 Send(new CacheStorageMsg_CacheKeysError( |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 UUIDToBlobDataHandleList::iterator it = blob_handle_store_.find(uuid); | 518 UUIDToBlobDataHandleList::iterator it = blob_handle_store_.find(uuid); |
520 if (it == blob_handle_store_.end()) | 519 if (it == blob_handle_store_.end()) |
521 return; | 520 return; |
522 DCHECK(!it->second.empty()); | 521 DCHECK(!it->second.empty()); |
523 it->second.pop_front(); | 522 it->second.pop_front(); |
524 if (it->second.empty()) | 523 if (it->second.empty()) |
525 blob_handle_store_.erase(it); | 524 blob_handle_store_.erase(it); |
526 } | 525 } |
527 | 526 |
528 } // namespace content | 527 } // namespace content |
OLD | NEW |