summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-12 05:23:40 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-12 05:23:40 +0000
commitc97dd2f7c1b7b45d6ef2585a5e2a2df50583ad6f (patch)
treea92f9a6f526ffba1252d7808a1abb275c4839997 /content/renderer
parent2d8df2692fbcb40e273c3ec956124b37aca19070 (diff)
downloadchromium_src-c97dd2f7c1b7b45d6ef2585a5e2a2df50583ad6f.zip
chromium_src-c97dd2f7c1b7b45d6ef2585a5e2a2df50583ad6f.tar.gz
chromium_src-c97dd2f7c1b7b45d6ef2585a5e2a2df50583ad6f.tar.bz2
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
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/indexed_db_dispatcher.cc6
-rw-r--r--content/renderer/indexed_db_dispatcher.h5
-rw-r--r--content/renderer/renderer_webidbcursor_impl.cc24
-rw-r--r--content/renderer/renderer_webidbcursor_impl.h7
4 files changed, 24 insertions, 18 deletions
diff --git a/content/renderer/indexed_db_dispatcher.cc b/content/renderer/indexed_db_dispatcher.cc
index 40db683..aba628b 100644
--- a/content/renderer/indexed_db_dispatcher.cc
+++ b/content/renderer/indexed_db_dispatcher.cc
@@ -426,10 +426,12 @@ void IndexedDBDispatcher::OnSuccessSerializedScriptValue(
}
void IndexedDBDispatcher::OnSuccessOpenCursor(int32 repsonse_id,
- int32 object_id) {
+ int32 object_id, const IndexedDBKey& key, const IndexedDBKey& primaryKey,
+ const SerializedScriptValue& value) {
WebIDBCallbacks* callbacks =
pending_callbacks_.Lookup(repsonse_id);
- callbacks->onSuccess(new RendererWebIDBCursorImpl(object_id));
+ callbacks->onSuccess(new RendererWebIDBCursorImpl(object_id, key,
+ primaryKey, value));
pending_callbacks_.Remove(repsonse_id);
}
diff --git a/content/renderer/indexed_db_dispatcher.h b/content/renderer/indexed_db_dispatcher.h
index 1e0a404..059abc4 100644
--- a/content/renderer/indexed_db_dispatcher.h
+++ b/content/renderer/indexed_db_dispatcher.h
@@ -156,7 +156,10 @@ class IndexedDBDispatcher : public IPC::Channel::Listener {
void OnSuccessIDBDatabase(int32 response_id, int32 object_id);
void OnSuccessIndexedDBKey(int32 response_id, const IndexedDBKey& key);
void OnSuccessIDBTransaction(int32 response_id, int32 object_id);
- void OnSuccessOpenCursor(int32 response_id, int32 object_id);
+ void OnSuccessOpenCursor(int32 response_id, int32 object_id,
+ const IndexedDBKey& key,
+ const IndexedDBKey& primary_key,
+ const SerializedScriptValue& value);
void OnSuccessStringList(int32 response_id,
const std::vector<string16>& value);
void OnSuccessSerializedScriptValue(int32 response_id,
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::WebIDBCallbacks;
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 @@ unsigned short RendererWebIDBCursorImpl::direction() const {
}
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,
diff --git a/content/renderer/renderer_webidbcursor_impl.h b/content/renderer/renderer_webidbcursor_impl.h
index d7f4541..95e2fad 100644
--- a/content/renderer/renderer_webidbcursor_impl.h
+++ b/content/renderer/renderer_webidbcursor_impl.h
@@ -15,7 +15,9 @@
class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor {
public:
- RendererWebIDBCursorImpl(int32 idb_cursor_id);
+ RendererWebIDBCursorImpl(int32 idb_cursor_id, const IndexedDBKey& key,
+ const IndexedDBKey& primary_key,
+ const SerializedScriptValue& value);
virtual ~RendererWebIDBCursorImpl();
virtual unsigned short direction() const;
@@ -33,6 +35,9 @@ class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor {
private:
int32 idb_cursor_id_;
+ const IndexedDBKey key_;
+ const IndexedDBKey primary_key_;
+ const SerializedScriptValue value_;
};
#endif // CONTENT_RENDERER_RENDERER_WEBIDBCURSOR_IMPL_H_