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

Unified Diff: content/public/common/simple_connection_filter.cc

Issue 2810343002: Convert UtilityThread/Clients to add ConnectionFilters instead of using ChildThread's InterfaceRegi… (Closed)
Patch Set: . Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/simple_connection_filter.h ('k') | content/shell/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/simple_connection_filter.cc
diff --git a/content/public/common/simple_connection_filter.cc b/content/public/common/simple_connection_filter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9b321750dc05d14ff4071952249a68bc5628efb2
--- /dev/null
+++ b/content/public/common/simple_connection_filter.cc
@@ -0,0 +1,29 @@
+// Copyright 2017 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/public/common/simple_connection_filter.h"
+
+#include "services/service_manager/public/cpp/binder_registry.h"
+#include "services/service_manager/public/cpp/service_info.h"
+
+namespace content {
+
+SimpleConnectionFilter::SimpleConnectionFilter(
+ std::unique_ptr<service_manager::BinderRegistry> registry)
+ : registry_(std::move(registry)) {}
+
+SimpleConnectionFilter::~SimpleConnectionFilter() {}
+
+void SimpleConnectionFilter::OnBindInterface(
+ const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle* interface_pipe,
+ service_manager::Connector* connector) {
+ if (registry_->CanBindInterface(interface_name)) {
+ registry_->BindInterface(source_info.identity, interface_name,
+ std::move(*interface_pipe));
+ }
+}
+
+} // namespace content
« no previous file with comments | « content/public/common/simple_connection_filter.h ('k') | content/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698