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 // Interface for Session plugins. Plugins allow to send and receive optional |
| 19 // information that is not essential for session handshake. Messages generated |
| 20 // by the plugins on one end of a connection are attached to the session |
| 21 // handshake messages and passed to the plugins on the other end. Plugins are |
| 22 // optional, i.e. Session doesn't need any plugins to connect successfully. |
| 23 class SessionPlugin { |
| 24 public: |
| 25 SessionPlugin() = default; |
| 26 virtual ~SessionPlugin() = default; |
| 27 |
| 28 // Returns an XmlElement if the SessionPlugin requires to attach some data |
| 29 // into the outgoing message. |
| 30 virtual std::unique_ptr<buzz::XmlElement> GetNextMessage() = 0; |
| 31 |
| 32 // Handles messages in |attachments|. |
| 33 virtual void OnIncomingMessage(const buzz::XmlElement& attachments) = 0; |
| 34 }; |
| 35 |
| 36 } // namespace protocol |
| 37 } // namespace remoting |
| 38 |
| 39 #endif // REMOTING_PROTOCOL_SESSION_PLUGIN_H_ |
OLD | NEW |