diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 13:34:02 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 13:34:02 +0000 |
commit | d5fbd539696b1b88a14060ec1e28da9b942ac0c5 (patch) | |
tree | 261eda13e6d840f4c48a8d76af2888129e91e8aa /chrome/renderer | |
parent | 378eba1a0a9b667759e27abbb1adfb38e55ffe9f (diff) | |
download | chromium_src-d5fbd539696b1b88a14060ec1e28da9b942ac0c5.zip chromium_src-d5fbd539696b1b88a14060ec1e28da9b942ac0c5.tar.gz chromium_src-d5fbd539696b1b88a14060ec1e28da9b942ac0c5.tar.bz2 |
Revert my revert of 60275 + don't do static casting + disable the tests for now.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3435022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/indexed_db_dispatcher.cc | 80 | ||||
-rw-r--r-- | chrome/renderer/indexed_db_dispatcher.h | 72 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbindex_impl.cc | 34 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbindex_impl.h | 12 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbobjectstore_impl.cc | 38 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbobjectstore_impl.h | 22 |
6 files changed, 166 insertions, 92 deletions
diff --git a/chrome/renderer/indexed_db_dispatcher.cc b/chrome/renderer/indexed_db_dispatcher.cc index 3ba6f08..813a4fc 100644 --- a/chrome/renderer/indexed_db_dispatcher.cc +++ b/chrome/renderer/indexed_db_dispatcher.cc @@ -150,8 +150,11 @@ void IndexedDBDispatcher::RequestIDBDatabaseSetVersion( } void IndexedDBDispatcher::RequestIDBIndexOpenObjectCursor( - const WebIDBKeyRange& idb_key_range, unsigned short direction, - WebIDBCallbacks* callbacks_ptr, int32 idb_index_id) { + const WebIDBKeyRange& idb_key_range, + unsigned short direction, + WebIDBCallbacks* callbacks_ptr, + int32 idb_index_id, + int transaction_id) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); ViewHostMsg_IDBIndexOpenCursor_Params params; params.response_id_ = pending_callbacks_.Add(callbacks.release()); @@ -160,13 +163,17 @@ void IndexedDBDispatcher::RequestIDBIndexOpenObjectCursor( params.key_flags_ = idb_key_range.flags(); params.direction_ = direction; params.idb_index_id_ = idb_index_id; + params.transaction_id_ = transaction_id; RenderThread::current()->Send( new ViewHostMsg_IDBIndexOpenObjectCursor(params)); } void IndexedDBDispatcher::RequestIDBIndexOpenCursor( - const WebIDBKeyRange& idb_key_range, unsigned short direction, - WebIDBCallbacks* callbacks_ptr, int32 idb_index_id) { + const WebIDBKeyRange& idb_key_range, + unsigned short direction, + WebIDBCallbacks* callbacks_ptr, + int32 idb_index_id, + int transaction_id) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); ViewHostMsg_IDBIndexOpenCursor_Params params; params.response_id_ = pending_callbacks_.Add(callbacks.release()); @@ -175,62 +182,79 @@ void IndexedDBDispatcher::RequestIDBIndexOpenCursor( params.key_flags_ = idb_key_range.flags(); params.direction_ = direction; params.idb_index_id_ = idb_index_id; + params.transaction_id_ = transaction_id; RenderThread::current()->Send( new ViewHostMsg_IDBIndexOpenCursor(params)); } void IndexedDBDispatcher::RequestIDBIndexGetObject( - const IndexedDBKey& key, WebKit::WebIDBCallbacks* callbacks_ptr, - int32 idb_index_id) { + const IndexedDBKey& key, + WebKit::WebIDBCallbacks* callbacks_ptr, + int32 idb_index_id, + int transaction_id) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); RenderThread::current()->Send( new ViewHostMsg_IDBIndexGetObject( - idb_index_id, pending_callbacks_.Add(callbacks.release()), key)); + idb_index_id, pending_callbacks_.Add(callbacks.release()), key, + transaction_id)); } void IndexedDBDispatcher::RequestIDBIndexGet( - const IndexedDBKey& key, WebKit::WebIDBCallbacks* callbacks_ptr, - int32 idb_index_id) { + const IndexedDBKey& key, + WebKit::WebIDBCallbacks* callbacks_ptr, + int32 idb_index_id, + int transaction_id) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); RenderThread::current()->Send( new ViewHostMsg_IDBIndexGet( - idb_index_id, pending_callbacks_.Add(callbacks.release()), key)); + idb_index_id, pending_callbacks_.Add(callbacks.release()), key, + transaction_id)); } void IndexedDBDispatcher::RequestIDBObjectStoreGet( - const IndexedDBKey& key, WebKit::WebIDBCallbacks* callbacks_ptr, - int32 idb_object_store_id) { + const IndexedDBKey& key, + WebKit::WebIDBCallbacks* callbacks_ptr, + int32 idb_object_store_id, + int transaction_id) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); RenderThread::current()->Send( new ViewHostMsg_IDBObjectStoreGet( idb_object_store_id, pending_callbacks_.Add(callbacks.release()), - key)); + key, transaction_id)); } void IndexedDBDispatcher::RequestIDBObjectStorePut( - const SerializedScriptValue& value, const IndexedDBKey& key, - bool add_only, WebKit::WebIDBCallbacks* callbacks_ptr, - int32 idb_object_store_id) { + const SerializedScriptValue& value, + const IndexedDBKey& key, + bool add_only, + WebKit::WebIDBCallbacks* callbacks_ptr, + int32 idb_object_store_id, + int transaction_id) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); - - RenderThread::current()->Send( - new ViewHostMsg_IDBObjectStorePut( - idb_object_store_id, pending_callbacks_.Add(callbacks.release()), - value, key, add_only)); + ViewHostMsg_IDBObjectStorePut_Params params; + params.idb_object_store_id_ = idb_object_store_id; + params.response_id_ = pending_callbacks_.Add(callbacks.release()); + params.serialized_value_ = value; + params.key_ = key; + params.add_only_ = add_only; + params.transaction_id_ = transaction_id; + RenderThread::current()->Send(new ViewHostMsg_IDBObjectStorePut(params)); } void IndexedDBDispatcher::RequestIDBObjectStoreRemove( - const IndexedDBKey& key, WebKit::WebIDBCallbacks* callbacks_ptr, - int32 idb_object_store_id) { + const IndexedDBKey& key, + WebKit::WebIDBCallbacks* callbacks_ptr, + int32 idb_object_store_id, + int transaction_id) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); RenderThread::current()->Send( new ViewHostMsg_IDBObjectStoreRemove( idb_object_store_id, pending_callbacks_.Add(callbacks.release()), - key)); + key, transaction_id)); } void IndexedDBDispatcher::RequestIDBObjectStoreCreateIndex( @@ -260,8 +284,11 @@ void IndexedDBDispatcher::RequestIDBObjectStoreRemoveIndex( } void IndexedDBDispatcher::RequestIDBObjectStoreOpenCursor( - const WebIDBKeyRange& idb_key_range, unsigned short direction, - WebIDBCallbacks* callbacks_ptr, int32 idb_object_store_id) { + const WebIDBKeyRange& idb_key_range, + unsigned short direction, + WebIDBCallbacks* callbacks_ptr, + int32 idb_object_store_id, + int transaction_id) { scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); ViewHostMsg_IDBObjectStoreOpenCursor_Params params; params.response_id_ = pending_callbacks_.Add(callbacks.release()); @@ -270,6 +297,7 @@ void IndexedDBDispatcher::RequestIDBObjectStoreOpenCursor( params.flags_ = idb_key_range.flags(); params.direction_ = direction; params.idb_object_store_id_ = idb_object_store_id; + params.transaction_id_ = transaction_id; RenderThread::current()->Send( new ViewHostMsg_IDBObjectStoreOpenCursor(params)); } diff --git a/chrome/renderer/indexed_db_dispatcher.h b/chrome/renderer/indexed_db_dispatcher.h index edf11b2..2868358 100644 --- a/chrome/renderer/indexed_db_dispatcher.h +++ b/chrome/renderer/indexed_db_dispatcher.h @@ -65,33 +65,44 @@ class IndexedDBDispatcher { int32 idb_database_id); void RequestIDBIndexOpenObjectCursor( - const WebKit::WebIDBKeyRange& idb_key_range, unsigned short direction, - WebKit::WebIDBCallbacks* callbacks, int32 idb_index_id); - - void RequestIDBIndexOpenCursor( - const WebKit::WebIDBKeyRange& idb_key_range, unsigned short direction, - WebKit::WebIDBCallbacks* callbacks, int32 idb_index_id); - - void RequestIDBIndexGetObject( - const IndexedDBKey& key, WebKit::WebIDBCallbacks* callbacks, - int32 idb_index_id); - - void RequestIDBIndexGet( - const IndexedDBKey& key, WebKit::WebIDBCallbacks* callbacks, - int32 idb_index_id); - - void RequestIDBObjectStoreGet( - const IndexedDBKey& key, WebKit::WebIDBCallbacks* callbacks, - int32 idb_object_store_id); - - void RequestIDBObjectStorePut( - const SerializedScriptValue& value, const IndexedDBKey& key, - bool add_only, WebKit::WebIDBCallbacks* callbacks, - int32 idb_object_store_id); - - void RequestIDBObjectStoreRemove( - const IndexedDBKey& key, WebKit::WebIDBCallbacks* callbacks, - int32 idb_object_store_id); + const WebKit::WebIDBKeyRange& idb_key_range, + unsigned short direction, + WebKit::WebIDBCallbacks* callbacks, + int32 idb_index_id, + int transaction_id); + + void RequestIDBIndexOpenCursor(const WebKit::WebIDBKeyRange& idb_key_range, + unsigned short direction, + WebKit::WebIDBCallbacks* callbacks, + int32 idb_index_id, + int transaction_id); + + void RequestIDBIndexGetObject(const IndexedDBKey& key, + WebKit::WebIDBCallbacks* callbacks, + int32 idb_index_id, + int transaction_id); + + void RequestIDBIndexGet(const IndexedDBKey& key, + WebKit::WebIDBCallbacks* callbacks, + int32 idb_index_id, + int transaction_id); + + void RequestIDBObjectStoreGet(const IndexedDBKey& key, + WebKit::WebIDBCallbacks* callbacks, + int32 idb_object_store_id, + int transaction_id); + + void RequestIDBObjectStorePut(const SerializedScriptValue& value, + const IndexedDBKey& key, + bool add_only, + WebKit::WebIDBCallbacks* callbacks, + int32 idb_object_store_id, + int transaction_id); + + void RequestIDBObjectStoreRemove(const IndexedDBKey& key, + WebKit::WebIDBCallbacks* callbacks, + int32 idb_object_store_id, + int transaction_id); void RequestIDBObjectStoreCreateIndex( const string16& name, const NullableString16& key_path, bool unique, @@ -102,8 +113,11 @@ class IndexedDBDispatcher { int32 idb_object_store_id); void RequestIDBObjectStoreOpenCursor( - const WebKit::WebIDBKeyRange& idb_key_range, unsigned short direction, - WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id); + const WebKit::WebIDBKeyRange& idb_key_range, + unsigned short direction, + WebKit::WebIDBCallbacks* callbacks, + int32 idb_object_store_id, + int transaction_id); void RequestIDBTransactionSetCallbacks( WebKit::WebIDBTransactionCallbacks* callbacks); diff --git a/chrome/renderer/renderer_webidbindex_impl.cc b/chrome/renderer/renderer_webidbindex_impl.cc index 5fa4115..5f9a36d 100644 --- a/chrome/renderer/renderer_webidbindex_impl.cc +++ b/chrome/renderer/renderer_webidbindex_impl.cc @@ -8,6 +8,7 @@ #include "chrome/common/render_messages.h" #include "chrome/renderer/render_thread.h" #include "chrome/renderer/indexed_db_dispatcher.h" +#include "chrome/renderer/renderer_webidbtransaction_impl.h" using WebKit::WebDOMStringList; using WebKit::WebString; @@ -55,34 +56,41 @@ bool RendererWebIDBIndexImpl::unique() const { void RendererWebIDBIndexImpl::openObjectCursor( const WebKit::WebIDBKeyRange& range, unsigned short direction, - WebKit::WebIDBCallbacks* callbacks) { + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction) { IndexedDBDispatcher* dispatcher = RenderThread::current()->indexed_db_dispatcher(); - dispatcher->RequestIDBIndexOpenObjectCursor(range, direction, - callbacks, idb_index_id_); + dispatcher->RequestIDBIndexOpenObjectCursor( + range, direction, callbacks, idb_index_id_, transaction.id()); } void RendererWebIDBIndexImpl::openCursor( const WebKit::WebIDBKeyRange& range, unsigned short direction, - WebKit::WebIDBCallbacks* callbacks) { + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction) { IndexedDBDispatcher* dispatcher = RenderThread::current()->indexed_db_dispatcher(); - dispatcher->RequestIDBIndexOpenCursor(range, direction, - callbacks, idb_index_id_); + dispatcher->RequestIDBIndexOpenCursor( + range, direction, callbacks, idb_index_id_, transaction.id()); } -void RendererWebIDBIndexImpl::getObject(const WebKit::WebIDBKey& key, - WebKit::WebIDBCallbacks* callbacks) { +void RendererWebIDBIndexImpl::getObject( + const WebKit::WebIDBKey& key, + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction) { IndexedDBDispatcher* dispatcher = RenderThread::current()->indexed_db_dispatcher(); - dispatcher->RequestIDBIndexGetObject(IndexedDBKey(key), callbacks, - idb_index_id_); + dispatcher->RequestIDBIndexGetObject( + IndexedDBKey(key), callbacks, idb_index_id_, transaction.id()); } -void RendererWebIDBIndexImpl::get(const WebKit::WebIDBKey& key, - WebKit::WebIDBCallbacks* callbacks) { +void RendererWebIDBIndexImpl::get( + const WebKit::WebIDBKey& key, + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction) { IndexedDBDispatcher* dispatcher = RenderThread::current()->indexed_db_dispatcher(); - dispatcher->RequestIDBIndexGet(IndexedDBKey(key), callbacks, idb_index_id_); + dispatcher->RequestIDBIndexGet( + IndexedDBKey(key), callbacks, idb_index_id_, transaction.id()); } diff --git a/chrome/renderer/renderer_webidbindex_impl.h b/chrome/renderer/renderer_webidbindex_impl.h index de77920..1faab64 100644 --- a/chrome/renderer/renderer_webidbindex_impl.h +++ b/chrome/renderer/renderer_webidbindex_impl.h @@ -22,14 +22,18 @@ class RendererWebIDBIndexImpl : public WebKit::WebIDBIndex { virtual bool unique() const; virtual void openObjectCursor(const WebKit::WebIDBKeyRange& range, unsigned short direction, - WebKit::WebIDBCallbacks* callbacks); + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction); virtual void openCursor(const WebKit::WebIDBKeyRange& range, unsigned short direction, - WebKit::WebIDBCallbacks* callbacks); + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction); virtual void getObject(const WebKit::WebIDBKey& key, - WebKit::WebIDBCallbacks* callbacks); + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction); virtual void get(const WebKit::WebIDBKey& key, - WebKit::WebIDBCallbacks* callbacks); + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction); private: int32 idb_index_id_; diff --git a/chrome/renderer/renderer_webidbobjectstore_impl.cc b/chrome/renderer/renderer_webidbobjectstore_impl.cc index d29a326..28c14f4 100644 --- a/chrome/renderer/renderer_webidbobjectstore_impl.cc +++ b/chrome/renderer/renderer_webidbobjectstore_impl.cc @@ -10,6 +10,7 @@ #include "chrome/renderer/indexed_db_dispatcher.h" #include "chrome/renderer/render_thread.h" #include "chrome/renderer/renderer_webidbindex_impl.h" +#include "chrome/renderer/renderer_webidbtransaction_impl.h" #include "third_party/WebKit/WebKit/chromium/public/WebDOMStringList.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBKey.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBKeyRange.h" @@ -61,30 +62,37 @@ WebDOMStringList RendererWebIDBObjectStoreImpl::indexNames() const { return web_result; } -void RendererWebIDBObjectStoreImpl::get(const WebIDBKey& key, - WebIDBCallbacks* callbacks) { +void RendererWebIDBObjectStoreImpl::get( + const WebIDBKey& key, + WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction) { IndexedDBDispatcher* dispatcher = RenderThread::current()->indexed_db_dispatcher(); - dispatcher->RequestIDBObjectStoreGet(IndexedDBKey(key), - callbacks, idb_object_store_id_); + dispatcher->RequestIDBObjectStoreGet( + IndexedDBKey(key), callbacks, idb_object_store_id_, transaction.id()); } void RendererWebIDBObjectStoreImpl::put( - const WebSerializedScriptValue& value, const WebIDBKey& key, bool add_only, - WebIDBCallbacks* callbacks) { + const WebSerializedScriptValue& value, + const WebIDBKey& key, + bool add_only, + WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction) { IndexedDBDispatcher* dispatcher = RenderThread::current()->indexed_db_dispatcher(); dispatcher->RequestIDBObjectStorePut( SerializedScriptValue(value), IndexedDBKey(key), add_only, callbacks, - idb_object_store_id_); + idb_object_store_id_, transaction.id()); } -void RendererWebIDBObjectStoreImpl::remove(const WebIDBKey& key, - WebIDBCallbacks* callbacks) { +void RendererWebIDBObjectStoreImpl::remove( + const WebIDBKey& key, + WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction) { IndexedDBDispatcher* dispatcher = RenderThread::current()->indexed_db_dispatcher(); - dispatcher->RequestIDBObjectStoreRemove(IndexedDBKey(key), callbacks, - idb_object_store_id_); + dispatcher->RequestIDBObjectStoreRemove( + IndexedDBKey(key), callbacks, idb_object_store_id_, transaction.id()); } void RendererWebIDBObjectStoreImpl::createIndex( @@ -118,9 +126,11 @@ void RendererWebIDBObjectStoreImpl::removeIndex(const WebString& name, void RendererWebIDBObjectStoreImpl::openCursor( const WebIDBKeyRange& idb_key_range, - unsigned short direction, WebIDBCallbacks* callbacks) { + unsigned short direction, WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction) { IndexedDBDispatcher* dispatcher = RenderThread::current()->indexed_db_dispatcher(); - dispatcher->RequestIDBObjectStoreOpenCursor(idb_key_range, direction, - callbacks, idb_object_store_id_); + dispatcher->RequestIDBObjectStoreOpenCursor( + idb_key_range, direction, callbacks, idb_object_store_id_, + transaction.id()); } diff --git a/chrome/renderer/renderer_webidbobjectstore_impl.h b/chrome/renderer/renderer_webidbobjectstore_impl.h index 88e5ad4..1cca553 100644 --- a/chrome/renderer/renderer_webidbobjectstore_impl.h +++ b/chrome/renderer/renderer_webidbobjectstore_impl.h @@ -29,21 +29,31 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { WebKit::WebString keyPath() const; WebKit::WebDOMStringList indexNames() const; - void get(const WebKit::WebIDBKey& key, WebKit::WebIDBCallbacks* callbacks); + void get(const WebKit::WebIDBKey& key, + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction); void put(const WebKit::WebSerializedScriptValue& value, - const WebKit::WebIDBKey& key, bool add_only, - WebKit::WebIDBCallbacks* callbacks); - void remove(const WebKit::WebIDBKey& key, WebKit::WebIDBCallbacks* callbacks); + const WebKit::WebIDBKey& key, + bool add_only, + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction); + void remove(const WebKit::WebIDBKey& key, + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction); void createIndex(const WebKit::WebString& name, - const WebKit::WebString& key_path, bool unique, + const WebKit::WebString& key_path, + bool unique, WebKit::WebIDBCallbacks* callbacks); // Transfers ownership of the WebIDBIndex to the caller. WebKit::WebIDBIndex* index(const WebKit::WebString& name); void removeIndex(const WebKit::WebString& name, WebKit::WebIDBCallbacks* callbacks); + void openCursor(const WebKit::WebIDBKeyRange& idb_key_range, - unsigned short direction, WebKit::WebIDBCallbacks* callbacks); + unsigned short direction, + WebKit::WebIDBCallbacks* callbacks, + const WebKit::WebIDBTransaction& transaction); private: int32 idb_object_store_id_; }; |