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

Side by Side Diff: mojo/shell/public/cpp/connection.h

Issue 1781913003: Capability Classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@45class
Patch Set: . Created 4 years, 9 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 | « no previous file | mojo/shell/public/cpp/lib/connection_impl.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 2014 The Chromium Authors. All rights reserved. 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 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_PUBLIC_CPP_CONNECTION_H_ 5 #ifndef MOJO_SHELL_PUBLIC_CPP_CONNECTION_H_
6 #define MOJO_SHELL_PUBLIC_CPP_CONNECTION_H_ 6 #define MOJO_SHELL_PUBLIC_CPP_CONNECTION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 // Binds |ptr| to an implemention of Interface in the remote application. 77 // Binds |ptr| to an implemention of Interface in the remote application.
78 // |ptr| can immediately be used to start sending requests to the remote 78 // |ptr| can immediately be used to start sending requests to the remote
79 // interface. 79 // interface.
80 template <typename Interface> 80 template <typename Interface>
81 void GetInterface(InterfacePtr<Interface>* ptr) { 81 void GetInterface(InterfacePtr<Interface>* ptr) {
82 mojo::GetInterface(GetRemoteInterfaces(), ptr); 82 mojo::GetInterface(GetRemoteInterfaces(), ptr);
83 } 83 }
84 84
85 // Returns true if the remote application has the specified capability class
86 // specified in its manifest. Only valid for inbound connections. Will return
87 // false for outbound connections.
88 virtual bool HasCapabilityClass(const std::string& class_name) const = 0;
89
85 // Returns the name that was used by the source application to establish a 90 // Returns the name that was used by the source application to establish a
86 // connection to the destination application. 91 // connection to the destination application.
87 // 92 //
88 // When Connection is representing and outgoing connection, this will be the 93 // When Connection is representing and outgoing connection, this will be the
89 // same as the value returned by GetRemoveApplicationName(). 94 // same as the value returned by GetRemoveApplicationName().
90 virtual const std::string& GetConnectionName() = 0; 95 virtual const std::string& GetConnectionName() = 0;
91 96
92 // Returns the remote identity. While the connection is in the pending state, 97 // Returns the remote identity. While the connection is in the pending state,
93 // the user_id() field will be the value passed via Connect(). After the 98 // the user_id() field will be the value passed via Connect(). After the
94 // connection is completed, it will change to the value assigned by the shell. 99 // connection is completed, it will change to the value assigned by the shell.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 138
134 protected: 139 protected:
135 virtual InterfaceRegistry* GetLocalRegistry() = 0; 140 virtual InterfaceRegistry* GetLocalRegistry() = 0;
136 141
137 virtual base::WeakPtr<Connection> GetWeakPtr() = 0; 142 virtual base::WeakPtr<Connection> GetWeakPtr() = 0;
138 }; 143 };
139 144
140 } // namespace mojo 145 } // namespace mojo
141 146
142 #endif // MOJO_SHELL_PUBLIC_CPP_CONNECTION_H_ 147 #endif // MOJO_SHELL_PUBLIC_CPP_CONNECTION_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/shell/public/cpp/lib/connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698