Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: remoting/protocol/session_plugin.h

Issue 2586403003: [Chromoting] Add SessionPlugin in JingleSession (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/protocol/session.h ('k') | remoting/protocol/session_plugin.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 {
22 public:
23 SessionPlugin();
24 virtual ~SessionPlugin();
25
26 // Attachs messages in |attachments|. This function will be called after other
Jamie 2016/12/20 23:29:21 s/Attachs/Attaches/
Hzj_jie 2016/12/21 01:54:44 Done.
27 // components have finished generating messages, and set the state and action.
Jamie 2016/12/20 23:29:21 s/and set/and have set/
Hzj_jie 2016/12/21 01:54:44 Done.
28 // So |state| is the current session state, |action| is the current ActionType
29 // in message.
30 virtual void OnSending(Session::State state,
Jamie 2016/12/20 23:29:21 I think On[Incoming|Outgoing]Message would be bett
Hzj_jie 2016/12/21 01:54:44 Done.
31 JingleMessage::ActionType action,
32 std::unique_ptr<buzz::XmlElement>* attachments) = 0;
Jamie 2016/12/20 23:29:21 Passing a pointer to a unique_ptr is a bit strange
Hzj_jie 2016/12/21 01:54:44 This function is a little bit different than Execu
33
34 // Handles messages in |attachments|. This function will be called before
35 // other components have handled the incoming message. So |state| is the last
36 // session state, |action| is the current ActionType in message.
37 virtual void OnReceiving(
38 Session::State state,
39 JingleMessage::ActionType action,
40 const std::unique_ptr<buzz::XmlElement>& attachments) = 0;
41
42 // Finds "attachments" tag from |tag|, returns null if the tag is not found.
43 static const buzz::XmlElement* FindAttachments(const buzz::XmlElement& tag);
44
45 // Creates a new "attachments" tag.
46 static std::unique_ptr<buzz::XmlElement> NewAttachments();
47 };
48
49 } // namespace protocol
50 } // namespace remoting
51
52 #endif // REMOTING_PROTOCOL_SESSION_PLUGIN_H_
OLDNEW
« no previous file with comments | « remoting/protocol/session.h ('k') | remoting/protocol/session_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698