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

Unified Diff: content/public/common/bind_interface_helpers.h

Issue 2766263009: Convert content ConnectionFilter to OnBindInterface (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/BUILD.gn ('k') | content/public/common/child_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/bind_interface_helpers.h
diff --git a/content/public/common/bind_interface_helpers.h b/content/public/common/bind_interface_helpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..aa04b9b6787eaadf2a97560f6681181ba9e77471
--- /dev/null
+++ b/content/public/common/bind_interface_helpers.h
@@ -0,0 +1,27 @@
+// Copyright 2014 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.
+
+#ifndef CONTENT_PUBLIC_COMMON_BIND_INTERFACE_HELPERS_H_
+#define CONTENT_PUBLIC_COMMON_BIND_INTERFACE_HELPERS_H_
+
+#include "mojo/public/cpp/bindings/interface_ptr.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/public/cpp/system/message_pipe.h"
+
+namespace content {
+
+template <typename Host, typename Interface>
+void BindInterface(Host* host, mojo::InterfacePtr<Interface>* ptr) {
+ mojo::MessagePipe pipe;
+ ptr->Bind(mojo::InterfacePtrInfo<Interface>(std::move(pipe.handle0), 0u));
+ host->BindInterface(Interface::Name_, std::move(pipe.handle1));
+}
+template <typename Host, typename Interface>
+void BindInterface(Host* host, mojo::InterfaceRequest<Interface> request) {
+ host->BindInterface(Interface::Name_, std::move(request.PassMessagePipe()));
+}
+
+} // namespace
+
+#endif // CONTENT_PUBLIC_COMMON_BIND_INTERFACE_HELPERS_H_
« no previous file with comments | « content/public/common/BUILD.gn ('k') | content/public/common/child_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698