Flush out IPC for onSuccess() / onSuccess(long long)

BUG=156247


Review URL: https://chromiumcodereview.appspot.com/11194026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162482 0039d316-1c4b-4281-b951-d872f2087c98
parent 3b19e8e4
...@@ -205,3 +205,17 @@ void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( ...@@ -205,3 +205,17 @@ void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess(
thread_id(), response_id(), SerializedScriptValue(value), thread_id(), response_id(), SerializedScriptValue(value),
IndexedDBKey(primaryKey), IndexedDBKeyPath(keyPath))); IndexedDBKey(primaryKey), IndexedDBKeyPath(keyPath)));
} }
void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess(
long long value) {
dispatcher_host()->Send(
new IndexedDBMsg_CallbacksSuccessInteger(thread_id(),
response_id(),
value));
}
void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess() {
dispatcher_host()->Send(
new IndexedDBMsg_CallbacksSuccessUndefined(thread_id(),
response_id()));
}
...@@ -178,6 +178,8 @@ class IndexedDBCallbacks<WebKit::WebSerializedScriptValue> ...@@ -178,6 +178,8 @@ class IndexedDBCallbacks<WebKit::WebSerializedScriptValue>
virtual void onSuccess(const WebKit::WebSerializedScriptValue& value, virtual void onSuccess(const WebKit::WebSerializedScriptValue& value,
const WebKit::WebIDBKey& key, const WebKit::WebIDBKey& key,
const WebKit::WebIDBKeyPath& keyPath); const WebKit::WebIDBKeyPath& keyPath);
virtual void onSuccess(long long value);
virtual void onSuccess();
private: private:
DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
......
...@@ -101,6 +101,10 @@ void IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) { ...@@ -101,6 +101,10 @@ void IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) {
OnSuccessSerializedScriptValue) OnSuccessSerializedScriptValue)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValueWithKey, IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValueWithKey,
OnSuccessSerializedScriptValueWithKey) OnSuccessSerializedScriptValueWithKey)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessInteger,
OnSuccessInteger)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessUndefined,
OnSuccessUndefined)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError) IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksBlocked, OnBlocked) IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksBlocked, OnBlocked)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksIntBlocked, OnIntBlocked) IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksIntBlocked, OnIntBlocked)
...@@ -586,6 +590,26 @@ void IndexedDBDispatcher::OnSuccessSerializedScriptValueWithKey( ...@@ -586,6 +590,26 @@ void IndexedDBDispatcher::OnSuccessSerializedScriptValueWithKey(
pending_callbacks_.Remove(response_id); pending_callbacks_.Remove(response_id);
} }
void IndexedDBDispatcher::OnSuccessInteger(
int32 thread_id, int32 response_id, int64 value) {
DCHECK_EQ(thread_id, CurrentWorkerId());
WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
if (!callbacks)
return;
callbacks->onSuccess(value);
pending_callbacks_.Remove(response_id);
}
void IndexedDBDispatcher::OnSuccessUndefined(
int32 thread_id, int32 response_id) {
DCHECK_EQ(thread_id, CurrentWorkerId());
WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
if (!callbacks)
return;
callbacks->onSuccess();
pending_callbacks_.Remove(response_id);
}
void IndexedDBDispatcher::OnSuccessOpenCursor( void IndexedDBDispatcher::OnSuccessOpenCursor(
const IndexedDBMsg_CallbacksSuccessIDBCursor_Params& p) { const IndexedDBMsg_CallbacksSuccessIDBCursor_Params& p) {
DCHECK_EQ(p.thread_id, CurrentWorkerId()); DCHECK_EQ(p.thread_id, CurrentWorkerId());
......
...@@ -216,7 +216,6 @@ class CONTENT_EXPORT IndexedDBDispatcher ...@@ -216,7 +216,6 @@ class CONTENT_EXPORT IndexedDBDispatcher
FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, ValueSizeTest); FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, ValueSizeTest);
// IDBCallback message handlers. // IDBCallback message handlers.
void OnSuccessNull(int32 response_id);
void OnSuccessIDBDatabase(int32 thread_id, void OnSuccessIDBDatabase(int32 thread_id,
int32 response_id, int32 response_id,
int32 object_id); int32 object_id);
...@@ -245,6 +244,13 @@ class CONTENT_EXPORT IndexedDBDispatcher ...@@ -245,6 +244,13 @@ class CONTENT_EXPORT IndexedDBDispatcher
const content::SerializedScriptValue& value, const content::SerializedScriptValue& value,
const content::IndexedDBKey& primary_key, const content::IndexedDBKey& primary_key,
const content::IndexedDBKeyPath& key_path); const content::IndexedDBKeyPath& key_path);
void OnSuccessInteger(
int32 thread_id,
int32 response_id,
int64 value);
void OnSuccessUndefined(
int32 thread_id,
int32 response_id);
void OnError(int32 thread_id, void OnError(int32 thread_id,
int32 response_id, int32 response_id,
int code, int code,
......
...@@ -247,6 +247,13 @@ IPC_MESSAGE_CONTROL5(IndexedDBMsg_CallbacksSuccessSerializedScriptValueWithKey, ...@@ -247,6 +247,13 @@ IPC_MESSAGE_CONTROL5(IndexedDBMsg_CallbacksSuccessSerializedScriptValueWithKey,
content::SerializedScriptValue /* value */, content::SerializedScriptValue /* value */,
content::IndexedDBKey /* indexed_db_key */, content::IndexedDBKey /* indexed_db_key */,
content::IndexedDBKeyPath /* indexed_db_keypath */) content::IndexedDBKeyPath /* indexed_db_keypath */)
IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessInteger,
int32 /* thread_id */,
int32 /* response_id */,
int64 /* value */)
IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessUndefined,
int32 /* thread_id */,
int32 /* response_id */)
IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessStringList, IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksSuccessStringList,
int32 /* thread_id */, int32 /* thread_id */,
int32 /* response_id */, int32 /* response_id */,
......
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