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. | |
Sergey Ulanov
2016/12/23 00:14:52
Suggest rewording:
// Interface for Session plugin
Hzj_jie
2016/12/24 00:09:55
Done.
| |
21 class SessionPlugin { | |
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( | |
Sergey Ulanov
2016/12/23 00:14:52
Maybe call it GetNextAttachment() or GetNextMessag
Hzj_jie
2016/12/24 00:09:55
Done.
| |
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, | |
Sergey Ulanov
2016/12/23 00:14:52
OnIncomingMessage
Hzj_jie
2016/12/24 00:09:55
Done.
| |
39 JingleMessage::ActionType action, | |
40 const buzz::XmlElement* attachments) = 0; | |
41 }; | |
42 | |
43 } // namespace protocol | |
44 } // namespace remoting | |
45 | |
46 #endif // REMOTING_PROTOCOL_SESSION_PLUGIN_H_ | |
OLD | NEW |