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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBStructTraits.cpp

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring after Passing URLRequestContextGetter. Created 4 years, 4 months 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: third_party/WebKit/Source/modules/indexeddb/IDBStructTraits.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBStructTraits.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBStructTraits.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..735439743228912cefbeab4315d03130b75780b1
--- /dev/null
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBStructTraits.cpp
@@ -0,0 +1,42 @@
+// 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.
+
+#include "IDBStructTraits.h"
+
+using indexed_db::mojom::blink::DataLoss;
+
+namespace mojo {
+
+DataLoss EnumTraits<DataLoss, blink::WebIDBDataLoss>::ToMojom(
+ blink::WebIDBDataLoss input)
+{
+ switch (input) {
+ case blink::WebIDBDataLossNone:
+ return DataLoss::None;
+ case blink::WebIDBDataLossTotal:
+ return DataLoss::Total;
+ }
+
+ NOTREACHED();
+ return DataLoss::None;
+}
+
+bool EnumTraits<DataLoss, blink::WebIDBDataLoss>::FromMojom(
+ DataLoss input,
+ blink::WebIDBDataLoss* output)
+{
+ switch (input) {
+ case DataLoss::None:
+ *output = blink::WebIDBDataLossNone;
+ return true;
+ case DataLoss::Total:
+ *output = blink::WebIDBDataLossTotal;
+ return true;
+ }
+
+ NOTREACHED();
+ return false;
+}
+
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698