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_MOJO_MEDIA_ROUTER_STRUCT_TRAITS_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_STRUCT_TRAITS_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_STRUCT_TRAITS_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/media/router/mojo/media_router.mojom.h" | 10 #include "chrome/browser/media/router/mojo/media_router.mojom.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 | 13 |
14 template <> | 14 template <> |
15 struct StructTraits<media_router::mojom::RouteMessage, | 15 struct StructTraits<media_router::mojom::RouteMessageDataView, |
16 media_router::RouteMessage> { | 16 media_router::RouteMessage> { |
17 static media_router::mojom::RouteMessage::Type type( | 17 static media_router::mojom::RouteMessage::Type type( |
18 const media_router::RouteMessage& msg) { | 18 const media_router::RouteMessage& msg) { |
19 switch (msg.type) { | 19 switch (msg.type) { |
20 case media_router::RouteMessage::TEXT: | 20 case media_router::RouteMessage::TEXT: |
21 return media_router::mojom::RouteMessage::Type::TEXT; | 21 return media_router::mojom::RouteMessage::Type::TEXT; |
22 case media_router::RouteMessage::BINARY: | 22 case media_router::RouteMessage::BINARY: |
23 return media_router::mojom::RouteMessage::Type::BINARY; | 23 return media_router::mojom::RouteMessage::Type::BINARY; |
24 } | 24 } |
25 NOTREACHED(); | 25 NOTREACHED(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 default: | 61 default: |
62 return false; | 62 return false; |
63 } | 63 } |
64 return true; | 64 return true; |
65 } | 65 } |
66 }; | 66 }; |
67 | 67 |
68 } // namespace mojo | 68 } // namespace mojo |
69 | 69 |
70 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_STRUCT_TRAITS_H_ | 70 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_STRUCT_TRAITS_H_ |
OLD | NEW |