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

Side by Side Diff: mojo/shell/connect_util.h

Issue 1728083002: Extract a Connector interface from Shell that can be cloned & passed to other threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@12uid
Patch Set: . Created 4 years, 10 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 | « mojo/shell/connect_params.cc ('k') | mojo/shell/identity.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SHELL_CONNECT_UTIL_H_ 5 #ifndef MOJO_SHELL_CONNECT_UTIL_H_
6 #define MOJO_SHELL_CONNECT_UTIL_H_ 6 #define MOJO_SHELL_CONNECT_UTIL_H_
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "mojo/public/cpp/bindings/interface_ptr.h" 10 #include "mojo/public/cpp/bindings/interface_ptr.h"
(...skipping 27 matching lines...) Expand all
38 ptr->Bind(InterfacePtrInfo<Interface>(std::move(service_handle), 0u)); 38 ptr->Bind(InterfacePtrInfo<Interface>(std::move(service_handle), 0u));
39 } 39 }
40 40
41 template <typename Interface> 41 template <typename Interface>
42 inline void ConnectToInterface(ApplicationManager* application_manager, 42 inline void ConnectToInterface(ApplicationManager* application_manager,
43 const Identity& source, 43 const Identity& source,
44 const GURL& application_url, 44 const GURL& application_url,
45 InterfacePtr<Interface>* ptr) { 45 InterfacePtr<Interface>* ptr) {
46 ScopedMessagePipeHandle service_handle = ConnectToInterfaceByName( 46 ScopedMessagePipeHandle service_handle = ConnectToInterfaceByName(
47 application_manager, source, 47 application_manager, source,
48 Identity(application_url, std::string(), mojom::Shell::kUserInherit, 48 Identity(application_url, std::string(), mojom::Connector::kUserInherit,
49 GetPermissiveCapabilityFilter()), 49 GetPermissiveCapabilityFilter()),
50 Interface::Name_); 50 Interface::Name_);
51 ptr->Bind(InterfacePtrInfo<Interface>(std::move(service_handle), 0u)); 51 ptr->Bind(InterfacePtrInfo<Interface>(std::move(service_handle), 0u));
52 } 52 }
53 53
54 } // namespace shell 54 } // namespace shell
55 } // namespace mojo 55 } // namespace mojo
56 56
57 57
58 #endif // MOJO_SHELL_CONNECT_UTIL_H_ 58 #endif // MOJO_SHELL_CONNECT_UTIL_H_
OLDNEW
« no previous file with comments | « mojo/shell/connect_params.cc ('k') | mojo/shell/identity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698