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 REMOTING_HOST_HOST_EXTENSION_H_ | 5 #ifndef REMOTING_HOST_HOST_EXTENSION_H_ |
6 #define REMOTING_HOST_HOST_EXTENSION_H_ | 6 #define REMOTING_HOST_HOST_EXTENSION_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/memory/scoped_ptr.h" | |
11 | 11 |
12 namespace remoting { | 12 namespace remoting { |
13 | 13 |
14 class ClientSessionControl; | 14 class ClientSessionControl; |
15 class HostExtensionSession; | 15 class HostExtensionSession; |
16 | 16 |
17 namespace protocol { | 17 namespace protocol { |
18 class ClientStub; | 18 class ClientStub; |
19 } | 19 } |
20 | 20 |
21 // Extends |ChromotingHost| with new functionality, and can use extension | 21 // Extends |ChromotingHost| with new functionality, and can use extension |
22 // messages to communicate with the client. | 22 // messages to communicate with the client. |
23 class HostExtension { | 23 class HostExtension { |
24 public: | 24 public: |
25 virtual ~HostExtension() {} | 25 virtual ~HostExtension() {} |
26 | 26 |
27 // Returns the name of the capability for this extension. This is merged into | 27 // Returns the name of the capability for this extension. This is merged into |
28 // the capabilities the host reports to the client, to determine whether a | 28 // the capabilities the host reports to the client, to determine whether a |
29 // HostExtensionSession should be created for a particular session. | 29 // HostExtensionSession should be created for a particular session. |
30 // Returning an empty string indicates that the extension is not associated | 30 // Returning an empty string indicates that the extension is not associated |
31 // with a capability. | 31 // with a capability. |
32 virtual std::string capability() const = 0; | 32 virtual std::string capability() const = 0; |
33 | 33 |
34 // Creates an extension session, which can handle extension messages for a | 34 // Creates an extension session, which can handle extension messages for a |
35 // client session. | 35 // client session. |
36 // |client_session_control| may be used to e.g. disconnect the session. | 36 // |client_session_control| may be used to e.g. disconnect the session. |
37 // |client_stub| may be used to send messages to the session. | 37 // |client_stub| may be used to send messages to the session. |
38 // Both interfaces are valid for the lifetime of the |HostExtensionSession|. | 38 // Both interfaces are valid for the lifetime of the |HostExtensionSession|. |
39 virtual scoped_ptr<HostExtensionSession> CreateExtensionSession( | 39 virtual std::unique_ptr<HostExtensionSession> CreateExtensionSession( |
40 ClientSessionControl* client_session_control, | 40 ClientSessionControl* client_session_control, |
41 protocol::ClientStub* client_stub) = 0; | 41 protocol::ClientStub* client_stub) = 0; |
42 }; | 42 }; |
43 | 43 |
44 } // namespace remoting | 44 } // namespace remoting |
45 | 45 |
46 #endif // REMOTING_HOST_HOST_EXTENSION_H_ | 46 #endif // REMOTING_HOST_HOST_EXTENSION_H_ |
OLD | NEW |