| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |