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

Side by Side Diff: storage/browser/blob/blob_impl.cc

Issue 2892953006: WIP POC blob transport over mojo
Patch Set: pass mojo blobs over ipc Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « storage/browser/blob/blob_impl.h ('k') | storage/browser/blob/blob_registry_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "storage/browser/blob/blob_impl.h"
6
7 #include "storage/browser/blob/blob_data_handle.h"
8
9 namespace storage {
10
11 BlobImpl::BlobImpl(std::unique_ptr<BlobDataHandle> handle,
12 mojom::BlobRequest request)
13 : handle_(std::move(handle)) {
14 DCHECK(handle_);
15 bindings_.AddBinding(this, std::move(request));
16 bindings_.set_connection_error_handler(
17 base::Bind(&BlobImpl::OnConnectionError, base::Unretained(this)));
18 }
19
20 void BlobImpl::Clone(mojom::BlobRequest request) {
21 LOG(INFO) << "Cloning " << handle_->uuid();
22 bindings_.AddBinding(this, std::move(request));
23 }
24
25 void BlobImpl::InternalGetUUID(InternalGetUUIDCallback callback) {
26 LOG(INFO) << "Get UUID from " << handle_->uuid();
27 std::move(callback).Run(handle_->uuid());
28 }
29
30 BlobImpl::~BlobImpl() {}
31
32 void BlobImpl::OnConnectionError() {
33 if (!bindings_.empty())
34 return;
35 LOG(INFO) << "Deleting " << handle_->uuid();
36 delete this;
37 }
38
39 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_impl.h ('k') | storage/browser/blob/blob_registry_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698