Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: content/browser/in_process_webkit/indexed_db_callbacks.cc

Issue 7834006: Consolidate key, primary key, value cursor messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unused messages Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" 5 #include "content/browser/in_process_webkit/indexed_db_callbacks.h"
6 6
7 #include "content/common/indexed_db_messages.h" 7 #include "content/common/indexed_db_messages.h"
8 #include "webkit/quota/quota_manager.h" 8 #include "webkit/quota/quota_manager.h"
9 9
10 IndexedDBCallbacksBase::IndexedDBCallbacksBase( 10 IndexedDBCallbacksBase::IndexedDBCallbacksBase(
11 IndexedDBDispatcherHost* dispatcher_host, 11 IndexedDBDispatcherHost* dispatcher_host,
12 int32 response_id) 12 int32 response_id)
13 : dispatcher_host_(dispatcher_host), 13 : dispatcher_host_(dispatcher_host),
14 response_id_(response_id) { 14 response_id_(response_id) {
15 } 15 }
16 16
17 IndexedDBCallbacksBase::~IndexedDBCallbacksBase() {} 17 IndexedDBCallbacksBase::~IndexedDBCallbacksBase() {}
18 18
19 void IndexedDBCallbacksBase::onError(const WebKit::WebIDBDatabaseError& error) { 19 void IndexedDBCallbacksBase::onError(const WebKit::WebIDBDatabaseError& error) {
20 dispatcher_host_->Send(new IndexedDBMsg_CallbacksError( 20 dispatcher_host_->Send(new IndexedDBMsg_CallbacksError(
21 response_id_, error.code(), error.message())); 21 response_id_, error.code(), error.message()));
22 } 22 }
23 23
24 void IndexedDBCallbacksBase::onBlocked() { 24 void IndexedDBCallbacksBase::onBlocked() {
25 dispatcher_host_->Send(new IndexedDBMsg_CallbacksBlocked(response_id_)); 25 dispatcher_host_->Send(new IndexedDBMsg_CallbacksBlocked(response_id_));
26 } 26 }
27 27
28 void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccess( 28 void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccess(
29 WebKit::WebIDBCursor* idb_object) { 29 WebKit::WebIDBCursor* idb_object, const WebKit::WebIDBKey& key,
30 const WebKit::WebIDBKey& primary_key,
31 const WebKit::WebSerializedScriptValue& value) {
30 int32 object_id = dispatcher_host()->Add(idb_object); 32 int32 object_id = dispatcher_host()->Add(idb_object);
31 dispatcher_host()->Send( 33 dispatcher_host()->Send(
32 new IndexedDBMsg_CallbacksSuccessIDBCursor(response_id(), object_id)); 34 new IndexedDBMsg_CallbacksSuccessIDBCursor(
35 response_id(), object_id, IndexedDBKey(key),
36 IndexedDBKey(primary_key), SerializedScriptValue(value)));
33 } 37 }
34 38
35 void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccess( 39 void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccess(
36 const WebKit::WebSerializedScriptValue& value) { 40 const WebKit::WebSerializedScriptValue& value) {
37 dispatcher_host()->Send( 41 dispatcher_host()->Send(
38 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( 42 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue(
39 response_id(), SerializedScriptValue(value))); 43 response_id(), SerializedScriptValue(value)));
40 } 44 }
41 45
42 void IndexedDBCallbacks<WebKit::WebIDBKey>::onSuccess( 46 void IndexedDBCallbacks<WebKit::WebIDBKey>::onSuccess(
43 const WebKit::WebIDBKey& value) { 47 const WebKit::WebIDBKey& value) {
44 dispatcher_host()->Send( 48 dispatcher_host()->Send(
45 new IndexedDBMsg_CallbacksSuccessIndexedDBKey( 49 new IndexedDBMsg_CallbacksSuccessIndexedDBKey(
46 response_id(), IndexedDBKey(value))); 50 response_id(), IndexedDBKey(value)));
47 } 51 }
48 52
49 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( 53 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess(
50 const WebKit::WebSerializedScriptValue& value) { 54 const WebKit::WebSerializedScriptValue& value) {
51 dispatcher_host()->Send( 55 dispatcher_host()->Send(
52 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( 56 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue(
53 response_id(), SerializedScriptValue(value))); 57 response_id(), SerializedScriptValue(value)));
54 } 58 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698