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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/associated_interface_registry_impl.h ('k') | content/common/associated_interfaces.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/associated_interface_registry_impl.cc
diff --git a/content/common/associated_interface_registry_impl.cc b/content/common/associated_interface_registry_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..67b5b0e4e540cb2b9c030546e0f80336d16ad285
--- /dev/null
+++ b/content/common/associated_interface_registry_impl.cc
@@ -0,0 +1,38 @@
+// Copyright 2016 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 "content/common/associated_interface_registry_impl.h"
+
+#include <utility>
+
+#include "base/logging.h"
+
+namespace content {
+
+AssociatedInterfaceRegistryImpl::AssociatedInterfaceRegistryImpl() {}
+
+AssociatedInterfaceRegistryImpl::~AssociatedInterfaceRegistryImpl() {}
+
+void AssociatedInterfaceRegistryImpl::BindRequest(
+ const std::string& interface_name,
+ mojo::ScopedInterfaceEndpointHandle handle) {
+ auto it = interfaces_.find(interface_name);
+ if (it == interfaces_.end())
+ return;
+ it->second.Run(std::move(handle));
+}
+
+void AssociatedInterfaceRegistryImpl::AddInterface(const std::string& name,
+ const Binder& binder) {
+ auto result = interfaces_.insert(std::make_pair(name, binder));
+ DCHECK(result.second);
+}
+
+void AssociatedInterfaceRegistryImpl::RemoveInterface(const std::string& name) {
+ auto it = interfaces_.find(name);
+ DCHECK(it != interfaces_.end());
+ interfaces_.erase(it);
+}
+
+} // namespace content
« 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