OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_EXPERIMENT_SESSION_PLUGIN_H_ | 5 #ifndef REMOTING_HOST_HOST_EXPERIMENT_SESSION_PLUGIN_H_ |
6 #define REMOTING_HOST_HOST_EXPERIMENT_SESSION_PLUGIN_H_ | 6 #define REMOTING_HOST_HOST_EXPERIMENT_SESSION_PLUGIN_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "remoting/protocol/session_plugin.h" | 11 #include "remoting/protocol/session_plugin.h" |
12 #include "third_party/webrtc/libjingle/xmllite/xmlelement.h" | 12 #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
15 | 15 |
16 // A SessionPlugin implementation to send host attributes to client, and | 16 // A SessionPlugin implementation to send host attributes to client, and |
17 // receives experiment settings. | 17 // receives experiment settings. |
18 class HostExperimentSessionPlugin : public protocol::SessionPlugin { | 18 class HostExperimentSessionPlugin : public protocol::SessionPlugin { |
19 public: | 19 public: |
20 using SessionPlugin::SessionPlugin; | 20 using SessionPlugin::SessionPlugin; |
21 | 21 |
22 // protocol::SessionPlug implementation. | 22 // protocol::SessionPlug implementation. |
23 std::unique_ptr<buzz::XmlElement> GetNextMessage() override; | 23 std::unique_ptr<buzz::XmlElement> GetNextMessage() override; |
24 | 24 |
25 void OnIncomingMessage(const buzz::XmlElement& attachments) override; | 25 void OnIncomingMessage(const buzz::XmlElement& attachments) override; |
26 | 26 |
27 // Whether we have received configuration from client. | 27 // Whether we have received configuration from client. |
28 bool configuration_received() const; | 28 bool configuration_received() const; |
29 | 29 |
30 // The configuration sent from client, may be empty. | 30 // The configuration sent from client, may be empty. |
31 const std::string& configuration() const; | 31 const std::string& configuration() const; |
32 | 32 |
33 private: | 33 private: |
34 bool attributes_sent_ = false; | 34 bool attributes_sent_ = false; |
35 bool configuration_received_ = false; | 35 bool configuration_received_ = false; |
36 std::string configuration_; | 36 std::string configuration_; |
37 }; | 37 }; |
38 | 38 |
39 } // namespace remoting | 39 } // namespace remoting |
40 | 40 |
41 #endif // REMOTING_HOST_HOST_EXPERIMENT_SESSION_PLUGIN_H_ | 41 #endif // REMOTING_HOST_HOST_EXPERIMENT_SESSION_PLUGIN_H_ |
OLD | NEW |