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 COMPONENTS_MEDIA_ROUTER_ROUTE_MESSAGE_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_H_ | 6 #define COMPONENTS_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 // TODO(mfoltz): Replace with nearly-identical | 17 // TODO(mfoltz): Replace with nearly-identical |
18 // content::PresentationConnectionMessage. | 18 // content::PresentationConnectionMessage. |
19 struct RouteMessage { | 19 struct RouteMessage { |
20 enum Type { TEXT, BINARY } type = TEXT; | 20 enum Type { TEXT, BINARY } type = TEXT; |
21 // Used when the |type| is TEXT. | 21 // Used when the |type| is TEXT. |
22 base::Optional<std::string> text; | 22 base::Optional<std::string> text; |
23 // Used when the |type| is BINARY. | 23 // Used when the |type| is BINARY. |
24 base::Optional<std::vector<uint8_t>> binary; | 24 base::Optional<std::vector<uint8_t>> binary; |
25 | 25 |
26 RouteMessage(); | 26 RouteMessage(); |
27 RouteMessage(const RouteMessage& other); | 27 RouteMessage(const RouteMessage& other); |
28 ~RouteMessage(); | 28 ~RouteMessage(); |
29 | 29 |
30 std::string ToHumanReadableString() const; | 30 std::string ToHumanReadableString() const; |
31 }; | 31 }; |
32 | 32 |
33 } // namespace media_router | 33 } // namespace media_router |
34 | 34 |
35 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_MESSAGE_H_ | 35 #endif // COMPONENTS_MEDIA_ROUTER_ROUTE_MESSAGE_H_ |
OLD | NEW |