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 CONTENT_COMMON_INDEXED_DB_INDEXED_DB_STRUCT_TRAITS_H_ | 5 #ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_STRUCT_TRAITS_H_ |
6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_STRUCT_TRAITS_H_ | 6 #define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_STRUCT_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 | 9 |
10 namespace mojo { | 10 namespace mojo { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 static MapValuesArrayView<int64_t, content::IndexedDBObjectStoreMetadata> | 133 static MapValuesArrayView<int64_t, content::IndexedDBObjectStoreMetadata> |
134 object_stores(const content::IndexedDBDatabaseMetadata& metadata) { | 134 object_stores(const content::IndexedDBDatabaseMetadata& metadata) { |
135 return MapValuesToArray(metadata.object_stores); | 135 return MapValuesToArray(metadata.object_stores); |
136 } | 136 } |
137 static bool Read(indexed_db::mojom::DatabaseMetadataDataView data, | 137 static bool Read(indexed_db::mojom::DatabaseMetadataDataView data, |
138 content::IndexedDBDatabaseMetadata* out); | 138 content::IndexedDBDatabaseMetadata* out); |
139 }; | 139 }; |
140 | 140 |
141 template <> | 141 template <> |
| 142 struct StructTraits<indexed_db::mojom::DataFormatVersionDataView, |
| 143 content::IndexedDBDataFormatVersion> { |
| 144 static uint64_t v8_version( |
| 145 const content::IndexedDBDataFormatVersion& version) { |
| 146 return version.v8_version(); |
| 147 } |
| 148 static uint64_t blink_version( |
| 149 const content::IndexedDBDataFormatVersion& version) { |
| 150 return version.blink_version(); |
| 151 } |
| 152 static bool Read(indexed_db::mojom::DataFormatVersionDataView data, |
| 153 content::IndexedDBDataFormatVersion* out); |
| 154 }; |
| 155 |
| 156 template <> |
142 struct EnumTraits<indexed_db::mojom::CursorDirection, | 157 struct EnumTraits<indexed_db::mojom::CursorDirection, |
143 blink::WebIDBCursorDirection> { | 158 blink::WebIDBCursorDirection> { |
144 static indexed_db::mojom::CursorDirection ToMojom( | 159 static indexed_db::mojom::CursorDirection ToMojom( |
145 blink::WebIDBCursorDirection input); | 160 blink::WebIDBCursorDirection input); |
146 static bool FromMojom(indexed_db::mojom::CursorDirection input, | 161 static bool FromMojom(indexed_db::mojom::CursorDirection input, |
147 blink::WebIDBCursorDirection* output); | 162 blink::WebIDBCursorDirection* output); |
148 }; | 163 }; |
149 | 164 |
150 template <> | 165 template <> |
151 struct EnumTraits<indexed_db::mojom::DataLoss, blink::WebIDBDataLoss> { | 166 struct EnumTraits<indexed_db::mojom::DataLoss, blink::WebIDBDataLoss> { |
(...skipping 30 matching lines...) Expand all Loading... |
182 blink::WebIDBTransactionMode> { | 197 blink::WebIDBTransactionMode> { |
183 static indexed_db::mojom::TransactionMode ToMojom( | 198 static indexed_db::mojom::TransactionMode ToMojom( |
184 blink::WebIDBTransactionMode input); | 199 blink::WebIDBTransactionMode input); |
185 static bool FromMojom(indexed_db::mojom::TransactionMode input, | 200 static bool FromMojom(indexed_db::mojom::TransactionMode input, |
186 blink::WebIDBTransactionMode* output); | 201 blink::WebIDBTransactionMode* output); |
187 }; | 202 }; |
188 | 203 |
189 } // namespace mojo | 204 } // namespace mojo |
190 | 205 |
191 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_STRUCT_TRAITS_H_ | 206 #endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_STRUCT_TRAITS_H_ |
OLD | NEW |