| Index: storage/browser/blob/blob_impl.cc
|
| diff --git a/storage/browser/blob/blob_impl.cc b/storage/browser/blob/blob_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9013346f1c8acdf1aef6de8d0cdc0cdfe5a63afd
|
| --- /dev/null
|
| +++ b/storage/browser/blob/blob_impl.cc
|
| @@ -0,0 +1,39 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "storage/browser/blob/blob_impl.h"
|
| +
|
| +#include "storage/browser/blob/blob_data_handle.h"
|
| +
|
| +namespace storage {
|
| +
|
| +BlobImpl::BlobImpl(std::unique_ptr<BlobDataHandle> handle,
|
| + mojom::BlobRequest request)
|
| + : handle_(std::move(handle)) {
|
| + DCHECK(handle_);
|
| + bindings_.AddBinding(this, std::move(request));
|
| + bindings_.set_connection_error_handler(
|
| + base::Bind(&BlobImpl::OnConnectionError, base::Unretained(this)));
|
| +}
|
| +
|
| +void BlobImpl::Clone(mojom::BlobRequest request) {
|
| + LOG(INFO) << "Cloning " << handle_->uuid();
|
| + bindings_.AddBinding(this, std::move(request));
|
| +}
|
| +
|
| +void BlobImpl::InternalGetUUID(InternalGetUUIDCallback callback) {
|
| + LOG(INFO) << "Get UUID from " << handle_->uuid();
|
| + std::move(callback).Run(handle_->uuid());
|
| +}
|
| +
|
| +BlobImpl::~BlobImpl() {}
|
| +
|
| +void BlobImpl::OnConnectionError() {
|
| + if (!bindings_.empty())
|
| + return;
|
| + LOG(INFO) << "Deleting " << handle_->uuid();
|
| + delete this;
|
| +}
|
| +
|
| +} // namespace storage
|
|
|