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: mojo/shell/connect_util.h

Issue 1354003002: Make CapabilityFilter be part of Identity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 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 unified diff | Download patch
« no previous file with comments | « mojo/shell/connect_to_application_params.cc ('k') | mojo/shell/connect_util.cc » ('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 "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h" 8 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h"
9 #include "third_party/mojo/src/mojo/public/cpp/system/handle.h" 9 #include "third_party/mojo/src/mojo/public/cpp/system/handle.h"
10 10
11 class GURL; 11 class GURL;
12 12
13 namespace mojo { 13 namespace mojo {
14 namespace shell { 14 namespace shell {
15 15
16 class ApplicationManager; 16 class ApplicationManager;
17 17
18 ScopedMessagePipeHandle ConnectToServiceByName( 18 ScopedMessagePipeHandle ConnectToServiceByName(
19 ApplicationManager* application_manager, 19 ApplicationManager* application_manager,
20 const GURL& application_url, 20 const GURL& application_url,
21 const std::string& interface_name); 21 const std::string& interface_name);
22 22
23 // Must only be used by shell internals and test code as it does not forward 23 // Must only be used by shell internals and test code as it does not forward
24 // capability filters. 24 // capability filters. Runs |application_url| with a permissive capability
25 // filter.
25 template <typename Interface> 26 template <typename Interface>
26 inline void ConnectToService(ApplicationManager* application_manager, 27 inline void ConnectToService(ApplicationManager* application_manager,
27 const GURL& application_url, 28 const GURL& application_url,
28 InterfacePtr<Interface>* ptr) { 29 InterfacePtr<Interface>* ptr) {
29 ScopedMessagePipeHandle service_handle = 30 ScopedMessagePipeHandle service_handle =
30 ConnectToServiceByName(application_manager, application_url, 31 ConnectToServiceByName(application_manager, application_url,
31 Interface::Name_); 32 Interface::Name_);
32 ptr->Bind(InterfacePtrInfo<Interface>(service_handle.Pass(), 0u)); 33 ptr->Bind(InterfacePtrInfo<Interface>(service_handle.Pass(), 0u));
33 } 34 }
34 35
35 } // namespace shell 36 } // namespace shell
36 } // namespace mojo 37 } // namespace mojo
37 38
38 39
39 #endif // MOJO_SHELL_CONNECT_UTIL_H_ 40 #endif // MOJO_SHELL_CONNECT_UTIL_H_
OLDNEW
« no previous file with comments | « mojo/shell/connect_to_application_params.cc ('k') | mojo/shell/connect_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698