| OLD | NEW |
| 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_impl.h" | 8 #include "content/renderer/render_thread_impl.h" |
| 9 #include "content/renderer/render_view_impl.h" | 9 #include "content/renderer/render_view_impl.h" |
| 10 #include "content/renderer/renderer_webidbcursor_impl.h" | 10 #include "content/renderer/renderer_webidbcursor_impl.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 } | 419 } |
| 420 | 420 |
| 421 void IndexedDBDispatcher::OnSuccessSerializedScriptValue( | 421 void IndexedDBDispatcher::OnSuccessSerializedScriptValue( |
| 422 int32 response_id, const SerializedScriptValue& value) { | 422 int32 response_id, const SerializedScriptValue& value) { |
| 423 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); | 423 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); |
| 424 callbacks->onSuccess(value); | 424 callbacks->onSuccess(value); |
| 425 pending_callbacks_.Remove(response_id); | 425 pending_callbacks_.Remove(response_id); |
| 426 } | 426 } |
| 427 | 427 |
| 428 void IndexedDBDispatcher::OnSuccessOpenCursor(int32 repsonse_id, | 428 void IndexedDBDispatcher::OnSuccessOpenCursor(int32 repsonse_id, |
| 429 int32 object_id) { | 429 int32 object_id, const IndexedDBKey& key, const IndexedDBKey& primaryKey, |
| 430 const SerializedScriptValue& value) { |
| 430 WebIDBCallbacks* callbacks = | 431 WebIDBCallbacks* callbacks = |
| 431 pending_callbacks_.Lookup(repsonse_id); | 432 pending_callbacks_.Lookup(repsonse_id); |
| 432 callbacks->onSuccess(new RendererWebIDBCursorImpl(object_id)); | 433 callbacks->onSuccess(new RendererWebIDBCursorImpl(object_id, key, |
| 434 primaryKey, value)); |
| 433 pending_callbacks_.Remove(repsonse_id); | 435 pending_callbacks_.Remove(repsonse_id); |
| 434 } | 436 } |
| 435 | 437 |
| 436 void IndexedDBDispatcher::OnBlocked(int32 response_id) { | 438 void IndexedDBDispatcher::OnBlocked(int32 response_id) { |
| 437 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); | 439 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); |
| 438 callbacks->onBlocked(); | 440 callbacks->onBlocked(); |
| 439 } | 441 } |
| 440 | 442 |
| 441 void IndexedDBDispatcher::OnError(int32 response_id, int code, | 443 void IndexedDBDispatcher::OnError(int32 response_id, int code, |
| 442 const string16& message) { | 444 const string16& message) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 461 | 463 |
| 462 void IndexedDBDispatcher::OnVersionChange(int32 database_id, | 464 void IndexedDBDispatcher::OnVersionChange(int32 database_id, |
| 463 const string16& newVersion) { | 465 const string16& newVersion) { |
| 464 WebIDBDatabaseCallbacks* callbacks = | 466 WebIDBDatabaseCallbacks* callbacks = |
| 465 pending_database_callbacks_.Lookup(database_id); | 467 pending_database_callbacks_.Lookup(database_id); |
| 466 // callbacks would be NULL if a versionchange event is received after close | 468 // callbacks would be NULL if a versionchange event is received after close |
| 467 // has been called. | 469 // has been called. |
| 468 if (callbacks) | 470 if (callbacks) |
| 469 callbacks->onVersionChange(newVersion); | 471 callbacks->onVersionChange(newVersion); |
| 470 } | 472 } |
| OLD | NEW |