Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1027)

Unified Diff: storage/browser/blob/blob_storage_context.cc

Issue 1846363002: [BlobAsync] Adding better error reporting and some new tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed switch statement Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: storage/browser/blob/blob_storage_context.cc
diff --git a/storage/browser/blob/blob_storage_context.cc b/storage/browser/blob/blob_storage_context.cc
index d3c8f02ee061a2caa2cbafacf46e8a621329759b..52c9d92ee65b1a0cd42e654562d905d49298b4f6 100644
--- a/storage/browser/blob/blob_storage_context.cc
+++ b/storage/browser/blob/blob_storage_context.cc
@@ -160,7 +160,8 @@ void BlobStorageContext::CompletePendingBlob(
auto runner = base::ThreadTaskRunnerHandle::Get();
for (const auto& callback : entry->build_completion_callbacks) {
runner->PostTask(FROM_HERE,
- base::Bind(callback, entry->state == BlobState::COMPLETE));
+ base::Bind(callback, entry->state == BlobState::COMPLETE,
+ entry->broken_reason));
}
entry->build_completion_callbacks.clear();
}
@@ -232,15 +233,15 @@ bool BlobStorageContext::IsBeingBuilt(const std::string& uuid) const {
void BlobStorageContext::RunOnConstructionComplete(
const std::string& uuid,
- const base::Callback<void(bool)>& done) {
+ const BlobConstructedCallback& done) {
BlobRegistryEntry* entry = registry_.GetEntry(uuid);
DCHECK(entry);
switch (entry->state) {
case BlobState::COMPLETE:
- done.Run(true);
+ done.Run(true, IPCBlobCreationCancelCode::UNKNOWN);
return;
case BlobState::BROKEN:
- done.Run(false);
+ done.Run(false, entry->broken_reason);
return;
case BlobState::PENDING:
entry->build_completion_callbacks.push_back(done);

Powered by Google App Engine
This is Rietveld 408576698