feedback_data.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2018 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. #ifndef REMOTING_CLIENT_FEEDBACK_DATA_H_
  5. #define REMOTING_CLIENT_FEEDBACK_DATA_H_
  6. #include <map>
  7. #include <string>
  8. #include "remoting/base/chromoting_event.h"
  9. namespace remoting {
  10. // Class that stores additional data to be sent with the user feedback.
  11. class FeedbackData {
  12. public:
  13. enum class Key {
  14. SESSION_PREVIOUS_STATE,
  15. SESSION_STATE,
  16. SESSION_ERROR,
  17. SESSION_MODE,
  18. SESSION_CREDENTIALS_TYPE,
  19. SESSION_HOST_OS,
  20. SESSION_HOST_OS_VERSION,
  21. SESSION_HOST_VERSION,
  22. SESSION_PERFORMANCE_STATS,
  23. SESSION_PEER_CONNECTION_STATS,
  24. };
  25. FeedbackData();
  26. FeedbackData(const FeedbackData&) = delete;
  27. FeedbackData& operator=(const FeedbackData&) = delete;
  28. ~FeedbackData();
  29. void SetData(Key key, const std::string& data);
  30. void FillWithChromotingEvent(const ChromotingEvent& event);
  31. const std::map<Key, std::string>& data() const { return data_; }
  32. static std::string KeyToString(Key key);
  33. private:
  34. std::map<Key, std::string> data_;
  35. };
  36. } // namespace remoting
  37. #endif // REMOTING_CLIENT_FEEDBACK_DATA_H_