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

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

Issue 2310563002: Adds routed interface support between RenderFrameHost and RenderFrame (Closed)
Patch Set: nit Created 4 years, 3 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/common/associated_interface_registry_impl.h"
6
7 #include <utility>
8
9 #include "base/logging.h"
10
11 namespace content {
12
13 AssociatedInterfaceRegistryImpl::AssociatedInterfaceRegistryImpl() {}
14
15 AssociatedInterfaceRegistryImpl::~AssociatedInterfaceRegistryImpl() {}
16
17 void AssociatedInterfaceRegistryImpl::BindRequest(
18 const std::string& interface_name,
19 mojo::ScopedInterfaceEndpointHandle handle) {
20 auto it = interfaces_.find(interface_name);
21 if (it == interfaces_.end())
22 return;
23 it->second.Run(std::move(handle));
24 }
25
26 void AssociatedInterfaceRegistryImpl::AddInterface(const std::string& name,
27 const Binder& binder) {
28 auto result = interfaces_.insert(std::make_pair(name, binder));
29 DCHECK(result.second);
30 }
31
32 void AssociatedInterfaceRegistryImpl::RemoveInterface(const std::string& name) {
33 auto it = interfaces_.find(name);
34 DCHECK(it != interfaces_.end());
35 interfaces_.erase(it);
36 }
37
38 } // namespace content
OLDNEW
« no previous file with comments | « content/common/associated_interface_registry_impl.h ('k') | content/common/associated_interfaces.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698