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

Side by Side Diff: webkit/glue/idb_bindings.cc

Issue 10041014: IndexedDB: API rename to allow return type of keyPath accessors to change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "webkit/glue/idb_bindings.h" 5 #include "webkit/glue/idb_bindings.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize dScriptValue.h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize dScriptValue.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
15 15
16 namespace webkit_glue { 16 namespace webkit_glue {
17 17
18 using WebKit::WebIDBKey; 18 using WebKit::WebIDBKey;
19 using WebKit::WebIDBKeyPath; 19 using WebKit::WebIDBKeyPath;
20 using WebKit::WebSerializedScriptValue; 20 using WebKit::WebSerializedScriptValue;
21 using WebKit::WebString;
21 22
22 bool IDBKeysFromValuesAndKeyPath( 23 bool IDBKeysFromValuesAndKeyPath(
23 const std::vector<WebSerializedScriptValue>& serialized_script_values, 24 const std::vector<WebSerializedScriptValue>& serialized_script_values,
24 const string16& idb_key_path, 25 const string16& idb_key_path,
25 std::vector<WebIDBKey>* values) { 26 std::vector<WebIDBKey>* values) {
26 WebIDBKeyPath web_idb_key_path = WebIDBKeyPath::create(idb_key_path); 27 WebIDBKeyPath web_idb_key_path =
28 WebIDBKeyPath::create(WebString(idb_key_path));
dgrogan 2012/04/18 01:56:35 You're going to change WebIDBKeyPath's parameter t
27 bool error = web_idb_key_path.parseError() != 0; 29 bool error = web_idb_key_path.parseError() != 0;
28 // When a parse error is encountered, no value is returned (null) 30 // When a parse error is encountered, no value is returned (null)
29 for (std::vector<WebSerializedScriptValue>::const_iterator i = 31 for (std::vector<WebSerializedScriptValue>::const_iterator i =
30 serialized_script_values.begin(); 32 serialized_script_values.begin();
31 i != serialized_script_values.end(); ++i) { 33 i != serialized_script_values.end(); ++i) {
32 if (error) { 34 if (error) {
33 values->push_back(WebIDBKey::createNull()); 35 values->push_back(WebIDBKey::createNull());
34 } else { 36 } else {
35 values->push_back( 37 values->push_back(
36 WebIDBKey::createFromValueAndKeyPath(*i, web_idb_key_path)); 38 WebIDBKey::createFromValueAndKeyPath(*i, web_idb_key_path));
37 } 39 }
38 } 40 }
39 return error; 41 return error;
40 } 42 }
41 43
42 WebSerializedScriptValue InjectIDBKey( 44 WebSerializedScriptValue InjectIDBKey(
43 const WebIDBKey& key, 45 const WebIDBKey& key,
44 const WebSerializedScriptValue& value, 46 const WebSerializedScriptValue& value,
45 const string16& idb_key_path) { 47 const string16& idb_key_path) {
46 return WebIDBKey::injectIDBKeyIntoSerializedValue( 48 return WebIDBKey::injectIDBKeyIntoSerializedValue(
47 key, value, WebIDBKeyPath::create(idb_key_path)); 49 key, value, WebIDBKeyPath::create(WebString(idb_key_path)));
48 } 50 }
49 51
50 } // namespace webkit_glue 52 } // namespace webkit_glue
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698