OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 "webkit/glue/idb_bindings.h" | |
6 | |
7 #include "base/basictypes.h" | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/utf_string_conversions.h" | |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" | |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" | |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" | |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | |
14 | |
15 namespace webkit_glue { | |
16 | |
17 using WebKit::WebIDBKey; | |
18 using WebKit::WebIDBKeyPath; | |
19 using WebKit::WebSerializedScriptValue; | |
20 using WebKit::WebString; | |
21 | |
22 void IDBKeysFromValuesAndKeyPath( | |
23 const std::vector<WebSerializedScriptValue>& serialized_script_values, | |
24 const WebIDBKeyPath& idb_key_path, | |
25 std::vector<WebIDBKey>* values) { | |
26 for (std::vector<WebSerializedScriptValue>::const_iterator i = | |
27 serialized_script_values.begin(); | |
28 i != serialized_script_values.end(); ++i) { | |
29 values->push_back( | |
30 WebIDBKey::createFromValueAndKeyPath(*i, idb_key_path)); | |
31 } | |
32 } | |
33 | |
34 WebSerializedScriptValue InjectIDBKey( | |
35 const WebIDBKey& key, | |
36 const WebSerializedScriptValue& value, | |
37 const WebIDBKeyPath& idb_key_path) { | |
38 return WebIDBKey::injectIDBKeyIntoSerializedValue( | |
39 key, value, idb_key_path); | |
40 } | |
41 | |
42 } // namespace webkit_glue | |
OLD | NEW |