diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-20 16:22:34 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-20 16:22:34 +0000 |
commit | 826161f8cb3f8963786aef897bbc8b90f0a43a92 (patch) | |
tree | ac2f47b87fa8a201bd1f3d0e267fa2b8adb9abe9 /chrome | |
parent | 1f79401611f73ac332233ce35ef1c29b7c7af0c2 (diff) | |
download | chromium_src-826161f8cb3f8963786aef897bbc8b90f0a43a92.zip chromium_src-826161f8cb3f8963786aef897bbc8b90f0a43a92.tar.gz chromium_src-826161f8cb3f8963786aef897bbc8b90f0a43a92.tar.bz2 |
Revert 56862 - Add transaction coordinator. Allow idle transactions to be aborted when their parent JS context finishes executing.
This change depends on the following WebKit bug:
https://bugs.webkit.org/show_bug.cgi?id=44101
Review URL: http://codereview.chromium.org/3165026
TBR=andreip@chromium.org
Review URL: http://codereview.chromium.org/3107029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/in_process_webkit/indexed_db_callbacks.h | 23 | ||||
-rw-r--r-- | chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc | 93 | ||||
-rw-r--r-- | chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h | 24 | ||||
-rw-r--r-- | chrome/chrome_renderer.gypi | 6 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 24 | ||||
-rw-r--r-- | chrome/renderer/indexed_db_dispatcher.cc | 15 | ||||
-rw-r--r-- | chrome/renderer/indexed_db_dispatcher.h | 7 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbdatabase_impl.cc | 17 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbdatabase_impl.h | 5 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbfactory_impl.cc | 10 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbfactory_impl.h | 3 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbtransaction_impl.cc | 60 | ||||
-rw-r--r-- | chrome/renderer/renderer_webidbtransaction_impl.h | 33 |
13 files changed, 4 insertions, 316 deletions
diff --git a/chrome/browser/in_process_webkit/indexed_db_callbacks.h b/chrome/browser/in_process_webkit/indexed_db_callbacks.h index e726e3a..5421fc6 100644 --- a/chrome/browser/in_process_webkit/indexed_db_callbacks.h +++ b/chrome/browser/in_process_webkit/indexed_db_callbacks.h @@ -15,7 +15,6 @@ #include "chrome/common/serialized_script_value.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBCallbacks.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBCursor.h" -#include "third_party/WebKit/WebKit/chromium/public/WebIDBTransactionCallbacks.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBDatabaseError.h" // Template magic to figure out what message to send to the renderer based on @@ -159,27 +158,5 @@ class IndexedDBCallbacks<void> : public IndexedDBCallbacksBase { DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); }; -class IndexedDBTransactionCallbacks - : public WebKit::WebIDBTransactionCallbacks { -public: - IndexedDBTransactionCallbacks( - IndexedDBDispatcherHost* dispatcher_host, int transaction_id) - : dispatcher_host_(dispatcher_host), transaction_id_(transaction_id) { - } - - virtual void onAbort() { - dispatcher_host_->Send(new ViewMsg_IDBTransactionCallbacksAbort( - transaction_id_)); - } - - virtual int id() const { - return transaction_id_; - } - -private: - int transaction_id_; - scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; -}; - #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ diff --git a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc index d0af866..9603530 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -20,9 +20,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebIDBIndex.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBFactory.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBObjectStore.h" -#include "third_party/WebKit/WebKit/chromium/public/WebIDBTransaction.h" #include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" -#include "third_party/WebKit/WebKit/chromium/public/WebVector.h" using WebKit::WebDOMStringList; using WebKit::WebIDBCursor; @@ -32,10 +30,8 @@ using WebKit::WebIDBIndex; using WebKit::WebIDBKey; using WebKit::WebIDBKeyRange; using WebKit::WebIDBObjectStore; -using WebKit::WebIDBTransaction; using WebKit::WebSecurityOrigin; using WebKit::WebSerializedScriptValue; -using WebKit::WebVector; IndexedDBDispatcherHost::IndexedDBDispatcherHost( IPC::Message::Sender* sender, WebKitContext* webkit_context) @@ -49,8 +45,6 @@ IndexedDBDispatcherHost::IndexedDBDispatcherHost( new ObjectStoreDispatcherHost(this))), ALLOW_THIS_IN_INITIALIZER_LIST(cursor_dispatcher_host_( new CursorDispatcherHost(this))), - ALLOW_THIS_IN_INITIALIZER_LIST(transaction_dispatcher_host_( - new TransactionDispatcherHost(this))), process_handle_(0) { DCHECK(sender_); DCHECK(webkit_context_.get()); @@ -98,7 +92,6 @@ bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message) { case ViewHostMsg_IDBCursorKey::ID: case ViewHostMsg_IDBCursorValue::ID: case ViewHostMsg_IDBFactoryOpen::ID: - case ViewHostMsg_IDBFactoryAbortPendingTransactions::ID: case ViewHostMsg_IDBDatabaseName::ID: case ViewHostMsg_IDBDatabaseDescription::ID: case ViewHostMsg_IDBDatabaseVersion::ID: @@ -106,7 +99,6 @@ bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message) { case ViewHostMsg_IDBDatabaseCreateObjectStore::ID: case ViewHostMsg_IDBDatabaseObjectStore::ID: case ViewHostMsg_IDBDatabaseRemoveObjectStore::ID: - case ViewHostMsg_IDBDatabaseTransaction::ID: case ViewHostMsg_IDBDatabaseDestroyed::ID: case ViewHostMsg_IDBIndexName::ID: case ViewHostMsg_IDBIndexKeyPath::ID: @@ -123,7 +115,6 @@ bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message) { case ViewHostMsg_IDBObjectStoreIndex::ID: case ViewHostMsg_IDBObjectStoreRemoveIndex::ID: case ViewHostMsg_IDBObjectStoreDestroyed::ID: - case ViewHostMsg_IDBTransactionDestroyed::ID: break; default: return false; @@ -168,8 +159,7 @@ void IndexedDBDispatcherHost::OnMessageReceivedWebKit( database_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || index_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || object_store_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || - cursor_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || - transaction_dispatcher_host_->OnMessageReceived(message, &msg_is_ok); + cursor_dispatcher_host_->OnMessageReceived(message, &msg_is_ok); if (!handled) { handled = true; @@ -177,8 +167,6 @@ void IndexedDBDispatcherHost::OnMessageReceivedWebKit( IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost, message, msg_is_ok) IPC_MESSAGE_HANDLER(ViewHostMsg_IDBFactoryOpen, OnIDBFactoryOpen) - IPC_MESSAGE_HANDLER(ViewHostMsg_IDBFactoryAbortPendingTransactions, - OnIDBFactoryAbortPendingTransactions) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() } @@ -206,11 +194,6 @@ int32 IndexedDBDispatcherHost::Add(WebIDBObjectStore* idb_object_store) { return object_store_dispatcher_host_->map_.Add(idb_object_store); } -void IndexedDBDispatcherHost::Add(WebIDBTransaction* idb_transaction) { - transaction_dispatcher_host_->map_.AddWithID( - idb_transaction, idb_transaction->id()); -} - void IndexedDBDispatcherHost::OnIDBFactoryOpen( const ViewHostMsg_IDBFactoryOpen_Params& params) { // TODO(jorlow): Check the content settings map and use params.routing_id_ @@ -223,14 +206,6 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen( WebSecurityOrigin::createFromDatabaseIdentifier(params.origin_), NULL); } -void IndexedDBDispatcherHost::OnIDBFactoryAbortPendingTransactions( - const std::vector<int32>& ids) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); - - WebVector<int32> pendingIDs = ids; - Context()->GetIDBFactory()->abortPendingTransactions(pendingIDs); -} - ////////////////////////////////////////////////////////////////////// // Helper templates. // @@ -302,8 +277,6 @@ bool IndexedDBDispatcherHost::DatabaseDispatcherHost::OnMessageReceived( OnObjectStore) IPC_MESSAGE_HANDLER(ViewHostMsg_IDBDatabaseRemoveObjectStore, OnRemoveObjectStore) - IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseTransaction, - OnTransaction) IPC_MESSAGE_HANDLER(ViewHostMsg_IDBDatabaseDestroyed, OnDestroyed) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() @@ -395,31 +368,6 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnRemoveObjectStore( name, new IndexedDBCallbacks<WebIDBObjectStore>(parent_, response_id)); } -void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnTransaction( - int32 idb_database_id, const std::vector<string16>& names, - int32 mode, int32 timeout, IPC::Message* reply_msg) { - WebIDBDatabase* database = parent_->GetOrTerminateProcess( - &map_, idb_database_id, reply_msg, - ViewHostMsg_IDBDatabaseTransaction::ID); - if (!database) - return; - - WebDOMStringList object_stores; - for (std::vector<string16>::const_iterator it = names.begin(); - it != names.end(); ++it) { - object_stores.append(*it); - } - - WebIDBTransaction* transaction = database->transaction( - object_stores, mode, timeout); - transaction->setCallbacks( - new IndexedDBTransactionCallbacks(parent_, transaction->id())); - parent_->Add(transaction); - ViewHostMsg_IDBDatabaseTransaction::WriteReplyParams( - reply_msg, transaction->id()); - parent_->Send(reply_msg); -} - void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed( int32 object_id) { parent_->DestroyObject(&map_, object_id, @@ -667,7 +615,6 @@ bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived( return handled; } - void IndexedDBDispatcherHost::CursorDispatcherHost::Send( IPC::Message* message) { // The macro magic in OnMessageReceived requires this to link, but it should @@ -735,41 +682,3 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( parent_->DestroyObject( &map_, object_id, ViewHostMsg_IDBCursorDestroyed::ID); } - -////////////////////////////////////////////////////////////////////// -// IndexedDBDispatcherHost::TransactionDispatcherHost -// - -IndexedDBDispatcherHost::TransactionDispatcherHost::TransactionDispatcherHost( - IndexedDBDispatcherHost* parent) - : parent_(parent) { -} - -IndexedDBDispatcherHost:: - TransactionDispatcherHost::~TransactionDispatcherHost() { -} - -bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived( - const IPC::Message& message, bool* msg_is_ok) { - bool handled = true; - IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::TransactionDispatcherHost, - message, *msg_is_ok) - IPC_MESSAGE_HANDLER(ViewHostMsg_IDBTransactionDestroyed, OnDestroyed) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() - return handled; -} - -void IndexedDBDispatcherHost::TransactionDispatcherHost::Send( - IPC::Message* message) { - // The macro magic in OnMessageReceived requires this to link, but it should - // never actually be called. - NOTREACHED(); - parent_->Send(message); -} - -void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( - int32 object_id) { - parent_->DestroyObject( - &map_, object_id, ViewHostMsg_IDBTransactionDestroyed::ID); -} diff --git a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h index ed3357e..ff0fad2 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h @@ -25,7 +25,6 @@ class WebIDBCursor; class WebIDBDatabase; class WebIDBIndex; class WebIDBObjectStore; -class WebIDBTransaction; } // Handles all IndexedDB related messages from a particular renderer process. @@ -61,7 +60,6 @@ class IndexedDBDispatcherHost int32 Add(WebKit::WebIDBDatabase* idb_database); int32 Add(WebKit::WebIDBIndex* idb_index); int32 Add(WebKit::WebIDBObjectStore* idb_object_store); - void Add(WebKit::WebIDBTransaction* idb_transaction); private: friend class base::RefCountedThreadSafe<IndexedDBDispatcherHost>; @@ -71,7 +69,6 @@ class IndexedDBDispatcherHost // below. void OnMessageReceivedWebKit(const IPC::Message& message); void OnIDBFactoryOpen(const ViewHostMsg_IDBFactoryOpen_Params& p); - void OnIDBFactoryAbortPendingTransactions(const std::vector<int32>& ids); // Helper templates. template <class ReturnType> @@ -106,9 +103,6 @@ class IndexedDBDispatcherHost IPC::Message* reply_msg); void OnRemoveObjectStore(int32 idb_database_id, int32 response_id, const string16& name); - void OnTransaction(int32 idb_database_id, - const std::vector<string16>& names, - int32 mode, int32 timeout, IPC::Message* reply_msg); void OnDestroyed(int32 idb_database_id); IndexedDBDispatcherHost* parent_; @@ -180,22 +174,6 @@ class IndexedDBDispatcherHost IndexedDBDispatcherHost* parent_; IDMap<WebKit::WebIDBCursor, IDMapOwnPointer> map_; }; - - class TransactionDispatcherHost { - public: - explicit TransactionDispatcherHost(IndexedDBDispatcherHost* parent); - ~TransactionDispatcherHost(); - - bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); - void Send(IPC::Message* message); - - // TODO: add the rest of the transaction methods. - void OnDestroyed(int32 idb_transaction_id); - - IndexedDBDispatcherHost* parent_; - IDMap<WebKit::WebIDBTransaction, IDMapOwnPointer> map_; - }; - // Only use on the IO thread. IPC::Message::Sender* sender_; @@ -207,8 +185,6 @@ class IndexedDBDispatcherHost scoped_ptr<IndexDispatcherHost> index_dispatcher_host_; scoped_ptr<ObjectStoreDispatcherHost> object_store_dispatcher_host_; scoped_ptr<CursorDispatcherHost> cursor_dispatcher_host_; - scoped_ptr<TransactionDispatcherHost> transaction_dispatcher_host_; - // If we get a corrupt message from a renderer, we need to kill it using this // handle. diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi index f101c1e..d73af4a 100644 --- a/chrome/chrome_renderer.gypi +++ b/chrome/chrome_renderer.gypi @@ -167,14 +167,12 @@ 'renderer/renderer_webidbcursor_impl.h', 'renderer/renderer_webidbdatabase_impl.cc', 'renderer/renderer_webidbdatabase_impl.h', - 'renderer/renderer_webidbfactory_impl.cc', - 'renderer/renderer_webidbfactory_impl.h', 'renderer/renderer_webidbindex_impl.cc', 'renderer/renderer_webidbindex_impl.h', 'renderer/renderer_webidbobjectstore_impl.cc', 'renderer/renderer_webidbobjectstore_impl.h', - 'renderer/renderer_webidbtransaction_impl.cc', - 'renderer/renderer_webidbtransaction_impl.h', + 'renderer/renderer_webidbfactory_impl.cc', + 'renderer/renderer_webidbfactory_impl.h', 'renderer/renderer_webkitclient_impl.cc', 'renderer/renderer_webkitclient_impl.h', 'renderer/renderer_webstoragearea_impl.cc', diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 7c5a3a7..5c445c8 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -874,10 +874,6 @@ IPC_BEGIN_MESSAGES(View) int /* code */, string16 /* message */) - // IDBTransactionCallback message handlers. - IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksAbort, - int /* transaction_id */) - #if defined(IPC_MESSAGE_LOG_ENABLED) // Tell the renderer process to begin or end IPC message logging. IPC_MESSAGE_CONTROL1(ViewMsg_SetIPCLoggingEnabled, @@ -2283,10 +2279,6 @@ IPC_BEGIN_MESSAGES(ViewHost) IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBFactoryOpen, ViewHostMsg_IDBFactoryOpen_Params) - // WebIDBFactory::abortPendingTransactions() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBFactoryAbortPendingTransactions, - std::vector<int32> /* transaction_ids */) - // WebIDBDatabase::name() message. IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseName, int32, /* idb_database_id */ @@ -2325,18 +2317,6 @@ IPC_BEGIN_MESSAGES(ViewHost) int32, /* response_id */ string16 /* name */) - // WebIDBDatabase::transaction() message. - // TODO: make this message async. Have the renderer create a - // temporary ID and keep a map in the browser process of real - // IDs to temporary IDs. We can then update the transaction - // to its real ID asynchronously. - IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBDatabaseTransaction, - int32, /* idb_database_id */ - std::vector<string16>, /* object_stores */ - int32, /* mode */ - int32, /* timeout */ - int32 /* idb_transaction_id */) - // WebIDBDatabase::~WebIDBDatabase() message. IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBDatabaseDestroyed, int32 /* idb_database_id */) @@ -2424,10 +2404,6 @@ IPC_BEGIN_MESSAGES(ViewHost) IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBCursorDestroyed, int32 /* idb_cursor_id */) - // WebIDBTransaction::~WebIDBTransaction() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionDestroyed, - int32 /* idb_index_id */) - // Get file size in bytes. Set result to -1 if failed to get the file size. IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetFileSize, FilePath /* path */, diff --git a/chrome/renderer/indexed_db_dispatcher.cc b/chrome/renderer/indexed_db_dispatcher.cc index e79ed33..1087eec 100644 --- a/chrome/renderer/indexed_db_dispatcher.cc +++ b/chrome/renderer/indexed_db_dispatcher.cc @@ -51,8 +51,6 @@ bool IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) { OnSuccessSerializedScriptValue) IPC_MESSAGE_HANDLER(ViewMsg_IDBCallbacksError, OnError) - IPC_MESSAGE_HANDLER(ViewMsg_IDBTransactionCallbacksAbort, - OnAbort) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -179,11 +177,6 @@ void IndexedDBDispatcher::RequestIDBObjectStoreOpenCursor( new ViewHostMsg_IDBObjectStoreOpenCursor(params)); } -void IndexedDBDispatcher::RequestIDBTransactionSetCallbacks( - WebKit::WebIDBTransactionCallbacks* callbacks) { - pending_transaction_callbacks_.AddWithID(callbacks, callbacks->id()); -} - void IndexedDBDispatcher::OnSuccessNull(int32 response_id) { WebKit::WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); callbacks->onSuccess(); @@ -239,11 +232,3 @@ void IndexedDBDispatcher::OnError(int32 response_id, int code, callbacks->onError(WebIDBDatabaseError(code, message)); pending_callbacks_.Remove(response_id); } - -void IndexedDBDispatcher::OnAbort(int transaction_id) { - WebKit::WebIDBTransactionCallbacks* callbacks = - pending_transaction_callbacks_.Lookup(transaction_id); - DCHECK(callbacks); - callbacks->onAbort(); - pending_transaction_callbacks_.Remove(transaction_id); -}
\ No newline at end of file diff --git a/chrome/renderer/indexed_db_dispatcher.h b/chrome/renderer/indexed_db_dispatcher.h index c2602e0..5c04180 100644 --- a/chrome/renderer/indexed_db_dispatcher.h +++ b/chrome/renderer/indexed_db_dispatcher.h @@ -11,7 +11,6 @@ #include "ipc/ipc_message.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBCallbacks.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBDatabase.h" -#include "third_party/WebKit/WebKit/chromium/public/WebIDBTransactionCallbacks.h" class IndexedDBKey; class SerializedScriptValue; @@ -70,9 +69,6 @@ class IndexedDBDispatcher { const WebKit::WebIDBKeyRange& idb_key_range, unsigned short direction, WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id); - void RequestIDBTransactionSetCallbacks( - WebKit::WebIDBTransactionCallbacks* callbacks); - private: // IDBCallback message handlers. void OnSuccessNull(int32 response_id); @@ -84,13 +80,10 @@ class IndexedDBDispatcher { void OnSuccessSerializedScriptValue(int32 response_id, const SerializedScriptValue& value); void OnError(int32 response_id, int code, const string16& message); - void OnAbort(int transaction_id); // Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be // destroyed and used on the same thread it was created on. IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> pending_callbacks_; - IDMap<WebKit::WebIDBTransactionCallbacks, IDMapOwnPointer> - pending_transaction_callbacks_; DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); }; diff --git a/chrome/renderer/renderer_webidbdatabase_impl.cc b/chrome/renderer/renderer_webidbdatabase_impl.cc index 7bfaf5c..0f07369 100644 --- a/chrome/renderer/renderer_webidbdatabase_impl.cc +++ b/chrome/renderer/renderer_webidbdatabase_impl.cc @@ -7,13 +7,11 @@ #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" #include "third_party/WebKit/WebKit/chromium/public/WebString.h" using WebKit::WebDOMStringList; using WebKit::WebFrame; using WebKit::WebIDBCallbacks; -using WebKit::WebIDBTransaction; using WebKit::WebString; using WebKit::WebVector; @@ -69,18 +67,3 @@ void RendererWebIDBDatabaseImpl::createObjectStore( dispatcher->RequestIDBDatabaseCreateObjectStore( name, key_path, auto_increment, callbacks, idb_database_id_); } - -WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::transaction( - const WebDOMStringList& names, unsigned short mode, - unsigned long timeout) { - std::vector<string16> object_stores(names.length()); - for (unsigned int i = 0; i < names.length(); ++i) { - object_stores.push_back(names.item(i)); - } - - int transaction_id; - RenderThread::current()->Send( - new ViewHostMsg_IDBDatabaseTransaction( - idb_database_id_, object_stores, mode, timeout, &transaction_id)); - return new RendererWebIDBTransactionImpl(transaction_id); -} diff --git a/chrome/renderer/renderer_webidbdatabase_impl.h b/chrome/renderer/renderer_webidbdatabase_impl.h index 2ce55b1..2105d3b 100644 --- a/chrome/renderer/renderer_webidbdatabase_impl.h +++ b/chrome/renderer/renderer_webidbdatabase_impl.h @@ -14,7 +14,6 @@ namespace WebKit { class WebFrame; class WebIDBCallbacks; class WebString; -class WebIDBTransaction; } class RendererWebIDBDatabaseImpl : public WebKit::WebIDBDatabase { @@ -30,9 +29,7 @@ class RendererWebIDBDatabaseImpl : public WebKit::WebIDBDatabase { virtual void createObjectStore( const WebKit::WebString& name, const WebKit::WebString& key_path, bool auto_increment, WebKit::WebIDBCallbacks* callbacks); - virtual WebKit::WebIDBTransaction* transaction( - const WebKit::WebDOMStringList& names, - unsigned short mode, unsigned long timeout); + private: int32 idb_database_id_; }; diff --git a/chrome/renderer/renderer_webidbfactory_impl.cc b/chrome/renderer/renderer_webidbfactory_impl.cc index f1dd4dd..2ccf84a 100644 --- a/chrome/renderer/renderer_webidbfactory_impl.cc +++ b/chrome/renderer/renderer_webidbfactory_impl.cc @@ -32,13 +32,3 @@ void RendererWebIDBFactoryImpl::open( dispatcher->RequestIDBFactoryOpen( name, description, callbacks, origin.databaseIdentifier(), web_frame); } - -void RendererWebIDBFactoryImpl::abortPendingTransactions( - const WebKit::WebVector<int>& pendingIDs) { - std::vector<int> ids; - for (size_t i = 0; i < pendingIDs.size(); ++i) { - ids.push_back(pendingIDs[i]); - } - RenderThread::current()->Send( - new ViewHostMsg_IDBFactoryAbortPendingTransactions(ids)); -} diff --git a/chrome/renderer/renderer_webidbfactory_impl.h b/chrome/renderer/renderer_webidbfactory_impl.h index e2f2b47..de71220 100644 --- a/chrome/renderer/renderer_webidbfactory_impl.h +++ b/chrome/renderer/renderer_webidbfactory_impl.h @@ -8,7 +8,6 @@ #include "third_party/WebKit/WebKit/chromium/public/WebIDBCallbacks.h" #include "third_party/WebKit/WebKit/chromium/public/WebIDBFactory.h" -#include "third_party/WebKit/WebKit/chromium/public/WebVector.h" namespace WebKit { class WebDOMStringList; @@ -28,8 +27,6 @@ class RendererWebIDBFactoryImpl : public WebKit::WebIDBFactory { const WebKit::WebString& name, const WebKit::WebString& description, WebKit::WebIDBCallbacks* callbacks, const WebKit::WebSecurityOrigin& origin, WebKit::WebFrame* web_frame); - virtual void abortPendingTransactions( - const WebKit::WebVector<int>& pendingIDs); }; #endif // CHROME_RENDERER_RENDERER_WEBIDBFACTORY_IMPL_H_ diff --git a/chrome/renderer/renderer_webidbtransaction_impl.cc b/chrome/renderer/renderer_webidbtransaction_impl.cc deleted file mode 100644 index c998245..0000000 --- a/chrome/renderer/renderer_webidbtransaction_impl.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/renderer/renderer_WebIDBTransaction_impl.h" - -#include "chrome/common/render_messages.h" -#include "chrome/renderer/render_thread.h" -#include "chrome/renderer/indexed_db_dispatcher.h" -#include "third_party/WebKit/WebKit/chromium/public/WebIDBObjectStore.h" -#include "third_party/WebKit/WebKit/chromium/public/WebIDBTransactionCallbacks.h" -#include "third_party/WebKit/WebKit/chromium/public/WebString.h" - -using WebKit::WebIDBObjectStore; -using WebKit::WebIDBTransactionCallbacks; -using WebKit::WebString; - -RendererWebIDBTransactionImpl::RendererWebIDBTransactionImpl( - int32 idb_transaction_id) - : idb_transaction_id_(idb_transaction_id) { -} - -RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() { - RenderThread::current()->Send(new ViewHostMsg_IDBTransactionDestroyed( - idb_transaction_id_)); -} - -int RendererWebIDBTransactionImpl::mode() const -{ - // TODO: implement - DCHECK(false); - return 0; -} - -WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( - const WebString& name) -{ - // TODO: implement - DCHECK(false); - return 0; -} - -void RendererWebIDBTransactionImpl::abort() -{ - // TODO: implement - DCHECK(false); -} - -int RendererWebIDBTransactionImpl::id() const -{ - return idb_transaction_id_; -} - -void RendererWebIDBTransactionImpl::setCallbacks( - WebIDBTransactionCallbacks* callbacks) -{ - IndexedDBDispatcher* dispatcher = - RenderThread::current()->indexed_db_dispatcher(); - dispatcher->RequestIDBTransactionSetCallbacks(callbacks); -} diff --git a/chrome/renderer/renderer_webidbtransaction_impl.h b/chrome/renderer/renderer_webidbtransaction_impl.h deleted file mode 100644 index 4369104..0000000 --- a/chrome/renderer/renderer_webidbtransaction_impl.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_RENDERER_RENDERER_WEBIDBTRANSACTION_IMPL_H_ -#define CHROME_RENDERER_RENDERER_WEBIDBTRANSACTION_IMPL_H_ -#pragma once - -#include "base/basictypes.h" -#include "third_party/WebKit/WebKit/chromium/public/WebIDBTransaction.h" - -namespace WebKit { -class WebIDBObjectStore; -class WebIDBTransactionCallbacks; -class WebString; -} - -class RendererWebIDBTransactionImpl : public WebKit::WebIDBTransaction { - public: - explicit RendererWebIDBTransactionImpl(int32 idb_transaction_id); - virtual ~RendererWebIDBTransactionImpl(); - - virtual int mode() const; - virtual WebKit::WebIDBObjectStore* objectStore(const WebKit::WebString& name); - virtual void abort(); - virtual int id() const; - virtual void setCallbacks(WebKit::WebIDBTransactionCallbacks*); - - private: - int32 idb_transaction_id_; -}; - -#endif // CHROME_RENDERER_RENDERER_WEBIDBTRANSACTION_IMPL_H_ |