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_APPLICATION_PUBLIC_CPP_APPLICATION_CONNECTION_H_ | 5 #ifndef MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_CONNECTION_H_ |
6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_CONNECTION_H_ | 6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_CONNECTION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 // Returns the local application's ServiceProvider interface. The return | 110 // Returns the local application's ServiceProvider interface. The return |
111 // value is owned by this connection. | 111 // value is owned by this connection. |
112 virtual ServiceProvider* GetLocalServiceProvider() = 0; | 112 virtual ServiceProvider* GetLocalServiceProvider() = 0; |
113 | 113 |
114 // Register a handler to receive an error notification on the pipe to the | 114 // Register a handler to receive an error notification on the pipe to the |
115 // remote application's service provider. | 115 // remote application's service provider. |
116 virtual void SetRemoteServiceProviderConnectionErrorHandler( | 116 virtual void SetRemoteServiceProviderConnectionErrorHandler( |
117 const Closure& handler) = 0; | 117 const Closure& handler) = 0; |
118 | 118 |
| 119 // Returns the id of the deepest content handler used in connecting to |
| 120 // the application. If the content handler id has not yet been determined |
| 121 // this returns false, use AddContentHandlerIDCallback() to schedule a |
| 122 // callback when the content handler is has been obtained. A value of 0 |
| 123 // indicates no content handler was used in connecting to the application. |
| 124 virtual bool GetContentHandlerID(uint32_t* content_handler_id) = 0; |
| 125 |
| 126 // See description in GetTargetID(). If the id of the content handler has |
| 127 // been obtained |callback| is run immediately. |
| 128 virtual void AddContentHandlerIDCallback(const Closure& callback) = 0; |
| 129 |
119 protected: | 130 protected: |
120 // Returns true if the connector was set, false if it was not set (e.g. by | 131 // Returns true if the connector was set, false if it was not set (e.g. by |
121 // some filtering policy preventing this interface from being exposed). | 132 // some filtering policy preventing this interface from being exposed). |
122 virtual bool SetServiceConnectorForName(ServiceConnector* service_connector, | 133 virtual bool SetServiceConnectorForName(ServiceConnector* service_connector, |
123 const std::string& name) = 0; | 134 const std::string& name) = 0; |
124 | 135 |
125 virtual base::WeakPtr<ApplicationConnection> GetWeakPtr() = 0; | 136 virtual base::WeakPtr<ApplicationConnection> GetWeakPtr() = 0; |
126 }; | 137 }; |
127 | 138 |
128 } // namespace mojo | 139 } // namespace mojo |
129 | 140 |
130 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_CONNECTION_H_ | 141 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_CONNECTION_H_ |
OLD | NEW |