| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/child/indexed_db/indexed_db_key_builders.h" | 5 #include "content/child/indexed_db/indexed_db_key_builders.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 IndexedDBKeyRange IndexedDBKeyRangeBuilder::Build( | 102 IndexedDBKeyRange IndexedDBKeyRangeBuilder::Build( |
| 103 const WebIDBKeyRange& key_range) { | 103 const WebIDBKeyRange& key_range) { |
| 104 return IndexedDBKeyRange( | 104 return IndexedDBKeyRange( |
| 105 IndexedDBKeyBuilder::Build(key_range.lower()), | 105 IndexedDBKeyBuilder::Build(key_range.lower()), |
| 106 IndexedDBKeyBuilder::Build(key_range.upper()), | 106 IndexedDBKeyBuilder::Build(key_range.upper()), |
| 107 key_range.lowerOpen(), | 107 key_range.lowerOpen(), |
| 108 key_range.upperOpen()); | 108 key_range.upperOpen()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 WebIDBKeyRange WebIDBKeyRangeBuilder::Build( |
| 112 const IndexedDBKeyRange& key_range) { |
| 113 return WebIDBKeyRange(WebIDBKeyBuilder::Build(key_range.lower()), |
| 114 WebIDBKeyBuilder::Build(key_range.upper()), |
| 115 key_range.lower_open(), key_range.upper_open()); |
| 116 } |
| 117 |
| 111 IndexedDBKeyPath IndexedDBKeyPathBuilder::Build( | 118 IndexedDBKeyPath IndexedDBKeyPathBuilder::Build( |
| 112 const blink::WebIDBKeyPath& key_path) { | 119 const blink::WebIDBKeyPath& key_path) { |
| 113 switch (key_path.keyPathType()) { | 120 switch (key_path.keyPathType()) { |
| 114 case blink::WebIDBKeyPathTypeString: | 121 case blink::WebIDBKeyPathTypeString: |
| 115 return IndexedDBKeyPath(key_path.string()); | 122 return IndexedDBKeyPath(key_path.string()); |
| 116 case blink::WebIDBKeyPathTypeArray: | 123 case blink::WebIDBKeyPathTypeArray: |
| 117 return IndexedDBKeyPath(CopyArray(key_path.array())); | 124 return IndexedDBKeyPath(CopyArray(key_path.array())); |
| 118 case blink::WebIDBKeyPathTypeNull: | 125 case blink::WebIDBKeyPathTypeNull: |
| 119 return IndexedDBKeyPath(); | 126 return IndexedDBKeyPath(); |
| 120 default: | 127 default: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 132 return blink::WebIDBKeyPath::create(CopyArray(key_path.array())); | 139 return blink::WebIDBKeyPath::create(CopyArray(key_path.array())); |
| 133 case blink::WebIDBKeyPathTypeNull: | 140 case blink::WebIDBKeyPathTypeNull: |
| 134 return blink::WebIDBKeyPath::createNull(); | 141 return blink::WebIDBKeyPath::createNull(); |
| 135 default: | 142 default: |
| 136 NOTREACHED(); | 143 NOTREACHED(); |
| 137 return blink::WebIDBKeyPath::createNull(); | 144 return blink::WebIDBKeyPath::createNull(); |
| 138 } | 145 } |
| 139 } | 146 } |
| 140 | 147 |
| 141 } // namespace content | 148 } // namespace content |
| OLD | NEW |