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

Side by Side Diff: content/browser/leveldb_wrapper_impl.cc

Issue 1872903003: Generalize InterfacePtrSet for [Associated]InterfacePtr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put PtrSet in mojo::internal. 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 unified diff | Download patch
« no previous file with comments | « components/mus/ws/user_display_manager.cc ('k') | mash/session/session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/leveldb_wrapper_impl.h" 5 #include "content/browser/leveldb_wrapper_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "mojo/common/common_type_converters.h" 8 #include "mojo/common/common_type_converters.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 10 matching lines...) Expand all
21 max_size_(max_size) { 21 max_size_(max_size) {
22 bindings_.set_connection_error_handler(base::Bind( 22 bindings_.set_connection_error_handler(base::Bind(
23 &LevelDBWrapperImpl::OnConnectionError, base::Unretained(this))); 23 &LevelDBWrapperImpl::OnConnectionError, base::Unretained(this)));
24 } 24 }
25 25
26 void LevelDBWrapperImpl::Bind(mojom::LevelDBWrapperRequest request) { 26 void LevelDBWrapperImpl::Bind(mojom::LevelDBWrapperRequest request) {
27 bindings_.AddBinding(this, std::move(request)); 27 bindings_.AddBinding(this, std::move(request));
28 } 28 }
29 29
30 void LevelDBWrapperImpl::AddObserver(mojom::LevelDBObserverPtr observer) { 30 void LevelDBWrapperImpl::AddObserver(mojom::LevelDBObserverPtr observer) {
31 observers_.AddInterfacePtr(std::move(observer)); 31 observers_.AddPtr(std::move(observer));
32 } 32 }
33 33
34 LevelDBWrapperImpl::~LevelDBWrapperImpl() {} 34 LevelDBWrapperImpl::~LevelDBWrapperImpl() {}
35 35
36 void LevelDBWrapperImpl::Put(mojo::Array<uint8_t> key, 36 void LevelDBWrapperImpl::Put(mojo::Array<uint8_t> key,
37 mojo::Array<uint8_t> value, 37 mojo::Array<uint8_t> value,
38 const mojo::String& source, 38 const mojo::String& source,
39 const PutCallback& callback) { 39 const PutCallback& callback) {
40 bool has_old_item = false; 40 bool has_old_item = false;
41 mojo::Array<uint8_t> old_value; 41 mojo::Array<uint8_t> old_value;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 void LevelDBWrapperImpl::OnConnectionError() { 136 void LevelDBWrapperImpl::OnConnectionError() {
137 if (!bindings_.empty()) 137 if (!bindings_.empty())
138 return; 138 return;
139 139
140 no_bindings_callback_.Run(); 140 no_bindings_callback_.Run();
141 } 141 }
142 142
143 } // namespace content 143 } // namespace content
OLDNEW
« no previous file with comments | « components/mus/ws/user_display_manager.cc ('k') | mash/session/session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698