| Index: content/child/blob_storage/blob_transport_controller.cc
|
| diff --git a/content/child/blob_storage/blob_transport_controller.cc b/content/child/blob_storage/blob_transport_controller.cc
|
| index 0bcadbc85d30e80ac8d13d4cbaad0b5864627a04..c9d89060c08234e6c8360fa559e939d504bfa186 100644
|
| --- a/content/child/blob_storage/blob_transport_controller.cc
|
| +++ b/content/child/blob_storage/blob_transport_controller.cc
|
| @@ -72,22 +72,12 @@ void BlobTransportController::InitiateBlobTransfer(
|
| main_runner->PostTask(FROM_HERE, base::Bind(&IncChildProcessRefCount));
|
| }
|
|
|
| - std::vector<storage::DataElement> descriptions;
|
| - std::set<std::string> referenced_blobs = consolidation->referenced_blobs();
|
| - BlobTransportController::GetDescriptions(
|
| - consolidation.get(), kBlobStorageIPCThresholdBytes, &descriptions);
|
| - // I post the task first to make sure that we store our consolidation before
|
| - // we get a request back from the browser.
|
| io_runner->PostTask(
|
| FROM_HERE,
|
| - base::Bind(&BlobTransportController::StoreBlobDataForRequests,
|
| - base::Unretained(BlobTransportController::GetInstance()), uuid,
|
| - base::Passed(std::move(consolidation)),
|
| + base::Bind(&BlobTransportController::InitiateBlobTransferOnIOThread, uuid,
|
| + content_type, base::Passed(std::move(consolidation)),
|
| + base::Passed(std::move(sender)),
|
| base::Passed(std::move(main_runner))));
|
| - // TODO(dmurph): Merge register and start messages.
|
| - sender->Send(new BlobStorageMsg_RegisterBlobUUID(uuid, content_type, "",
|
| - referenced_blobs));
|
| - sender->Send(new BlobStorageMsg_StartBuildingBlob(uuid, descriptions));
|
| }
|
|
|
| void BlobTransportController::OnMemoryRequest(
|
| @@ -198,6 +188,26 @@ void BlobTransportController::ClearForTesting() {
|
| blob_storage_.clear();
|
| }
|
|
|
| +// static
|
| +void BlobTransportController::InitiateBlobTransferOnIOThread(
|
| + const std::string& uuid,
|
| + const std::string& content_type,
|
| + std::unique_ptr<BlobConsolidation> consolidation,
|
| + scoped_refptr<ThreadSafeSender> sender,
|
| + scoped_refptr<base::SingleThreadTaskRunner> main_runner) {
|
| + std::vector<storage::DataElement> descriptions;
|
| + std::set<std::string> referenced_blobs = consolidation->referenced_blobs();
|
| + BlobTransportController::GetDescriptions(
|
| + consolidation.get(), kBlobStorageIPCThresholdBytes, &descriptions);
|
| + BlobTransportController::GetInstance()->StoreBlobDataForRequests(
|
| + uuid, std::move(consolidation), std::move(main_runner));
|
| +
|
| + // TODO(dmurph): Merge register and start messages.
|
| + sender->Send(new BlobStorageMsg_RegisterBlobUUID(uuid, content_type, "",
|
| + referenced_blobs));
|
| + sender->Send(new BlobStorageMsg_StartBuildingBlob(uuid, descriptions));
|
| +}
|
| +
|
| void BlobTransportController::StoreBlobDataForRequests(
|
| const std::string& uuid,
|
| std::unique_ptr<BlobConsolidation> consolidation,
|
|
|