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

Side by Side Diff: content/common/associated_interface_registry_impl.cc

Issue 2653973002: Remove associated interface registration from ChannelProxy (Closed)
Patch Set: Created 3 years, 11 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 | « content/common/associated_interface_registry_impl.h ('k') | content/gpu/gpu_child_thread.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/common/associated_interface_registry_impl.h" 5 #include "content/common/associated_interface_registry_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 AssociatedInterfaceRegistryImpl::AssociatedInterfaceRegistryImpl() {} 13 AssociatedInterfaceRegistryImpl::AssociatedInterfaceRegistryImpl() {}
14 14
15 AssociatedInterfaceRegistryImpl::~AssociatedInterfaceRegistryImpl() {} 15 AssociatedInterfaceRegistryImpl::~AssociatedInterfaceRegistryImpl() {}
16 16
17 bool AssociatedInterfaceRegistryImpl::CanBindRequest(
18 const std::string& interface_name) const {
19 return interfaces_.find(interface_name) != interfaces_.end();
20 }
21
17 void AssociatedInterfaceRegistryImpl::BindRequest( 22 void AssociatedInterfaceRegistryImpl::BindRequest(
18 const std::string& interface_name, 23 const std::string& interface_name,
19 mojo::ScopedInterfaceEndpointHandle handle) { 24 mojo::ScopedInterfaceEndpointHandle handle) {
20 auto it = interfaces_.find(interface_name); 25 auto it = interfaces_.find(interface_name);
21 if (it == interfaces_.end()) 26 if (it == interfaces_.end())
22 return; 27 return;
23 it->second.Run(std::move(handle)); 28 it->second.Run(std::move(handle));
24 } 29 }
25 30
26 void AssociatedInterfaceRegistryImpl::AddInterface(const std::string& name, 31 void AssociatedInterfaceRegistryImpl::AddInterface(const std::string& name,
27 const Binder& binder) { 32 const Binder& binder) {
28 auto result = interfaces_.insert(std::make_pair(name, binder)); 33 auto result = interfaces_.insert(std::make_pair(name, binder));
29 DCHECK(result.second); 34 DCHECK(result.second);
30 } 35 }
31 36
32 void AssociatedInterfaceRegistryImpl::RemoveInterface(const std::string& name) { 37 void AssociatedInterfaceRegistryImpl::RemoveInterface(const std::string& name) {
33 auto it = interfaces_.find(name); 38 auto it = interfaces_.find(name);
34 DCHECK(it != interfaces_.end()); 39 DCHECK(it != interfaces_.end());
35 interfaces_.erase(it); 40 interfaces_.erase(it);
36 } 41 }
37 42
38 } // namespace content 43 } // namespace content
OLDNEW
« no previous file with comments | « content/common/associated_interface_registry_impl.h ('k') | content/gpu/gpu_child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698