| 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/fileapi/blob_storage_host.h" | 5 #include "content/browser/fileapi/blob_storage_host.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 return; | 78 return; |
| 79 } | 79 } |
| 80 if (!context_->MaybeStartAsyncBlobTransfer(uuid)) { | 80 if (!context_->MaybeStartAsyncBlobTransfer(uuid)) { |
| 81 cancel.Run(storage::IPCBlobCreationCancelCode::UNKNOWN); | 81 cancel.Run(storage::IPCBlobCreationCancelCode::UNKNOWN); |
| 82 // Just in case we have it, let's cancel everything. | 82 // Just in case we have it, let's cancel everything. |
| 83 context_->CleanupCanceledAsyncBlobTransfer(uuid); | 83 context_->CleanupCanceledAsyncBlobTransfer(uuid); |
| 84 async_builder_.StopBuildingBlob(uuid); | 84 async_builder_.StopBuildingBlob(uuid); |
| 85 return; | 85 return; |
| 86 } | 86 } |
| 87 async_builder_.StartBuildingBlob( | 87 async_builder_.StartBuildingBlob( |
| 88 uuid, type, descriptions, context_->memory_available(), | 88 uuid, type, descriptions, context_->memory_usage(), |
| 89 base::Bind(&NoopFileHandleAdapter, request_memory), | 89 base::Bind(&NoopFileHandleAdapter, request_memory), |
| 90 base::Bind(&BlobStorageContext::FinishAsyncBlobTransfer, | 90 base::Bind(&BlobStorageContext::FinishAsyncBlobTransfer, |
| 91 context_->AsWeakPtr(), done, cancel), | 91 context_->AsWeakPtr(), done, cancel), |
| 92 base::Bind(&BlobStorageContext::CancelAsyncBlobTransfer, | 92 base::Bind(&BlobStorageContext::CancelAsyncBlobTransfer, |
| 93 context_->AsWeakPtr(), uuid, cancel)); | 93 context_->AsWeakPtr(), uuid, cancel)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void BlobStorageHost::BlobMemoryResponses( | 96 void BlobStorageHost::BlobMemoryResponses( |
| 97 const std::string& uuid, | 97 const std::string& uuid, |
| 98 const std::vector<storage::BlobItemBytesResponse>& responses) { | 98 const std::vector<storage::BlobItemBytesResponse>& responses) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 bool BlobStorageHost::IsBeingBuiltInHost(const std::string& uuid) { | 153 bool BlobStorageHost::IsBeingBuiltInHost(const std::string& uuid) { |
| 154 return IsInUseInHost(uuid) && (context_->IsBlobConstructing(uuid)); | 154 return IsInUseInHost(uuid) && (context_->IsBlobConstructing(uuid)); |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool BlobStorageHost::IsUrlRegisteredInHost(const GURL& blob_url) { | 157 bool BlobStorageHost::IsUrlRegisteredInHost(const GURL& blob_url) { |
| 158 return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); | 158 return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace content | 161 } // namespace content |
| OLD | NEW |