OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_PROTOCOL_SESSION_PLUGIN_H_ | |
6 #define REMOTING_PROTOCOL_SESSION_PLUGIN_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/callback.h" | |
11 #include "remoting/protocol/jingle_messages.h" | |
12 #include "remoting/protocol/session.h" | |
13 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" | |
14 | |
15 namespace remoting { | |
16 namespace protocol { | |
17 | |
18 // An interface to attach data on an outgoing message or handle an incoming of | |
19 // message. The plugin data are designed to be optional, so this class won't | |
20 // impact a session generation. | |
21 class SessionPlugin { | |
Sergey Ulanov
2016/12/21 01:38:34
This interface allow plugins to send outgoing mess
Hzj_jie
2016/12/22 00:27:11
Currently we do not have such scenario, HostExperi
| |
22 public: | |
23 SessionPlugin(); | |
24 virtual ~SessionPlugin(); | |
25 | |
26 // Returns an XmlElement if the SessionPlugin requires to attach some data | |
27 // into the outgoing message. This function will be called after other | |
28 // components have finished generating messages, and have set the state and | |
29 // action. So |state| is the current session state, |action| is the current | |
30 // ActionType in message. | |
31 virtual std::unique_ptr<buzz::XmlElement> OnOutgoing( | |
32 Session::State state, | |
33 JingleMessage::ActionType action) = 0; | |
34 | |
35 // Handles messages in |attachments|. This function will be called before | |
36 // other components have handled the incoming message. So |state| is the last | |
37 // session state, |action| is the current ActionType in message. | |
38 virtual void OnIncoming(Session::State state, | |
39 JingleMessage::ActionType action, | |
Sergey Ulanov
2016/12/21 01:38:34
Do the implementation of this class really need to
Hzj_jie
2016/12/22 00:27:11
Session::State should be a must-have, it is needed
Sergey Ulanov
2016/12/23 00:14:51
The current version of that plugin makes assumptio
Hzj_jie
2016/12/24 00:09:54
I agree for HostExperimentSessionPlugin, this shou
Sergey Ulanov
2016/12/27 22:05:18
Not sure what's the problem here. SessionPlugin im
Hzj_jie
2016/12/27 23:21:08
My concern is the plugin may not only depend on it
Sergey Ulanov
2016/12/29 00:37:57
In the current implementation OnIncoming() and OnO
Hzj_jie
2016/12/29 03:07:56
Done.
| |
40 const buzz::XmlElement* attachments) = 0; | |
41 }; | |
42 | |
43 } // namespace protocol | |
44 } // namespace remoting | |
45 | |
46 #endif // REMOTING_PROTOCOL_SESSION_PLUGIN_H_ | |
OLD | NEW |