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

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

Issue 2511403003: Send IndexedDB observations through IDBDatabaseCallbacks. (Closed)
Patch Set: Remove unnecessary forward declaration. 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_enum_traits.h ('k') | content/common/indexed_db/indexed_db_messages.h » ('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.cc
diff --git a/content/common/indexed_db/indexed_db_enum_traits.cc b/content/common/indexed_db/indexed_db_enum_traits.cc
index 8c8633419abb673675e11f71dffbb5f9e10ad992..54e12b6564ca243fc0093d1daae6407243043957 100644
--- a/content/common/indexed_db/indexed_db_enum_traits.cc
+++ b/content/common/indexed_db/indexed_db_enum_traits.cc
@@ -6,6 +6,7 @@
using indexed_db::mojom::CursorDirection;
using indexed_db::mojom::DataLoss;
+using indexed_db::mojom::OperationType;
using indexed_db::mojom::PutMode;
using indexed_db::mojom::TaskType;
using indexed_db::mojom::TransactionMode;
@@ -80,6 +81,47 @@ bool EnumTraits<DataLoss, blink::WebIDBDataLoss>::FromMojom(
}
// static
+OperationType EnumTraits<OperationType, blink::WebIDBOperationType>::ToMojom(
+ blink::WebIDBOperationType input) {
+ switch (input) {
+ case blink::WebIDBAdd:
+ return OperationType::Add;
+ case blink::WebIDBPut:
+ return OperationType::Put;
+ case blink::WebIDBDelete:
+ return OperationType::Delete;
+ case blink::WebIDBClear:
+ return OperationType::Clear;
+ case blink::WebIDBOperationTypeCount:
+ // WebIDBOperationTypeCount is not a valid option.
+ break;
+ }
+ NOTREACHED();
+ return OperationType::Add;
+}
+
+// static
+bool EnumTraits<OperationType, blink::WebIDBOperationType>::FromMojom(
+ OperationType input,
+ blink::WebIDBOperationType* output) {
+ switch (input) {
+ case OperationType::Add:
+ *output = blink::WebIDBAdd;
+ return true;
+ case OperationType::Put:
+ *output = blink::WebIDBPut;
+ return true;
+ case OperationType::Delete:
+ *output = blink::WebIDBDelete;
+ return true;
+ case OperationType::Clear:
+ *output = blink::WebIDBClear;
+ return true;
+ }
+ return false;
+}
+
+// static
PutMode EnumTraits<PutMode, blink::WebIDBPutMode>::ToMojom(
blink::WebIDBPutMode input) {
switch (input) {
« no previous file with comments | « content/common/indexed_db/indexed_db_enum_traits.h ('k') | content/common/indexed_db/indexed_db_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698