OLD | NEW |
(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 |
OLD | NEW |