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 cfd2c05df12e6a41eef348ca89c18d9ac05ab09e..7cdc15ea73511d1a3f4f94aaa6a60fff4539d0cc 100644 |
--- a/content/child/blob_storage/blob_transport_controller.cc |
+++ b/content/child/blob_storage/blob_transport_controller.cc |
@@ -13,6 +13,7 @@ |
#include "base/stl_util.h" |
#include "content/child/blob_storage/blob_consolidation.h" |
#include "content/child/thread_safe_sender.h" |
+#include "content/common/fileapi/webblob_messages.h" |
#include "ipc/ipc_sender.h" |
#include "storage/common/blob_storage/blob_item_bytes_request.h" |
#include "storage/common/blob_storage/blob_item_bytes_response.h" |
@@ -46,16 +47,13 @@ BlobTransportController::~BlobTransportController() {} |
void BlobTransportController::InitiateBlobTransfer( |
const std::string& uuid, |
- const std::string& type, |
scoped_ptr<BlobConsolidation> consolidation, |
IPC::Sender* sender) { |
BlobConsolidation* consolidation_ptr = consolidation.get(); |
- blob_storage_.insert(std::make_pair(uuid, std::move(consolidation))); |
+ blob_storage_[uuid] = std::move(consolidation); |
std::vector<storage::DataElement> descriptions; |
GetDescriptions(consolidation_ptr, kLargeThresholdBytes, &descriptions); |
- // TODO(dmurph): Uncomment when IPC messages are added. |
- // sender->Send(new BlobStorageMsg_StartBuildingBlob(uuid, type, |
- // descriptions)); |
+ sender->Send(new BlobStorageMsg_StartBuildingBlob(uuid, descriptions)); |
} |
void BlobTransportController::OnMemoryRequest( |
@@ -85,8 +83,7 @@ void BlobTransportController::OnMemoryRequest( |
break; |
} |
- // TODO(dmurph): Uncomment when IPC messages are added. |
- // sender->Send(new BlobStorageMsg_MemoryItemResponse(uuid, responses)); |
+ sender->Send(new BlobStorageMsg_MemoryItemResponse(uuid, responses)); |
} |
void BlobTransportController::OnCancel( |
@@ -100,8 +97,19 @@ void BlobTransportController::OnCancel( |
case IPCBlobCreationCancelCode::OUT_OF_MEMORY: |
DVLOG(1) << "Out of Memory."; |
break; |
+ case IPCBlobCreationCancelCode::SOURCE_DIED_IN_TRANSIT: |
+ DVLOG(1) |
+ << "Source died in transit. Invalid cancel reason from the Browser."; |
+ break; |
case IPCBlobCreationCancelCode::FILE_WRITE_FAILED: |
- DVLOG(1) << "File Write Failed (Invalid cancel reason!)."; |
+ DVLOG(1) << "File Write Failed."; |
+ break; |
+ case IPCBlobCreationCancelCode::BLOB_DEREFERENCED_WHILE_BUILDING: |
+ DVLOG(1) << "Blob was dereferenced before building finished, and no one " |
+ << "was waiting to read it."; |
+ break; |
+ case IPCBlobCreationCancelCode::REFERENCED_BLOB_BROKEN: |
+ DVLOG(1) << "Referenced blob was broken."; |
break; |
} |
ReleaseBlobConsolidation(uuid); |
@@ -120,8 +128,7 @@ BlobTransportController::BlobTransportController() {} |
void BlobTransportController::CancelBlobTransfer(const std::string& uuid, |
IPCBlobCreationCancelCode code, |
IPC::Sender* sender) { |
- // TODO(dmurph): Uncomment when IPC messages are added. |
- // sender->Send(new BlobStorageMsg_CancelBuildingBlob(uuid, code)); |
+ sender->Send(new BlobStorageMsg_CancelBuildingBlob(uuid, code)); |
ReleaseBlobConsolidation(uuid); |
} |