| 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_cache.h" | 5 #include "content/browser/cache_storage/cache_storage_cache.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 if (!blob_storage_context_) { | 916 if (!blob_storage_context_) { |
| 917 callback.Run(CACHE_STORAGE_ERROR_STORAGE); | 917 callback.Run(CACHE_STORAGE_ERROR_STORAGE); |
| 918 return; | 918 return; |
| 919 } | 919 } |
| 920 blob_data_handle = | 920 blob_data_handle = |
| 921 blob_storage_context_->GetBlobDataFromUUID(response->blob_uuid); | 921 blob_storage_context_->GetBlobDataFromUUID(response->blob_uuid); |
| 922 if (!blob_data_handle) { | 922 if (!blob_data_handle) { |
| 923 callback.Run(CACHE_STORAGE_ERROR_STORAGE); | 923 callback.Run(CACHE_STORAGE_ERROR_STORAGE); |
| 924 return; | 924 return; |
| 925 } | 925 } |
| 926 if (blob_data_handle->IsBroken()) { |
| 927 LOG(ERROR) << "Blob broken"; |
| 928 callback.Run(CACHE_STORAGE_ERROR_STORAGE); |
| 929 return; |
| 930 } |
| 926 } | 931 } |
| 927 | 932 |
| 928 ErrorCallback pending_callback = | 933 ErrorCallback pending_callback = |
| 929 base::Bind(&CacheStorageCache::PendingErrorCallback, | 934 base::Bind(&CacheStorageCache::PendingErrorCallback, |
| 930 weak_ptr_factory_.GetWeakPtr(), callback); | 935 weak_ptr_factory_.GetWeakPtr(), callback); |
| 931 | 936 |
| 932 std::unique_ptr<PutContext> put_context( | 937 std::unique_ptr<PutContext> put_context( |
| 933 new PutContext(std::move(request), std::move(response), | 938 new PutContext(std::move(request), std::move(response), |
| 934 std::move(blob_data_handle), pending_callback)); | 939 std::move(blob_data_handle), pending_callback)); |
| 935 | 940 |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 storage::BlobDataBuilder blob_data(response->blob_uuid); | 1543 storage::BlobDataBuilder blob_data(response->blob_uuid); |
| 1539 | 1544 |
| 1540 disk_cache::Entry* temp_entry = entry.get(); | 1545 disk_cache::Entry* temp_entry = entry.get(); |
| 1541 blob_data.AppendDiskCacheEntryWithSideData( | 1546 blob_data.AppendDiskCacheEntryWithSideData( |
| 1542 new CacheStorageCacheDataHandle(this, std::move(entry)), temp_entry, | 1547 new CacheStorageCacheDataHandle(this, std::move(entry)), temp_entry, |
| 1543 INDEX_RESPONSE_BODY, INDEX_SIDE_DATA); | 1548 INDEX_RESPONSE_BODY, INDEX_SIDE_DATA); |
| 1544 return blob_storage_context_->AddFinishedBlob(&blob_data); | 1549 return blob_storage_context_->AddFinishedBlob(&blob_data); |
| 1545 } | 1550 } |
| 1546 | 1551 |
| 1547 } // namespace content | 1552 } // namespace content |
| OLD | NEW |