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 CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/optional.h" | 13 #include "base/optional.h" |
14 | 14 |
15 namespace media_router { | 15 namespace media_router { |
16 | 16 |
17 struct RouteMessage { | 17 struct RouteMessage { |
18 enum Type { TEXT, BINARY } type = TEXT; | 18 enum Type { TEXT, BINARY } type = TEXT; |
19 // Used when the |type| is TEXT. | 19 // Used when the |type| is TEXT. |
20 base::Optional<std::string> text; | 20 base::Optional<std::string> text; |
21 // Used when the |type| is BINARY. | 21 // Used when the |type| is BINARY. |
22 base::Optional<std::vector<uint8_t>> binary; | 22 base::Optional<std::vector<uint8_t>> binary; |
23 | 23 |
24 RouteMessage(); | 24 RouteMessage(); |
25 RouteMessage(const RouteMessage& other); | 25 RouteMessage(const RouteMessage& other); |
26 ~RouteMessage(); | 26 ~RouteMessage(); |
| 27 |
| 28 std::string ToHumanReadableString() const; |
27 }; | 29 }; |
28 | 30 |
29 } // namespace media_router | 31 } // namespace media_router |
30 | 32 |
31 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_H_ | 33 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_H_ |
OLD | NEW |