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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // same as the value returned by GetRemoveApplicationName(). | 74 // same as the value returned by GetRemoveApplicationName(). |
75 virtual const std::string& GetConnectionName() = 0; | 75 virtual const std::string& GetConnectionName() = 0; |
76 | 76 |
77 // Returns the name identifying the remote application on this connection. | 77 // Returns the name identifying the remote application on this connection. |
78 virtual const std::string& GetRemoteApplicationName() = 0; | 78 virtual const std::string& GetRemoteApplicationName() = 0; |
79 | 79 |
80 // Returns the User ID for the remote application. Prior to the Connect() | 80 // Returns the User ID for the remote application. Prior to the Connect() |
81 // callback being fired, this will return the value passed via Connect(). | 81 // callback being fired, this will return the value passed via Connect(). |
82 // After the Connect() callback (call AddRemoteIDCallback to register one) | 82 // After the Connect() callback (call AddRemoteIDCallback to register one) |
83 // this will return the actual user id the shell ran the target as. | 83 // this will return the actual user id the shell ran the target as. |
84 virtual uint32_t GetRemoteUserID() const = 0; | 84 virtual const std::string& GetRemoteUserID() const = 0; |
85 | 85 |
86 // Register a handler to receive an error notification on the pipe to the | 86 // Register a handler to receive an error notification on the pipe to the |
87 // remote application's InterfaceProvider. | 87 // remote application's InterfaceProvider. |
88 virtual void SetRemoteInterfaceProviderConnectionErrorHandler( | 88 virtual void SetRemoteInterfaceProviderConnectionErrorHandler( |
89 const Closure& handler) = 0; | 89 const Closure& handler) = 0; |
90 | 90 |
91 // Returns the id of the remote application. For Connections created via | 91 // Returns the id of the remote application. For Connections created via |
92 // Shell::Connect(), this will not be determined until Connect()'s callback is | 92 // Shell::Connect(), this will not be determined until Connect()'s callback is |
93 // run, and this function will return false. Use AddRemoteIDCallback() to | 93 // run, and this function will return false. Use AddRemoteIDCallback() to |
94 // schedule a callback to be run when the remote application id is available. | 94 // schedule a callback to be run when the remote application id is available. |
(...skipping 17 matching lines...) Expand all Loading... |
112 | 112 |
113 protected: | 113 protected: |
114 virtual InterfaceRegistry* GetLocalRegistry() = 0; | 114 virtual InterfaceRegistry* GetLocalRegistry() = 0; |
115 | 115 |
116 virtual base::WeakPtr<Connection> GetWeakPtr() = 0; | 116 virtual base::WeakPtr<Connection> GetWeakPtr() = 0; |
117 }; | 117 }; |
118 | 118 |
119 } // namespace mojo | 119 } // namespace mojo |
120 | 120 |
121 #endif // MOJO_SHELL_PUBLIC_CPP_CONNECTION_H_ | 121 #endif // MOJO_SHELL_PUBLIC_CPP_CONNECTION_H_ |
OLD | NEW |