Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: content/common/indexed_db/indexed_db_enum_traits.h

Issue 2511403003: Send IndexedDB observations through IDBDatabaseCallbacks. (Closed)
Patch Set: Rebased. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_ 5 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_
6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_ 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_
7 7
8 #include "content/common/indexed_db/indexed_db.mojom.h" 8 #include "content/common/indexed_db/indexed_db.mojom.h"
9 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" 9 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 12
13 template <> 13 template <>
14 struct EnumTraits<indexed_db::mojom::CursorDirection, 14 struct EnumTraits<indexed_db::mojom::CursorDirection,
15 blink::WebIDBCursorDirection> { 15 blink::WebIDBCursorDirection> {
16 static indexed_db::mojom::CursorDirection ToMojom( 16 static indexed_db::mojom::CursorDirection ToMojom(
17 blink::WebIDBCursorDirection input); 17 blink::WebIDBCursorDirection input);
18 static bool FromMojom(indexed_db::mojom::CursorDirection input, 18 static bool FromMojom(indexed_db::mojom::CursorDirection input,
19 blink::WebIDBCursorDirection* output); 19 blink::WebIDBCursorDirection* output);
20 }; 20 };
21 21
22 template <> 22 template <>
23 struct EnumTraits<indexed_db::mojom::DataLoss, blink::WebIDBDataLoss> { 23 struct EnumTraits<indexed_db::mojom::DataLoss, blink::WebIDBDataLoss> {
24 static indexed_db::mojom::DataLoss ToMojom(blink::WebIDBDataLoss input); 24 static indexed_db::mojom::DataLoss ToMojom(blink::WebIDBDataLoss input);
25 static bool FromMojom(indexed_db::mojom::DataLoss input, 25 static bool FromMojom(indexed_db::mojom::DataLoss input,
26 blink::WebIDBDataLoss* output); 26 blink::WebIDBDataLoss* output);
27 }; 27 };
28 28
29 template <> 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 <>
30 struct EnumTraits<indexed_db::mojom::PutMode, blink::WebIDBPutMode> { 39 struct EnumTraits<indexed_db::mojom::PutMode, blink::WebIDBPutMode> {
31 static indexed_db::mojom::PutMode ToMojom(blink::WebIDBPutMode input); 40 static indexed_db::mojom::PutMode ToMojom(blink::WebIDBPutMode input);
32 static bool FromMojom(indexed_db::mojom::PutMode input, 41 static bool FromMojom(indexed_db::mojom::PutMode input,
33 blink::WebIDBPutMode* output); 42 blink::WebIDBPutMode* output);
34 }; 43 };
35 44
36 template <> 45 template <>
37 struct EnumTraits<indexed_db::mojom::TaskType, blink::WebIDBTaskType> { 46 struct EnumTraits<indexed_db::mojom::TaskType, blink::WebIDBTaskType> {
38 static indexed_db::mojom::TaskType ToMojom(blink::WebIDBTaskType input); 47 static indexed_db::mojom::TaskType ToMojom(blink::WebIDBTaskType input);
39 static bool FromMojom(indexed_db::mojom::TaskType input, 48 static bool FromMojom(indexed_db::mojom::TaskType input,
40 blink::WebIDBTaskType* output); 49 blink::WebIDBTaskType* output);
41 }; 50 };
42 51
43 template <> 52 template <>
44 struct EnumTraits<indexed_db::mojom::TransactionMode, 53 struct EnumTraits<indexed_db::mojom::TransactionMode,
45 blink::WebIDBTransactionMode> { 54 blink::WebIDBTransactionMode> {
46 static indexed_db::mojom::TransactionMode ToMojom( 55 static indexed_db::mojom::TransactionMode ToMojom(
47 blink::WebIDBTransactionMode input); 56 blink::WebIDBTransactionMode input);
48 static bool FromMojom(indexed_db::mojom::TransactionMode input, 57 static bool FromMojom(indexed_db::mojom::TransactionMode input,
49 blink::WebIDBTransactionMode* output); 58 blink::WebIDBTransactionMode* output);
50 }; 59 };
51 60
52 } // namespace mojo 61 } // namespace mojo
53 62
54 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_ 63 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698