Chromium Code Reviews| 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 4778f3914a1d8736403b1e716b5c8a70293dc817..748142e3dfb06035ed80a88386bdce557d1b6e4f 100644 |
| --- a/storage/browser/blob/blob_data_handle.cc |
| +++ b/storage/browser/blob/blob_data_handle.cc |
| @@ -72,15 +72,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); |
| -} |
| - |
| scoped_ptr<BlobReader> BlobDataHandle::CreateReader( |
| FileSystemContext* file_system_context, |
| base::SequencedTaskRunner* file_task_runner) const { |
| @@ -90,13 +81,6 @@ scoped_ptr<BlobReader> BlobDataHandle::CreateReader( |
| file_task_runner)); |
| } |
| -scoped_ptr<BlobDataSnapshot> |
| -BlobDataHandle::BlobDataHandleShared::CreateSnapshot() const { |
| - if (!context_.get()) |
| - return nullptr; |
| - return context_->CreateSnapshot(uuid_); |
| -} |
| - |
| BlobDataHandle::BlobDataHandleShared::~BlobDataHandleShared() { |
| if (context_.get()) |
| context_->DecrementBlobRefCount(uuid_); |
| @@ -145,14 +129,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); |
|
jsbell
2016/04/04 20:41:19
Add a code for this case?
dmurph
2016/04/04 22:17:42
This is a crazy edge case, where the context is ev
|
| + return; |
| + } |
| + shared_->context_->RunOnConstructionComplete(shared_->uuid_, done); |
| } |
| scoped_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 { |