OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_ | |
6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_ | |
7 | |
8 #include "content/common/indexed_db/indexed_db.mojom.h" | |
9 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" | |
10 | |
11 namespace mojo { | |
12 | |
13 template <> | |
14 struct EnumTraits<indexed_db::mojom::CursorDirection, | |
15 blink::WebIDBCursorDirection> { | |
16 static indexed_db::mojom::CursorDirection ToMojom( | |
17 blink::WebIDBCursorDirection input); | |
18 static bool FromMojom(indexed_db::mojom::CursorDirection input, | |
19 blink::WebIDBCursorDirection* output); | |
20 }; | |
21 | |
22 template <> | |
23 struct EnumTraits<indexed_db::mojom::DataLoss, blink::WebIDBDataLoss> { | |
24 static indexed_db::mojom::DataLoss ToMojom(blink::WebIDBDataLoss input); | |
25 static bool FromMojom(indexed_db::mojom::DataLoss input, | |
26 blink::WebIDBDataLoss* output); | |
27 }; | |
28 | |
29 template <> | |
30 struct EnumTraits<indexed_db::mojom::OperationType, | |
31 blink::WebIDBOperationType> { | |
32 static indexed_db::mojom::OperationType ToMojom( | |
33 blink::WebIDBOperationType input); | |
34 static bool FromMojom(indexed_db::mojom::OperationType input, | |
35 blink::WebIDBOperationType* output); | |
36 }; | |
37 | |
38 template <> | |
39 struct EnumTraits<indexed_db::mojom::PutMode, blink::WebIDBPutMode> { | |
40 static indexed_db::mojom::PutMode ToMojom(blink::WebIDBPutMode input); | |
41 static bool FromMojom(indexed_db::mojom::PutMode input, | |
42 blink::WebIDBPutMode* output); | |
43 }; | |
44 | |
45 template <> | |
46 struct EnumTraits<indexed_db::mojom::TaskType, blink::WebIDBTaskType> { | |
47 static indexed_db::mojom::TaskType ToMojom(blink::WebIDBTaskType input); | |
48 static bool FromMojom(indexed_db::mojom::TaskType input, | |
49 blink::WebIDBTaskType* output); | |
50 }; | |
51 | |
52 template <> | |
53 struct EnumTraits<indexed_db::mojom::TransactionMode, | |
54 blink::WebIDBTransactionMode> { | |
55 static indexed_db::mojom::TransactionMode ToMojom( | |
56 blink::WebIDBTransactionMode input); | |
57 static bool FromMojom(indexed_db::mojom::TransactionMode input, | |
58 blink::WebIDBTransactionMode* output); | |
59 }; | |
60 | |
61 } // namespace mojo | |
62 | |
63 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_ | |
OLD | NEW |