Consolidate key, primary key, value cursor messages.
When opening or advancing a cursor, send key, primary key, and value to the renderer in the cursor open message. Remove separate messages that retrieve them synchronously.
This improves the readSeq benchmark by ~65%.
This is the chrome side patch. It potentially needs the webkit patch at https://bugs.webkit.org/show_bug.cgi?id=69131 to go in first.
BUG=
TEST=new-run-webkit-tests --debug --chromium storage/indexeddb; loaded each cursor test into chrome manually
Review URL: http://codereview.chromium.org/7834006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105019 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/renderer/renderer_webidbcursor_impl.cc b/content/renderer/renderer_webidbcursor_impl.cc
index 4bf4ee1..1837e2f 100644
--- a/content/renderer/renderer_webidbcursor_impl.cc
+++ b/content/renderer/renderer_webidbcursor_impl.cc
@@ -13,8 +13,13 @@
using WebKit::WebIDBKey;
using WebKit::WebSerializedScriptValue;
-RendererWebIDBCursorImpl::RendererWebIDBCursorImpl(int32 idb_cursor_id)
- : idb_cursor_id_(idb_cursor_id) {
+RendererWebIDBCursorImpl::RendererWebIDBCursorImpl(int32 idb_cursor_id,
+ const IndexedDBKey& key, const IndexedDBKey& primary_key,
+ const SerializedScriptValue& value)
+ : idb_cursor_id_(idb_cursor_id),
+ key_(key),
+ primary_key_(primary_key),
+ value_(value) {
}
RendererWebIDBCursorImpl::~RendererWebIDBCursorImpl() {
@@ -34,24 +39,15 @@
}
WebIDBKey RendererWebIDBCursorImpl::key() const {
- IndexedDBKey key;
- RenderThreadImpl::current()->Send(
- new IndexedDBHostMsg_CursorKey(idb_cursor_id_, &key));
- return key;
+ return key_;
}
WebIDBKey RendererWebIDBCursorImpl::primaryKey() const {
- IndexedDBKey primaryKey;
- RenderThreadImpl::current()->Send(
- new IndexedDBHostMsg_CursorPrimaryKey(idb_cursor_id_, &primaryKey));
- return primaryKey;
+ return primary_key_;
}
WebSerializedScriptValue RendererWebIDBCursorImpl::value() const {
- SerializedScriptValue scriptValue;
- RenderThreadImpl::current()->Send(
- new IndexedDBHostMsg_CursorValue(idb_cursor_id_, &scriptValue));
- return scriptValue;
+ return value_;
}
void RendererWebIDBCursorImpl::update(const WebSerializedScriptValue& value,