diff options
author | alecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-02 23:11:10 +0000 |
---|---|---|
committer | alecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-02 23:11:10 +0000 |
commit | 0ab5f76e05a56c59ad3c3049f2fc3323379706be (patch) | |
tree | 106b3b6ba8615ea5b7ae8b969c56143290569db2 /content | |
parent | add0ea3389c412caf495c54433646611cafde270 (diff) | |
download | chromium_src-0ab5f76e05a56c59ad3c3049f2fc3323379706be.zip chromium_src-0ab5f76e05a56c59ad3c3049f2fc3323379706be.tar.gz chromium_src-0ab5f76e05a56c59ad3c3049f2fc3323379706be.tar.bz2 |
Remove a ton of IPC from landing putWithIndexKeys
This removes a whole bunch of IPC stubs for methods that don't exist anymore:
IDBCursorBackendInterface::update
IDBObjectStoreBackendInterface::put
IDBTransaction::mode
BUG=129471
Review URL: https://chromiumcodereview.appspot.com/10831138
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
12 files changed, 11 insertions, 146 deletions
diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc index b267f88..dbc9f56 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -4,6 +4,8 @@ #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" +#include <vector> + #include "base/bind.h" #include "base/command_line.h" #include "base/utf_string_conversions.h" @@ -61,7 +63,6 @@ void DeleteOnWebKitThread(T* obj) { FROM_HERE, obj)) delete obj; } - } IndexedDBDispatcherHost::IndexedDBDispatcherHost( @@ -278,17 +279,6 @@ ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess( return return_object; } -template <typename ReplyType, typename MapObjectType, typename Method> -void IndexedDBDispatcherHost::SyncGetter( - IDMap<MapObjectType, IDMapOwnPointer>* map, int32 object_id, - ReplyType* reply, Method method) { - MapObjectType* object = GetOrTerminateProcess(map, object_id); - if (!object) - return; - - *reply = (object->*method)(); -} - template <typename ObjectType> void IndexedDBDispatcherHost::DestroyObject( IDMap<ObjectType, IDMapOwnPointer>* map, int32 object_id) { @@ -765,8 +755,8 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnClear( } void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCreateIndex( - const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params, - int32* index_id, WebKit::WebExceptionCode* ec) { + const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params, + int32* index_id, WebKit::WebExceptionCode* ec) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &map_, params.idb_object_store_id); @@ -885,7 +875,6 @@ bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived( bool handled = true; IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::CursorDispatcherHost, message, *msg_is_ok) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorUpdate, OnUpdate) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorAdvance, OnAdvance) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorContinue, OnContinue) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetch, OnPrefetch) @@ -931,23 +920,6 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnValue( *script_value = SerializedScriptValue(idb_cursor->value()); } -void IndexedDBDispatcherHost::CursorDispatcherHost::OnUpdate( - int32 cursor_id, - int32 thread_id, - int32 response_id, - const SerializedScriptValue& value, - WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); - WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); - if (!idb_cursor) - return; - - *ec = 0; - idb_cursor->update( - value, new IndexedDBCallbacks<WebIDBKey>(parent_, thread_id, response_id), - *ec); -} - void IndexedDBDispatcherHost::CursorDispatcherHost::OnAdvance( int32 cursor_id, int32 thread_id, @@ -1059,7 +1031,6 @@ bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived( message, *msg_is_ok) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionCommit, OnCommit) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionAbort, OnAbort) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionMode, OnMode) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionObjectStore, OnObjectStore) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, OnDidCompleteTaskEvents) @@ -1094,17 +1065,6 @@ void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort( idb_transaction->abort(); } -void IndexedDBDispatcherHost::TransactionDispatcherHost::OnMode( - int32 transaction_id, - int* mode) { - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &map_, transaction_id); - if (!idb_transaction) - return; - - *mode = idb_transaction->mode(); -} - void IndexedDBDispatcherHost::TransactionDispatcherHost::OnObjectStore( int32 transaction_id, const string16& name, int32* object_store_id, WebKit::WebExceptionCode* ec) { diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.h b/content/browser/in_process_webkit/indexed_db_dispatcher_host.h index 2df8097..9fa208f 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.h +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.h @@ -6,6 +6,7 @@ #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ #include <map> +#include <vector> #include "base/basictypes.h" #include "base/id_map.h" @@ -97,10 +98,6 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter { ReturnType* GetOrTerminateProcess( IDMap<ReturnType, IDMapOwnPointer>* map, int32 return_object_id); - template <typename ReplyType, typename WebObjectType, typename Method> - void SyncGetter(IDMap<WebObjectType, IDMapOwnPointer>* map, int32 object_id, - ReplyType* reply, Method method); - template <typename ObjectType> void DestroyObject(IDMap<ObjectType, IDMapOwnPointer>* map, int32 object_id); @@ -283,7 +280,6 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter { void OnCommit(int32 transaction_id); void OnAbort(int32 transaction_id); - void OnMode(int32 transaction_id, int* mode); void OnObjectStore(int32 transaction_id, const string16& name, int32* object_store_id, diff --git a/content/common/indexed_db/indexed_db_dispatcher.cc b/content/common/indexed_db/indexed_db_dispatcher.cc index e689a77..30e54fa 100644 --- a/content/common/indexed_db/indexed_db_dispatcher.cc +++ b/content/common/indexed_db/indexed_db_dispatcher.cc @@ -48,8 +48,7 @@ IndexedDBDispatcher* const kHasBeenDeleted = int32 CurrentWorkerId() { return WorkerTaskRunner::Instance()->CurrentWorkerId(); } - -} // unnamed namespace +} // unnamed namespace const size_t kMaxIDBValueSizeInBytes = 64 * 1024 * 1024; @@ -129,26 +128,6 @@ bool IndexedDBDispatcher::Send(IPC::Message* msg) { return ChildThread::current()->Send(msg); } -void IndexedDBDispatcher::RequestIDBCursorUpdate( - const SerializedScriptValue& value, - WebIDBCallbacks* callbacks_ptr, - int32 idb_cursor_id, - WebExceptionCode* ec) { - ResetCursorPrefetchCaches(); - scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); - if (!value.is_null() && - (value.data().length() * sizeof(char16)) > kMaxIDBValueSizeInBytes) { - *ec = WebKit::WebIDBDatabaseExceptionDataError; - return; - } - int32 response_id = pending_callbacks_.Add(callbacks.release()); - Send( - new IndexedDBHostMsg_CursorUpdate(idb_cursor_id, CurrentWorkerId(), - response_id, value, ec)); - if (*ec) - pending_callbacks_.Remove(response_id); -} - void IndexedDBDispatcher::RequestIDBCursorAdvance( unsigned long count, WebIDBCallbacks* callbacks_ptr, diff --git a/content/common/indexed_db/indexed_db_dispatcher.h b/content/common/indexed_db/indexed_db_dispatcher.h index a559dc5..9c589fc 100644 --- a/content/common/indexed_db/indexed_db_dispatcher.h +++ b/content/common/indexed_db/indexed_db_dispatcher.h @@ -82,12 +82,6 @@ class CONTENT_EXPORT IndexedDBDispatcher const string16& origin, WebKit::WebFrame* web_frame); - void RequestIDBCursorUpdate( - const content::SerializedScriptValue& value, - WebKit::WebIDBCallbacks* callbacks_ptr, - int32 idb_cursor_id, - WebKit::WebExceptionCode* ec); - void RequestIDBCursorAdvance( unsigned long count, WebKit::WebIDBCallbacks* callbacks_ptr, diff --git a/content/common/indexed_db/indexed_db_dispatcher_unittest.cc b/content/common/indexed_db/indexed_db_dispatcher_unittest.cc index db5ab25..c9b48f5 100644 --- a/content/common/indexed_db/indexed_db_dispatcher_unittest.cc +++ b/content/common/indexed_db/indexed_db_dispatcher_unittest.cc @@ -47,15 +47,4 @@ TEST(IndexedDBDispatcherTest, ValueSizeTest) { &ec); EXPECT_NE(ec, 0); } - - { - IndexedDBDispatcher dispatcher; - WebKit::WebExceptionCode ec = 0; - dispatcher.RequestIDBCursorUpdate( - value, - static_cast<WebKit::WebIDBCallbacks*>(NULL), - dummy_id, - &ec); - EXPECT_NE(ec, 0); - } } diff --git a/content/common/indexed_db/indexed_db_messages.h b/content/common/indexed_db/indexed_db_messages.h index a84428d..2a478fd 100644 --- a/content/common/indexed_db/indexed_db_messages.h +++ b/content/common/indexed_db/indexed_db_messages.h @@ -279,14 +279,6 @@ IPC_MESSAGE_CONTROL4(IndexedDBMsg_DatabaseCallbacksIntVersionChange, // Indexed DB messages sent from the renderer to the browser. -// WebIDBCursor::update() message. -IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_CursorUpdate, - int32, /* idb_cursor_id */ - int32, /* thread_id */ - int32, /* response_id */ - content::SerializedScriptValue, /* value */ - WebKit::WebExceptionCode /* ec */) - // WebIDBCursor::advance() message. IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_CursorAdvance, int32, /* idb_cursor_id */ @@ -524,11 +516,6 @@ IPC_SYNC_MESSAGE_CONTROL2_2(IndexedDBHostMsg_TransactionObjectStore, int32, /* object_store_id */ WebKit::WebExceptionCode /* ec */) -// WebIDBTransaction::mode() message. -IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_TransactionMode, - int32, /* idb_transaction_id */ - int /* mode */) - // WebIDBTransaction::commit() message. IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionCommit, int32 /* idb_transaction_id */) diff --git a/content/common/indexed_db/proxy_webidbcursor_impl.cc b/content/common/indexed_db/proxy_webidbcursor_impl.cc index 5dd62bd..adf3ae0 100644 --- a/content/common/indexed_db/proxy_webidbcursor_impl.cc +++ b/content/common/indexed_db/proxy_webidbcursor_impl.cc @@ -4,6 +4,8 @@ #include "content/common/indexed_db/proxy_webidbcursor_impl.h" +#include <vector> + #include "content/common/child_thread.h" #include "content/common/indexed_db/indexed_db_messages.h" #include "content/common/indexed_db/indexed_db_dispatcher.h" @@ -47,15 +49,6 @@ WebSerializedScriptValue RendererWebIDBCursorImpl::value() const { return value_; } -void RendererWebIDBCursorImpl::update(const WebSerializedScriptValue& value, - WebIDBCallbacks* callbacks, - WebExceptionCode& ec) { - IndexedDBDispatcher* dispatcher = - IndexedDBDispatcher::ThreadSpecificInstance(); - dispatcher->RequestIDBCursorUpdate( - SerializedScriptValue(value), callbacks, idb_cursor_id_, &ec); -} - void RendererWebIDBCursorImpl::advance(unsigned long count, WebIDBCallbacks* callbacks_ptr, WebExceptionCode& ec) { @@ -150,7 +143,7 @@ void RendererWebIDBCursorImpl::SetPrefetchData( void RendererWebIDBCursorImpl::CachedContinue( WebKit::WebIDBCallbacks* callbacks) { - DCHECK(prefetch_keys_.size() > 0); + DCHECK_GT(prefetch_keys_.size(), 0ul); DCHECK(prefetch_primary_keys_.size() == prefetch_keys_.size()); DCHECK(prefetch_values_.size() == prefetch_keys_.size()); diff --git a/content/common/indexed_db/proxy_webidbcursor_impl.h b/content/common/indexed_db/proxy_webidbcursor_impl.h index db61d66..1e44188 100644 --- a/content/common/indexed_db/proxy_webidbcursor_impl.h +++ b/content/common/indexed_db/proxy_webidbcursor_impl.h @@ -6,6 +6,7 @@ #define CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_ #include <deque> +#include <vector> #include "base/basictypes.h" #include "content/common/indexed_db/indexed_db_key.h" @@ -17,15 +18,12 @@ class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor { public: - RendererWebIDBCursorImpl(int32 idb_cursor_id); + explicit RendererWebIDBCursorImpl(int32 idb_cursor_id); virtual ~RendererWebIDBCursorImpl(); virtual WebKit::WebIDBKey key() const; virtual WebKit::WebIDBKey primaryKey() const; virtual WebKit::WebSerializedScriptValue value() const; - virtual void update(const WebKit::WebSerializedScriptValue& value, - WebKit::WebIDBCallbacks* callback, - WebKit::WebExceptionCode& ec); virtual void advance(unsigned long count, WebKit::WebIDBCallbacks* callback, WebKit::WebExceptionCode& ec); diff --git a/content/common/indexed_db/proxy_webidbobjectstore_impl.cc b/content/common/indexed_db/proxy_webidbobjectstore_impl.cc index 4e34db5..47da0df 100644 --- a/content/common/indexed_db/proxy_webidbobjectstore_impl.cc +++ b/content/common/indexed_db/proxy_webidbobjectstore_impl.cc @@ -61,23 +61,6 @@ void RendererWebIDBObjectStoreImpl::get( idb_object_store_id_, transaction, &ec); } -void RendererWebIDBObjectStoreImpl::put( - const WebSerializedScriptValue& value, - const WebIDBKey& key, - PutMode put_mode, - WebIDBCallbacks* callbacks, - const WebIDBTransaction& transaction, - WebExceptionCode& ec) { - IndexedDBDispatcher* dispatcher = - IndexedDBDispatcher::ThreadSpecificInstance(); - WebVector<WebString> emptyIndexNames; - WebVector<WebVector<WebIDBKey> > emptyIndexKeys; - dispatcher->RequestIDBObjectStorePut( - SerializedScriptValue(value), IndexedDBKey(key), - put_mode, callbacks, idb_object_store_id_, transaction, - emptyIndexNames, emptyIndexKeys, &ec); -} - void RendererWebIDBObjectStoreImpl::putWithIndexKeys( const WebSerializedScriptValue& value, const WebIDBKey& key, diff --git a/content/common/indexed_db/proxy_webidbobjectstore_impl.h b/content/common/indexed_db/proxy_webidbobjectstore_impl.h index 310ff2a..0ced4b8 100644 --- a/content/common/indexed_db/proxy_webidbobjectstore_impl.h +++ b/content/common/indexed_db/proxy_webidbobjectstore_impl.h @@ -27,12 +27,6 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { WebKit::WebIDBCallbacks* callbacks, const WebKit::WebIDBTransaction& transaction, WebKit::WebExceptionCode& ec); - virtual void put(const WebKit::WebSerializedScriptValue& value, - const WebKit::WebIDBKey& key, - PutMode put_mode, - WebKit::WebIDBCallbacks* callbacks, - const WebKit::WebIDBTransaction& transaction, - WebKit::WebExceptionCode& ec); virtual void putWithIndexKeys( const WebKit::WebSerializedScriptValue&, const WebKit::WebIDBKey&, diff --git a/content/common/indexed_db/proxy_webidbtransaction_impl.cc b/content/common/indexed_db/proxy_webidbtransaction_impl.cc index 75d4743..8f04e3c 100644 --- a/content/common/indexed_db/proxy_webidbtransaction_impl.cc +++ b/content/common/indexed_db/proxy_webidbtransaction_impl.cc @@ -30,13 +30,6 @@ RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() { idb_transaction_id_)); } -int RendererWebIDBTransactionImpl::mode() const { - int mode; - IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionMode( - idb_transaction_id_, &mode)); - return mode; -} - WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( const WebString& name, WebKit::WebExceptionCode& ec) { diff --git a/content/common/indexed_db/proxy_webidbtransaction_impl.h b/content/common/indexed_db/proxy_webidbtransaction_impl.h index c28dddd..2b57b87 100644 --- a/content/common/indexed_db/proxy_webidbtransaction_impl.h +++ b/content/common/indexed_db/proxy_webidbtransaction_impl.h @@ -19,7 +19,6 @@ class RendererWebIDBTransactionImpl : public WebKit::WebIDBTransaction { explicit RendererWebIDBTransactionImpl(int32 idb_transaction_id); virtual ~RendererWebIDBTransactionImpl(); - virtual int mode() const; virtual WebKit::WebIDBObjectStore* objectStore(const WebKit::WebString& name, WebKit::WebExceptionCode&); virtual void commit(); |