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

Unified Diff: storage/browser/blob/blob_data_handle.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: comments Created 4 years, 8 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
« no previous file with comments | « storage/browser/blob/blob_data_handle.h ('k') | storage/browser/blob/blob_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/blob/blob_data_handle.cc
diff --git a/storage/browser/blob/blob_data_handle.cc b/storage/browser/blob/blob_data_handle.cc
index 66dd77d998928ad9f2b8a792b492a4d8c900269b..55e63a1b620697add3368bf82cd0537387de0eb5 100644
--- a/storage/browser/blob/blob_data_handle.cc
+++ b/storage/browser/blob/blob_data_handle.cc
@@ -75,15 +75,6 @@ BlobDataHandle::BlobDataHandleShared::BlobDataHandleShared(
context_->IncrementBlobRefCount(uuid);
}
-void BlobDataHandle::BlobDataHandleShared::RunOnConstructionComplete(
- const base::Callback<void(bool)>& done) {
- if (!context_.get()) {
- done.Run(false);
- return;
- }
- context_->RunOnConstructionComplete(uuid_, done);
-}
-
std::unique_ptr<BlobReader> BlobDataHandle::CreateReader(
FileSystemContext* file_system_context,
base::SequencedTaskRunner* file_task_runner) const {
@@ -93,13 +84,6 @@ std::unique_ptr<BlobReader> BlobDataHandle::CreateReader(
file_task_runner));
}
-std::unique_ptr<BlobDataSnapshot>
-BlobDataHandle::BlobDataHandleShared::CreateSnapshot() const {
- if (!context_.get())
- return nullptr;
- return context_->CreateSnapshot(uuid_);
-}
-
BlobDataHandle::BlobDataHandleShared::~BlobDataHandleShared() {
if (context_.get())
context_->DecrementBlobRefCount(uuid_);
@@ -148,14 +132,20 @@ bool BlobDataHandle::IsBroken() const {
}
void BlobDataHandle::RunOnConstructionComplete(
- const base::Callback<void(bool)>& done) {
+ const BlobConstructedCallback& done) {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
- shared_->RunOnConstructionComplete(done);
+ if (!shared_->context_.get()) {
+ done.Run(false, IPCBlobCreationCancelCode::UNKNOWN);
+ return;
+ }
+ shared_->context_->RunOnConstructionComplete(shared_->uuid_, done);
}
std::unique_ptr<BlobDataSnapshot> BlobDataHandle::CreateSnapshot() const {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
- return shared_->CreateSnapshot();
+ if (!shared_->context_.get())
+ return nullptr;
+ return shared_->context_->CreateSnapshot(shared_->uuid_);
}
const std::string& BlobDataHandle::uuid() const {
« no previous file with comments | « storage/browser/blob/blob_data_handle.h ('k') | storage/browser/blob/blob_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698