Index: storage/browser/blob/blob_reader.cc |
diff --git a/storage/browser/blob/blob_reader.cc b/storage/browser/blob/blob_reader.cc |
index b342fc907c5edad6efe5060b4f59bb1139351a68..8382abd16009e3ee8fff11434cb6f3988e4563e9 100644 |
--- a/storage/browser/blob/blob_reader.cc |
+++ b/storage/browser/blob/blob_reader.cc |
@@ -40,20 +40,24 @@ bool IsFileType(DataElement::Type type) { |
} |
} |
-int ConvertBlobErrorToNetError(IPCBlobCreationCancelCode reason) { |
+int ConvertBlobErrorToNetError(BlobStatus reason) { |
switch (reason) { |
- case IPCBlobCreationCancelCode::UNKNOWN: |
+ case BlobStatus::INVALID_CONSTRUCTION_ARGUMENTS: |
return net::ERR_FAILED; |
- case IPCBlobCreationCancelCode::OUT_OF_MEMORY: |
+ case BlobStatus::OUT_OF_MEMORY: |
return net::ERR_OUT_OF_MEMORY; |
- case IPCBlobCreationCancelCode::FILE_WRITE_FAILED: |
+ case BlobStatus::FILE_WRITE_FAILED: |
return net::ERR_FILE_NO_SPACE; |
- case IPCBlobCreationCancelCode::SOURCE_DIED_IN_TRANSIT: |
+ case BlobStatus::SOURCE_DIED_IN_TRANSIT: |
return net::ERR_UNEXPECTED; |
- case IPCBlobCreationCancelCode::BLOB_DEREFERENCED_WHILE_BUILDING: |
+ case BlobStatus::BLOB_DEREFERENCED_WHILE_BUILDING: |
return net::ERR_UNEXPECTED; |
- case IPCBlobCreationCancelCode::REFERENCED_BLOB_BROKEN: |
+ case BlobStatus::REFERENCED_BLOB_BROKEN: |
return net::ERR_INVALID_HANDLE; |
+ case BlobStatus::DONE: |
+ case BlobStatus::PENDING_MEMORY_QUOTA: |
+ case BlobStatus::PENDING_DATA_POPULATION: |
+ NOTREACHED(); |
} |
NOTREACHED(); |
return net::ERR_FAILED; |
@@ -256,10 +260,9 @@ BlobReader::Status BlobReader::ReportError(int net_error) { |
} |
void BlobReader::AsyncCalculateSize(const net::CompletionCallback& done, |
- bool async_succeeded, |
- IPCBlobCreationCancelCode reason) { |
- if (!async_succeeded) { |
- InvalidateCallbacksAndDone(ConvertBlobErrorToNetError(reason), done); |
+ BlobStatus status) { |
+ if (BlobStatusIsError(status)) { |
+ InvalidateCallbacksAndDone(ConvertBlobErrorToNetError(status), done); |
return; |
} |
DCHECK(!blob_handle_->IsBroken()) << "Callback should have returned false."; |