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

Unified Diff: content/common/indexed_db/indexed_db_enum_traits.h

Issue 2507233002: Define EnumTraits for many IndexedDB enums. (Closed)
Patch Set: GCC doesn't trust exhaustive switch statements. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/indexed_db/indexed_db.typemap ('k') | content/common/indexed_db/indexed_db_enum_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/indexed_db/indexed_db_enum_traits.h
diff --git a/content/common/indexed_db/indexed_db_enum_traits.h b/content/common/indexed_db/indexed_db_enum_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..9677a3870b1b754c7932b5a6e68acbe64a6cdf8b
--- /dev/null
+++ b/content/common/indexed_db/indexed_db_enum_traits.h
@@ -0,0 +1,54 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_
+#define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_
+
+#include "content/common/indexed_db/indexed_db.mojom.h"
+#include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
+
+namespace mojo {
+
+template <>
+struct EnumTraits<indexed_db::mojom::CursorDirection,
+ blink::WebIDBCursorDirection> {
+ static indexed_db::mojom::CursorDirection ToMojom(
+ blink::WebIDBCursorDirection input);
+ static bool FromMojom(indexed_db::mojom::CursorDirection input,
+ blink::WebIDBCursorDirection* output);
+};
+
+template <>
+struct EnumTraits<indexed_db::mojom::DataLoss, blink::WebIDBDataLoss> {
+ static indexed_db::mojom::DataLoss ToMojom(blink::WebIDBDataLoss input);
+ static bool FromMojom(indexed_db::mojom::DataLoss input,
+ blink::WebIDBDataLoss* output);
+};
+
+template <>
+struct EnumTraits<indexed_db::mojom::PutMode, blink::WebIDBPutMode> {
+ static indexed_db::mojom::PutMode ToMojom(blink::WebIDBPutMode input);
+ static bool FromMojom(indexed_db::mojom::PutMode input,
+ blink::WebIDBPutMode* output);
+};
+
+template <>
+struct EnumTraits<indexed_db::mojom::TaskType, blink::WebIDBTaskType> {
+ static indexed_db::mojom::TaskType ToMojom(blink::WebIDBTaskType input);
+ static bool FromMojom(indexed_db::mojom::TaskType input,
+ blink::WebIDBTaskType* output);
+};
+
+template <>
+struct EnumTraits<indexed_db::mojom::TransactionMode,
+ blink::WebIDBTransactionMode> {
+ static indexed_db::mojom::TransactionMode ToMojom(
+ blink::WebIDBTransactionMode input);
+ static bool FromMojom(indexed_db::mojom::TransactionMode input,
+ blink::WebIDBTransactionMode* output);
+};
+
+} // namespace mojo
+
+#endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_ENUM_TRAITS_H_
« no previous file with comments | « content/common/indexed_db/indexed_db.typemap ('k') | content/common/indexed_db/indexed_db_enum_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698