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

Unified Diff: webkit/glue/idb_bindings.cc

Issue 10204003: Use WebIDBKeyPath type in WebKit API, implement IndexedDBKeyPath type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move IndexedDBKeyPath to content namespace, formatting nits. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/idb_bindings.h ('k') | webkit/support/test_webkit_platform_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/idb_bindings.cc
diff --git a/webkit/glue/idb_bindings.cc b/webkit/glue/idb_bindings.cc
index b3d05415ecc9f545c69707352aef023a3b6344ee..57b8eb4c461a42bfa4c358c45b541bf04608523c 100644
--- a/webkit/glue/idb_bindings.cc
+++ b/webkit/glue/idb_bindings.cc
@@ -6,7 +6,6 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h"
@@ -20,37 +19,24 @@ using WebKit::WebIDBKeyPath;
using WebKit::WebSerializedScriptValue;
using WebKit::WebString;
-bool IDBKeysFromValuesAndKeyPath(
+void IDBKeysFromValuesAndKeyPath(
const std::vector<WebSerializedScriptValue>& serialized_script_values,
- const string16& idb_key_path,
+ const WebIDBKeyPath& idb_key_path,
std::vector<WebIDBKey>* values) {
- // TODO(jsbell): Remove the explicit coercion to WebString.
- // http://crbug.com/112308
- WebIDBKeyPath web_idb_key_path =
- WebIDBKeyPath::create(WebString(idb_key_path));
- bool error = web_idb_key_path.parseError() != 0;
- // When a parse error is encountered, no value is returned (null)
for (std::vector<WebSerializedScriptValue>::const_iterator i =
serialized_script_values.begin();
i != serialized_script_values.end(); ++i) {
- if (error) {
- values->push_back(WebIDBKey::createNull());
- } else {
- values->push_back(
- WebIDBKey::createFromValueAndKeyPath(*i, web_idb_key_path));
- }
+ values->push_back(
+ WebIDBKey::createFromValueAndKeyPath(*i, idb_key_path));
}
- return error;
}
WebSerializedScriptValue InjectIDBKey(
const WebIDBKey& key,
const WebSerializedScriptValue& value,
- const string16& idb_key_path) {
- // TODO(jsbell): Remove the explicit coercion to WebString.
- // http://crbug.com/112308
+ const WebIDBKeyPath& idb_key_path) {
return WebIDBKey::injectIDBKeyIntoSerializedValue(
- key, value, WebIDBKeyPath::create(WebString(idb_key_path)));
+ key, value, idb_key_path);
}
} // namespace webkit_glue
« no previous file with comments | « webkit/glue/idb_bindings.h ('k') | webkit/support/test_webkit_platform_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698