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

Side by Side Diff: content/renderer/indexed_db_dispatcher.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/renderer/indexed_db_dispatcher.h" 5 #include "content/renderer/indexed_db_dispatcher.h"
6 6
7 #include "content/common/indexed_db_messages.h" 7 #include "content/common/indexed_db_messages.h"
8 #include "content/renderer/render_thread.h" 8 #include "content/renderer/render_thread.h"
9 #include "content/renderer/render_view.h" 9 #include "content/renderer/render_view.h"
10 #include "content/renderer/renderer_webidbcursor_impl.h" 10 #include "content/renderer/renderer_webidbcursor_impl.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 pending_callbacks_.Remove(response_id); 377 pending_callbacks_.Remove(response_id);
378 } 378 }
379 379
380 void IndexedDBDispatcher::OnSuccessIDBTransaction(int32 response_id, 380 void IndexedDBDispatcher::OnSuccessIDBTransaction(int32 response_id,
381 int32 object_id) { 381 int32 object_id) {
382 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); 382 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
383 callbacks->onSuccess(new RendererWebIDBTransactionImpl(object_id)); 383 callbacks->onSuccess(new RendererWebIDBTransactionImpl(object_id));
384 pending_callbacks_.Remove(response_id); 384 pending_callbacks_.Remove(response_id);
385 } 385 }
386 386
387 void IndexedDBDispatcher::OnSuccessSerializedScriptValue( 387 void IndexedDBDispatcher::OnSuccessSerializedScriptValue(
michaeln 2011/09/04 23:08:16 OnSuccessOpenCursor() is the callback for the vari
dgrogan 2011/09/07 01:15:19 OnSuccessOpenCursor is also used for a successful
388 int32 response_id, const SerializedScriptValue& value) { 388 int32 response_id, const SerializedScriptValue& value) {
389 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); 389 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
390 callbacks->onSuccess(value); 390 callbacks->onSuccess(value);
391 pending_callbacks_.Remove(response_id); 391 pending_callbacks_.Remove(response_id);
392 } 392 }
393 393
394 void IndexedDBDispatcher::OnSuccessOpenCursor(int32 repsonse_id, 394 void IndexedDBDispatcher::OnSuccessOpenCursor(int32 repsonse_id,
395 int32 object_id) { 395 int32 object_id, const IndexedDBKey& key, const IndexedDBKey& primaryKey,
396 const SerializedScriptValue& value) {
396 WebIDBCallbacks* callbacks = 397 WebIDBCallbacks* callbacks =
397 pending_callbacks_.Lookup(repsonse_id); 398 pending_callbacks_.Lookup(repsonse_id);
398 callbacks->onSuccess(new RendererWebIDBCursorImpl(object_id)); 399 callbacks->onSuccess(new RendererWebIDBCursorImpl(object_id), key,
michaeln 2011/09/04 23:08:16 Might be nice if the Cursor class contained a sing
400 primaryKey, value);
399 pending_callbacks_.Remove(repsonse_id); 401 pending_callbacks_.Remove(repsonse_id);
400 } 402 }
401 403
402 void IndexedDBDispatcher::OnBlocked(int32 response_id) { 404 void IndexedDBDispatcher::OnBlocked(int32 response_id) {
403 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); 405 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
404 callbacks->onBlocked(); 406 callbacks->onBlocked();
405 } 407 }
406 408
407 void IndexedDBDispatcher::OnError(int32 response_id, int code, 409 void IndexedDBDispatcher::OnError(int32 response_id, int code,
408 const string16& message) { 410 const string16& message) {
(...skipping 18 matching lines...) Expand all
427 429
428 void IndexedDBDispatcher::OnVersionChange(int32 database_id, 430 void IndexedDBDispatcher::OnVersionChange(int32 database_id,
429 const string16& newVersion) { 431 const string16& newVersion) {
430 WebIDBDatabaseCallbacks* callbacks = 432 WebIDBDatabaseCallbacks* callbacks =
431 pending_database_callbacks_.Lookup(database_id); 433 pending_database_callbacks_.Lookup(database_id);
432 // callbacks would be NULL if a versionchange event is received after close 434 // callbacks would be NULL if a versionchange event is received after close
433 // has been called. 435 // has been called.
434 if (callbacks) 436 if (callbacks)
435 callbacks->onVersionChange(newVersion); 437 callbacks->onVersionChange(newVersion);
436 } 438 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698