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

Side by Side Diff: content/browser/indexed_db/indexed_db_struct_traits.cc

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some (incomplete) work on struct traits. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/indexed_db/indexed_db_struct_traits.h"
6
7 using indexed_db::mojom::KeyPathType;
8
9 namespace mojo {
10
11 KeyPathType EnumTraits<KeyPathType, blink::WebIDBKeyPathType>::ToMojom(
12 blink::WebIDBKeyPathType input) {
13 switch (input) {
14 case blink::WebIDBKeyPathTypeNull:
15 return KeyPathType::NONE;
16 case blink::WebIDBKeyPathTypeString:
17 return KeyPathType::STRING;
18 case blink::WebIDBKeyPathTypeArray:
19 return KeyPathType::ARRAY;
20 }
21
22 NOTREACHED();
23 return KeyPathType::NONE;
24 }
25
26 bool EnumTraits<KeyPathType, blink::WebIDBKeyPathType>::FromMojom(
27 KeyPathType input,
28 blink::WebIDBKeyPathType* output) {
29 switch (input) {
30 case KeyPathType::NONE:
31 *output = blink::WebIDBKeyPathTypeNull;
32 return true;
33 case KeyPathType::STRING:
34 *output = blink::WebIDBKeyPathTypeString;
35 return true;
36 case KeyPathType::ARRAY:
37 *output = blink::WebIDBKeyPathTypeArray;
38 return true;
39 }
40
41 NOTREACHED();
42 return false;
43 }
44
45 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698