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
parent add0ea33
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h"
#include <vector>
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
...@@ -61,7 +63,6 @@ void DeleteOnWebKitThread(T* obj) { ...@@ -61,7 +63,6 @@ void DeleteOnWebKitThread(T* obj) {
FROM_HERE, obj)) FROM_HERE, obj))
delete obj; delete obj;
} }
} }
IndexedDBDispatcherHost::IndexedDBDispatcherHost( IndexedDBDispatcherHost::IndexedDBDispatcherHost(
...@@ -278,17 +279,6 @@ ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess( ...@@ -278,17 +279,6 @@ ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess(
return return_object; 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> template <typename ObjectType>
void IndexedDBDispatcherHost::DestroyObject( void IndexedDBDispatcherHost::DestroyObject(
IDMap<ObjectType, IDMapOwnPointer>* map, int32 object_id) { IDMap<ObjectType, IDMapOwnPointer>* map, int32 object_id) {
...@@ -765,8 +755,8 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnClear( ...@@ -765,8 +755,8 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnClear(
} }
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCreateIndex( void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCreateIndex(
const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params, const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params,
int32* index_id, WebKit::WebExceptionCode* ec) { int32* index_id, WebKit::WebExceptionCode* ec) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess(
&map_, params.idb_object_store_id); &map_, params.idb_object_store_id);
...@@ -885,7 +875,6 @@ bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived( ...@@ -885,7 +875,6 @@ bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived(
bool handled = true; bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::CursorDispatcherHost, IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::CursorDispatcherHost,
message, *msg_is_ok) message, *msg_is_ok)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorUpdate, OnUpdate)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorAdvance, OnAdvance) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorAdvance, OnAdvance)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorContinue, OnContinue) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorContinue, OnContinue)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetch, OnPrefetch) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetch, OnPrefetch)
...@@ -931,23 +920,6 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnValue( ...@@ -931,23 +920,6 @@ void IndexedDBDispatcherHost::CursorDispatcherHost::OnValue(
*script_value = SerializedScriptValue(idb_cursor->value()); *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( void IndexedDBDispatcherHost::CursorDispatcherHost::OnAdvance(
int32 cursor_id, int32 cursor_id,
int32 thread_id, int32 thread_id,
...@@ -1059,7 +1031,6 @@ bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived( ...@@ -1059,7 +1031,6 @@ bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived(
message, *msg_is_ok) message, *msg_is_ok)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionCommit, OnCommit) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionCommit, OnCommit)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionAbort, OnAbort) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionAbort, OnAbort)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionMode, OnMode)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionObjectStore, OnObjectStore) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionObjectStore, OnObjectStore)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDidCompleteTaskEvents,
OnDidCompleteTaskEvents) OnDidCompleteTaskEvents)
...@@ -1094,17 +1065,6 @@ void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort( ...@@ -1094,17 +1065,6 @@ void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort(
idb_transaction->abort(); 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( void IndexedDBDispatcherHost::TransactionDispatcherHost::OnObjectStore(
int32 transaction_id, const string16& name, int32* object_store_id, int32 transaction_id, const string16& name, int32* object_store_id,
WebKit::WebExceptionCode* ec) { WebKit::WebExceptionCode* ec) {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_
#include <map> #include <map>
#include <vector>
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/id_map.h" #include "base/id_map.h"
...@@ -97,10 +98,6 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter { ...@@ -97,10 +98,6 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter {
ReturnType* GetOrTerminateProcess( ReturnType* GetOrTerminateProcess(
IDMap<ReturnType, IDMapOwnPointer>* map, int32 return_object_id); 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> template <typename ObjectType>
void DestroyObject(IDMap<ObjectType, IDMapOwnPointer>* map, int32 object_id); void DestroyObject(IDMap<ObjectType, IDMapOwnPointer>* map, int32 object_id);
...@@ -283,7 +280,6 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter { ...@@ -283,7 +280,6 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter {
void OnCommit(int32 transaction_id); void OnCommit(int32 transaction_id);
void OnAbort(int32 transaction_id); void OnAbort(int32 transaction_id);
void OnMode(int32 transaction_id, int* mode);
void OnObjectStore(int32 transaction_id, void OnObjectStore(int32 transaction_id,
const string16& name, const string16& name,
int32* object_store_id, int32* object_store_id,
......
...@@ -48,8 +48,7 @@ IndexedDBDispatcher* const kHasBeenDeleted = ...@@ -48,8 +48,7 @@ IndexedDBDispatcher* const kHasBeenDeleted =
int32 CurrentWorkerId() { int32 CurrentWorkerId() {
return WorkerTaskRunner::Instance()->CurrentWorkerId(); return WorkerTaskRunner::Instance()->CurrentWorkerId();
} }
} // unnamed namespace
} // unnamed namespace
const size_t kMaxIDBValueSizeInBytes = 64 * 1024 * 1024; const size_t kMaxIDBValueSizeInBytes = 64 * 1024 * 1024;
...@@ -129,26 +128,6 @@ bool IndexedDBDispatcher::Send(IPC::Message* msg) { ...@@ -129,26 +128,6 @@ bool IndexedDBDispatcher::Send(IPC::Message* msg) {
return ChildThread::current()->Send(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( void IndexedDBDispatcher::RequestIDBCursorAdvance(
unsigned long count, unsigned long count,
WebIDBCallbacks* callbacks_ptr, WebIDBCallbacks* callbacks_ptr,
......
...@@ -82,12 +82,6 @@ class CONTENT_EXPORT IndexedDBDispatcher ...@@ -82,12 +82,6 @@ class CONTENT_EXPORT IndexedDBDispatcher
const string16& origin, const string16& origin,
WebKit::WebFrame* web_frame); WebKit::WebFrame* web_frame);
void RequestIDBCursorUpdate(
const content::SerializedScriptValue& value,
WebKit::WebIDBCallbacks* callbacks_ptr,
int32 idb_cursor_id,
WebKit::WebExceptionCode* ec);
void RequestIDBCursorAdvance( void RequestIDBCursorAdvance(
unsigned long count, unsigned long count,
WebKit::WebIDBCallbacks* callbacks_ptr, WebKit::WebIDBCallbacks* callbacks_ptr,
......
...@@ -47,15 +47,4 @@ TEST(IndexedDBDispatcherTest, ValueSizeTest) { ...@@ -47,15 +47,4 @@ TEST(IndexedDBDispatcherTest, ValueSizeTest) {
&ec); &ec);
EXPECT_NE(ec, 0); 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);
}
} }
...@@ -279,14 +279,6 @@ IPC_MESSAGE_CONTROL4(IndexedDBMsg_DatabaseCallbacksIntVersionChange, ...@@ -279,14 +279,6 @@ IPC_MESSAGE_CONTROL4(IndexedDBMsg_DatabaseCallbacksIntVersionChange,
// Indexed DB messages sent from the renderer to the browser. // 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. // WebIDBCursor::advance() message.
IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_CursorAdvance, IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_CursorAdvance,
int32, /* idb_cursor_id */ int32, /* idb_cursor_id */
...@@ -524,11 +516,6 @@ IPC_SYNC_MESSAGE_CONTROL2_2(IndexedDBHostMsg_TransactionObjectStore, ...@@ -524,11 +516,6 @@ IPC_SYNC_MESSAGE_CONTROL2_2(IndexedDBHostMsg_TransactionObjectStore,
int32, /* object_store_id */ int32, /* object_store_id */
WebKit::WebExceptionCode /* ec */) WebKit::WebExceptionCode /* ec */)
// WebIDBTransaction::mode() message.
IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_TransactionMode,
int32, /* idb_transaction_id */
int /* mode */)
// WebIDBTransaction::commit() message. // WebIDBTransaction::commit() message.
IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionCommit, IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionCommit,
int32 /* idb_transaction_id */) int32 /* idb_transaction_id */)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "content/common/indexed_db/proxy_webidbcursor_impl.h" #include "content/common/indexed_db/proxy_webidbcursor_impl.h"
#include <vector>
#include "content/common/child_thread.h" #include "content/common/child_thread.h"
#include "content/common/indexed_db/indexed_db_messages.h" #include "content/common/indexed_db/indexed_db_messages.h"
#include "content/common/indexed_db/indexed_db_dispatcher.h" #include "content/common/indexed_db/indexed_db_dispatcher.h"
...@@ -47,15 +49,6 @@ WebSerializedScriptValue RendererWebIDBCursorImpl::value() const { ...@@ -47,15 +49,6 @@ WebSerializedScriptValue RendererWebIDBCursorImpl::value() const {
return value_; 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, void RendererWebIDBCursorImpl::advance(unsigned long count,
WebIDBCallbacks* callbacks_ptr, WebIDBCallbacks* callbacks_ptr,
WebExceptionCode& ec) { WebExceptionCode& ec) {
...@@ -150,7 +143,7 @@ void RendererWebIDBCursorImpl::SetPrefetchData( ...@@ -150,7 +143,7 @@ void RendererWebIDBCursorImpl::SetPrefetchData(
void RendererWebIDBCursorImpl::CachedContinue( void RendererWebIDBCursorImpl::CachedContinue(
WebKit::WebIDBCallbacks* callbacks) { WebKit::WebIDBCallbacks* callbacks) {
DCHECK(prefetch_keys_.size() > 0); DCHECK_GT(prefetch_keys_.size(), 0ul);
DCHECK(prefetch_primary_keys_.size() == prefetch_keys_.size()); DCHECK(prefetch_primary_keys_.size() == prefetch_keys_.size());
DCHECK(prefetch_values_.size() == prefetch_keys_.size()); DCHECK(prefetch_values_.size() == prefetch_keys_.size());
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_ #define CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_
#include <deque> #include <deque>
#include <vector>
#include "base/basictypes.h" #include "base/basictypes.h"
#include "content/common/indexed_db/indexed_db_key.h" #include "content/common/indexed_db/indexed_db_key.h"
...@@ -17,15 +18,12 @@ ...@@ -17,15 +18,12 @@
class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor { class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor {
public: public:
RendererWebIDBCursorImpl(int32 idb_cursor_id); explicit RendererWebIDBCursorImpl(int32 idb_cursor_id);
virtual ~RendererWebIDBCursorImpl(); virtual ~RendererWebIDBCursorImpl();
virtual WebKit::WebIDBKey key() const; virtual WebKit::WebIDBKey key() const;
virtual WebKit::WebIDBKey primaryKey() const; virtual WebKit::WebIDBKey primaryKey() const;
virtual WebKit::WebSerializedScriptValue value() 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, virtual void advance(unsigned long count,
WebKit::WebIDBCallbacks* callback, WebKit::WebIDBCallbacks* callback,
WebKit::WebExceptionCode& ec); WebKit::WebExceptionCode& ec);
......
...@@ -61,23 +61,6 @@ void RendererWebIDBObjectStoreImpl::get( ...@@ -61,23 +61,6 @@ void RendererWebIDBObjectStoreImpl::get(
idb_object_store_id_, transaction, &ec); 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( void RendererWebIDBObjectStoreImpl::putWithIndexKeys(
const WebSerializedScriptValue& value, const WebSerializedScriptValue& value,
const WebIDBKey& key, const WebIDBKey& key,
......
...@@ -27,12 +27,6 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { ...@@ -27,12 +27,6 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore {
WebKit::WebIDBCallbacks* callbacks, WebKit::WebIDBCallbacks* callbacks,
const WebKit::WebIDBTransaction& transaction, const WebKit::WebIDBTransaction& transaction,
WebKit::WebExceptionCode& ec); 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( virtual void putWithIndexKeys(
const WebKit::WebSerializedScriptValue&, const WebKit::WebSerializedScriptValue&,
const WebKit::WebIDBKey&, const WebKit::WebIDBKey&,
......
...@@ -30,13 +30,6 @@ RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() { ...@@ -30,13 +30,6 @@ RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() {
idb_transaction_id_)); idb_transaction_id_));
} }
int RendererWebIDBTransactionImpl::mode() const {
int mode;
IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionMode(
idb_transaction_id_, &mode));
return mode;
}
WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore(
const WebString& name, const WebString& name,
WebKit::WebExceptionCode& ec) { WebKit::WebExceptionCode& ec) {
......
...@@ -19,7 +19,6 @@ class RendererWebIDBTransactionImpl : public WebKit::WebIDBTransaction { ...@@ -19,7 +19,6 @@ class RendererWebIDBTransactionImpl : public WebKit::WebIDBTransaction {
explicit RendererWebIDBTransactionImpl(int32 idb_transaction_id); explicit RendererWebIDBTransactionImpl(int32 idb_transaction_id);
virtual ~RendererWebIDBTransactionImpl(); virtual ~RendererWebIDBTransactionImpl();
virtual int mode() const;
virtual WebKit::WebIDBObjectStore* objectStore(const WebKit::WebString& name, virtual WebKit::WebIDBObjectStore* objectStore(const WebKit::WebString& name,
WebKit::WebExceptionCode&); WebKit::WebExceptionCode&);
virtual void commit(); virtual void commit();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment