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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 const Closure& handler) = 0; | 88 const Closure& handler) = 0; |
89 | 89 |
90 // Returns the id of the remote application. For Connections created via | 90 // Returns the id of the remote application. For Connections created via |
91 // Shell::Connect(), this will not be determined until Connect()'s callback is | 91 // Shell::Connect(), this will not be determined until Connect()'s callback is |
92 // run, and this function will return false. Use AddRemoteIDCallback() to | 92 // run, and this function will return false. Use AddRemoteIDCallback() to |
93 // schedule a callback to be run when the remote application id is available. | 93 // schedule a callback to be run when the remote application id is available. |
94 // A value of Shell::kInvalidApplicationID indicates the connection has not | 94 // A value of Shell::kInvalidApplicationID indicates the connection has not |
95 // been established. | 95 // been established. |
96 virtual bool GetRemoteApplicationID(uint32_t* remote_id) const = 0; | 96 virtual bool GetRemoteApplicationID(uint32_t* remote_id) const = 0; |
97 | 97 |
98 // Returns the id of the deepest shell client factory used in connecting to | |
99 // the application. See GetRemoteApplicationID() for details about the return | |
100 // value. A |shell_client_factory_id| value of Shell::kInvalidApplicationID | |
101 // indicates no shell client factory was used in connecting to the | |
102 // application. | |
103 virtual bool GetRemoteShellClientFactoryID( | |
104 uint32_t* shell_client_factory_id) const = 0; | |
105 | |
106 // See description in GetRemoteApplicationID()/ | 98 // See description in GetRemoteApplicationID()/ |
107 // GetRemoteShellClientFactoryID(). If the ids are available, |callback| is | 99 // GetRemoteShellClientFactoryID(). If the ids are available, |callback| is |
108 // run immediately. | 100 // run immediately. |
109 virtual void AddRemoteIDCallback(const Closure& callback) = 0; | 101 virtual void AddRemoteIDCallback(const Closure& callback) = 0; |
110 | 102 |
111 // Returns true if the Shell allows |interface_name| to be exposed to the | 103 // Returns true if the Shell allows |interface_name| to be exposed to the |
112 // remote application. | 104 // remote application. |
113 virtual bool AllowsInterface(const std::string& interface_name) const = 0; | 105 virtual bool AllowsInterface(const std::string& interface_name) const = 0; |
114 | 106 |
115 // Returns the raw proxy to the remote application's InterfaceProvider | 107 // Returns the raw proxy to the remote application's InterfaceProvider |
116 // interface. Most applications will just use GetInterface() instead. | 108 // interface. Most applications will just use GetInterface() instead. |
117 // Caller does not take ownership. | 109 // Caller does not take ownership. |
118 virtual shell::mojom::InterfaceProvider* GetRemoteInterfaces() = 0; | 110 virtual shell::mojom::InterfaceProvider* GetRemoteInterfaces() = 0; |
119 | 111 |
120 protected: | 112 protected: |
121 virtual InterfaceRegistry* GetLocalRegistry() = 0; | 113 virtual InterfaceRegistry* GetLocalRegistry() = 0; |
122 | 114 |
123 virtual base::WeakPtr<Connection> GetWeakPtr() = 0; | 115 virtual base::WeakPtr<Connection> GetWeakPtr() = 0; |
124 }; | 116 }; |
125 | 117 |
126 } // namespace mojo | 118 } // namespace mojo |
127 | 119 |
128 #endif // MOJO_SHELL_PUBLIC_CPP_CONNECTION_H_ | 120 #endif // MOJO_SHELL_PUBLIC_CPP_CONNECTION_H_ |
OLD | NEW |