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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "third_party/WebKit/public/platform/WebVector.h" | 8 #include "third_party/WebKit/public/platform/WebVector.h" |
9 | 9 |
10 using blink::WebIDBKey; | 10 using blink::WebIDBKey; |
(...skipping 12 matching lines...) Expand all Loading... |
23 static content::IndexedDBKey::KeyArray CopyKeyArray(const WebIDBKey& other) { | 23 static content::IndexedDBKey::KeyArray CopyKeyArray(const WebIDBKey& other) { |
24 content::IndexedDBKey::KeyArray result; | 24 content::IndexedDBKey::KeyArray result; |
25 if (other.keyType() == WebIDBKeyTypeArray) { | 25 if (other.keyType() == WebIDBKeyTypeArray) { |
26 const WebVector<WebIDBKey>& array = other.array(); | 26 const WebVector<WebIDBKey>& array = other.array(); |
27 for (size_t i = 0; i < array.size(); ++i) | 27 for (size_t i = 0; i < array.size(); ++i) |
28 result.push_back(content::IndexedDBKeyBuilder::Build(array[i])); | 28 result.push_back(content::IndexedDBKeyBuilder::Build(array[i])); |
29 } | 29 } |
30 return result; | 30 return result; |
31 } | 31 } |
32 | 32 |
33 static std::vector<string16> CopyArray( | 33 static std::vector<base::string16> CopyArray( |
34 const WebVector<WebString>& array) { | 34 const WebVector<WebString>& array) { |
35 std::vector<string16> copy(array.size()); | 35 std::vector<base::string16> copy(array.size()); |
36 for (size_t i = 0; i < array.size(); ++i) | 36 for (size_t i = 0; i < array.size(); ++i) |
37 copy[i] = array[i]; | 37 copy[i] = array[i]; |
38 return copy; | 38 return copy; |
39 } | 39 } |
40 | 40 |
41 | 41 |
42 namespace content { | 42 namespace content { |
43 | 43 |
44 IndexedDBKey IndexedDBKeyBuilder::Build(const blink::WebIDBKey& key) { | 44 IndexedDBKey IndexedDBKeyBuilder::Build(const blink::WebIDBKey& key) { |
45 switch (key.keyType()) { | 45 switch (key.keyType()) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 case blink::WebIDBKeyPathTypeArray: | 128 case blink::WebIDBKeyPathTypeArray: |
129 return blink::WebIDBKeyPath::create(CopyArray(key_path.array())); | 129 return blink::WebIDBKeyPath::create(CopyArray(key_path.array())); |
130 case blink::WebIDBKeyPathTypeNull: | 130 case blink::WebIDBKeyPathTypeNull: |
131 return blink::WebIDBKeyPath::createNull(); | 131 return blink::WebIDBKeyPath::createNull(); |
132 } | 132 } |
133 NOTREACHED(); | 133 NOTREACHED(); |
134 return blink::WebIDBKeyPath::createNull(); | 134 return blink::WebIDBKeyPath::createNull(); |
135 } | 135 } |
136 | 136 |
137 } // namespace content | 137 } // namespace content |
OLD | NEW |