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

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

Issue 2509913002: Implement StructTraits for remaining IndexedDB IPC types. (Closed)
Patch Set: Fix compile error on GCC. 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
Index: content/common/indexed_db/indexed_db_struct_traits.h
diff --git a/content/common/indexed_db/indexed_db_struct_traits.h b/content/common/indexed_db/indexed_db_struct_traits.h
index 9cdc49c302fd2fbf9a1598f611e193c6abf5b23f..f69692bbf5dfc63e1e7498b7a16df2635d9c148b 100644
--- a/content/common/indexed_db/indexed_db_struct_traits.h
+++ b/content/common/indexed_db/indexed_db_struct_traits.h
@@ -6,11 +6,47 @@
#define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_STRUCT_TRAITS_H_
#include "content/common/indexed_db/indexed_db.mojom.h"
-#include "content/common/indexed_db/indexed_db_metadata.h"
namespace mojo {
template <>
+struct StructTraits<indexed_db::mojom::KeyDataView, content::IndexedDBKey> {
+ static indexed_db::mojom::KeyDataPtr data(const content::IndexedDBKey& key);
+ static bool Read(indexed_db::mojom::KeyDataView data,
+ content::IndexedDBKey* out);
+};
+
+template <>
+struct StructTraits<indexed_db::mojom::KeyPathDataView,
+ content::IndexedDBKeyPath> {
+ static indexed_db::mojom::KeyPathDataPtr data(
+ const content::IndexedDBKeyPath& key_path);
+ static bool Read(indexed_db::mojom::KeyPathDataView data,
+ content::IndexedDBKeyPath* out);
+};
+
+template <>
+struct StructTraits<indexed_db::mojom::KeyRangeDataView,
+ content::IndexedDBKeyRange> {
+ static const content::IndexedDBKey& lower(
+ const content::IndexedDBKeyRange& key_range) {
+ return key_range.lower();
+ }
+ static const content::IndexedDBKey& upper(
+ const content::IndexedDBKeyRange& key_range) {
+ return key_range.upper();
+ }
+ static bool lower_open(const content::IndexedDBKeyRange& key_range) {
+ return key_range.lower_open();
+ }
+ static bool upper_open(const content::IndexedDBKeyRange& key_range) {
+ return key_range.upper_open();
+ }
+ static bool Read(indexed_db::mojom::KeyRangeDataView data,
+ content::IndexedDBKeyRange* out);
+};
+
+template <>
struct StructTraits<indexed_db::mojom::IndexKeysDataView,
content::IndexedDBIndexKeys> {
static int64_t index_id(const content::IndexedDBIndexKeys& index_keys) {
« no previous file with comments | « content/common/indexed_db/indexed_db_param_traits.cc ('k') | content/common/indexed_db/indexed_db_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698