| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/blob_storage/blob_dispatcher_host.h" | 5 #include "content/browser/blob_storage/blob_dispatcher_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "content/browser/bad_message.h" | 10 #include "content/browser/bad_message.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 context()->RevokePublicBlobURL(public_url); | 262 context()->RevokePublicBlobURL(public_url); |
| 263 public_blob_urls_.erase(public_url); | 263 public_blob_urls_.erase(public_url); |
| 264 } | 264 } |
| 265 | 265 |
| 266 storage::BlobStorageContext* BlobDispatcherHost::context() { | 266 storage::BlobStorageContext* BlobDispatcherHost::context() { |
| 267 return blob_storage_context_->context(); | 267 return blob_storage_context_->context(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void BlobDispatcherHost::SendMemoryRequest( | 270 void BlobDispatcherHost::SendMemoryRequest( |
| 271 const std::string& uuid, | 271 const std::string& uuid, |
| 272 scoped_ptr<std::vector<storage::BlobItemBytesRequest>> requests, | 272 std::unique_ptr<std::vector<storage::BlobItemBytesRequest>> requests, |
| 273 scoped_ptr<std::vector<base::SharedMemoryHandle>> memory_handles, | 273 std::unique_ptr<std::vector<base::SharedMemoryHandle>> memory_handles, |
| 274 scoped_ptr<std::vector<base::File>> files) { | 274 std::unique_ptr<std::vector<base::File>> files) { |
| 275 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 275 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 276 std::vector<IPC::PlatformFileForTransit> file_handles; | 276 std::vector<IPC::PlatformFileForTransit> file_handles; |
| 277 // TODO(dmurph): Support file-backed blob transportation. | 277 // TODO(dmurph): Support file-backed blob transportation. |
| 278 DCHECK(files->empty()); | 278 DCHECK(files->empty()); |
| 279 Send(new BlobStorageMsg_RequestMemoryItem(uuid, *requests, *memory_handles, | 279 Send(new BlobStorageMsg_RequestMemoryItem(uuid, *requests, *memory_handles, |
| 280 file_handles)); | 280 file_handles)); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void BlobDispatcherHost::SendIPCResponse(const std::string& uuid, | 283 void BlobDispatcherHost::SendIPCResponse(const std::string& uuid, |
| 284 storage::BlobTransportResult result) { | 284 storage::BlobTransportResult result) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 context->RevokePublicBlobURL(url); | 326 context->RevokePublicBlobURL(url); |
| 327 } | 327 } |
| 328 for (const auto& uuid_refnum_pair : blobs_inuse_map_) { | 328 for (const auto& uuid_refnum_pair : blobs_inuse_map_) { |
| 329 for (int i = 0; i < uuid_refnum_pair.second; ++i) | 329 for (int i = 0; i < uuid_refnum_pair.second; ++i) |
| 330 context->DecrementBlobRefCount(uuid_refnum_pair.first); | 330 context->DecrementBlobRefCount(uuid_refnum_pair.first); |
| 331 } | 331 } |
| 332 async_builder_.CancelAll(context); | 332 async_builder_.CancelAll(context); |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace content | 335 } // namespace content |
| OLD | NEW |