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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 #ifndef CONTENT_PUBLIC_COMMON_BIND_INTERFACE_HELPERS_H_
6 #define CONTENT_PUBLIC_COMMON_BIND_INTERFACE_HELPERS_H_
7
8 #include "mojo/public/cpp/bindings/interface_ptr.h"
9 #include "mojo/public/cpp/bindings/interface_request.h"
10 #include "mojo/public/cpp/system/message_pipe.h"
11
12 namespace content {
13
14 template <typename Host, typename Interface>
15 void BindInterface(Host* host, mojo::InterfacePtr<Interface>* ptr) {
16 mojo::MessagePipe pipe;
17 ptr->Bind(mojo::InterfacePtrInfo<Interface>(std::move(pipe.handle0), 0u));
18 host->BindInterface(Interface::Name_, std::move(pipe.handle1));
19 }
20 template <typename Host, typename Interface>
21 void BindInterface(Host* host, mojo::InterfaceRequest<Interface> request) {
22 host->BindInterface(Interface::Name_, std::move(request.PassMessagePipe()));
23 }
24
25 } // namespace
26
27 #endif // CONTENT_PUBLIC_COMMON_BIND_INTERFACE_HELPERS_H_
OLDNEW
« 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