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

Side by Side Diff: chrome/browser/in_process_webkit/indexed_db_callbacks.h

Issue 6265027: IndexedDB: Prepare to remove IDBCallbacks::onSuccess() used for null values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ 5 #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_
6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/ref_counted.h" 10 #include "base/ref_counted.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 IndexedDBCallbacks( 84 IndexedDBCallbacks(
85 IndexedDBDispatcherHost* dispatcher_host, int32 response_id) 85 IndexedDBDispatcherHost* dispatcher_host, int32 response_id)
86 : IndexedDBCallbacksBase(dispatcher_host, response_id) { } 86 : IndexedDBCallbacksBase(dispatcher_host, response_id) { }
87 87
88 virtual void onSuccess(WebKit::WebIDBCursor* idb_object) { 88 virtual void onSuccess(WebKit::WebIDBCursor* idb_object) {
89 int32 object_id = dispatcher_host()->Add(idb_object); 89 int32 object_id = dispatcher_host()->Add(idb_object);
90 dispatcher_host()->Send( 90 dispatcher_host()->Send(
91 new IndexedDBMsg_CallbacksSuccessIDBCursor(response_id(), object_id)); 91 new IndexedDBMsg_CallbacksSuccessIDBCursor(response_id(), object_id));
92 } 92 }
93 93
94 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value) {
95 dispatcher_host()->Send(
96 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue(
97 response_id(), SerializedScriptValue(value)));
98 }
99
100 // TODO(hans): Remove when WebKit rolls.
94 virtual void onSuccess() { 101 virtual void onSuccess() {
95 dispatcher_host()->Send(new IndexedDBMsg_CallbacksSuccessNull( 102 dispatcher_host()->Send(new IndexedDBMsg_CallbacksSuccessNull(
96 response_id())); 103 response_id()));
97 } 104 }
98 105
99 private: 106 private:
100 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); 107 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
101 }; 108 };
102 109
103 // WebIDBKey is implemented in WebKit as opposed to being an interface Chromium 110 // WebIDBKey is implemented in WebKit as opposed to being an interface Chromium
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 }; 150 };
144 151
145 // A WebIDBCallbacks implementation that doesn't return a result. 152 // A WebIDBCallbacks implementation that doesn't return a result.
146 template <> 153 template <>
147 class IndexedDBCallbacks<void> : public IndexedDBCallbacksBase { 154 class IndexedDBCallbacks<void> : public IndexedDBCallbacksBase {
148 public: 155 public:
149 IndexedDBCallbacks( 156 IndexedDBCallbacks(
150 IndexedDBDispatcherHost* dispatcher_host, int32 response_id) 157 IndexedDBDispatcherHost* dispatcher_host, int32 response_id)
151 : IndexedDBCallbacksBase(dispatcher_host, response_id) { } 158 : IndexedDBCallbacksBase(dispatcher_host, response_id) { }
152 159
160 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value) {
161 dispatcher_host()->Send(
162 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue(
163 response_id(), SerializedScriptValue(value)));
164 }
165
166 // TODO(hans): Remove when WebKit rolls.
153 virtual void onSuccess() { 167 virtual void onSuccess() {
154 dispatcher_host()->Send( 168 dispatcher_host()->Send(
155 new IndexedDBMsg_CallbacksSuccessNull(response_id())); 169 new IndexedDBMsg_CallbacksSuccessNull(response_id()));
156 } 170 }
157 171
158 private: 172 private:
159 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); 173 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
160 }; 174 };
161 175
162 class IndexedDBTransactionCallbacks 176 class IndexedDBTransactionCallbacks
163 : public WebKit::WebIDBTransactionCallbacks { 177 : public WebKit::WebIDBTransactionCallbacks {
164 public: 178 public:
165 IndexedDBTransactionCallbacks(IndexedDBDispatcherHost* dispatcher_host, 179 IndexedDBTransactionCallbacks(IndexedDBDispatcherHost* dispatcher_host,
166 int transaction_id); 180 int transaction_id);
167 181
168 virtual ~IndexedDBTransactionCallbacks(); 182 virtual ~IndexedDBTransactionCallbacks();
169 183
170 virtual void onAbort(); 184 virtual void onAbort();
171 185
172 virtual void onComplete(); 186 virtual void onComplete();
173 187
174 virtual void onTimeout(); 188 virtual void onTimeout();
175 189
176 private: 190 private:
177 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; 191 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_;
178 int transaction_id_; 192 int transaction_id_;
179 }; 193 };
180 194
181 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ 195 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698