OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/renderer/indexed_db_dispatcher.h" | 5 #include "chrome/renderer/indexed_db_dispatcher.h" |
6 | 6 |
7 #include "chrome/common/indexed_db_messages.h" | 7 #include "chrome/common/indexed_db_messages.h" |
8 #include "chrome/renderer/render_thread.h" | 8 #include "chrome/renderer/render_thread.h" |
9 #include "chrome/renderer/render_view.h" | 9 #include "chrome/renderer/render_view.h" |
10 #include "chrome/renderer/renderer_webidbcursor_impl.h" | 10 #include "chrome/renderer/renderer_webidbcursor_impl.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 OnSuccessIDBIndex) | 45 OnSuccessIDBIndex) |
46 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIndexedDBKey, | 46 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIndexedDBKey, |
47 OnSuccessIndexedDBKey) | 47 OnSuccessIndexedDBKey) |
48 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBObjectStore, | 48 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBObjectStore, |
49 OnSuccessIDBObjectStore) | 49 OnSuccessIDBObjectStore) |
50 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBTransaction, | 50 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBTransaction, |
51 OnSuccessIDBTransaction) | 51 OnSuccessIDBTransaction) |
52 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValue, | 52 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValue, |
53 OnSuccessSerializedScriptValue) | 53 OnSuccessSerializedScriptValue) |
54 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError) | 54 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError) |
| 55 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksBlocked, OnBlocked) |
55 IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksAbort, OnAbort) | 56 IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksAbort, OnAbort) |
56 IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksComplete, OnComplete) | 57 IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksComplete, OnComplete) |
57 IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksTimeout, OnTimeout) | 58 IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksTimeout, OnTimeout) |
58 IPC_MESSAGE_UNHANDLED(handled = false) | 59 IPC_MESSAGE_UNHANDLED(handled = false) |
59 IPC_END_MESSAGE_MAP() | 60 IPC_END_MESSAGE_MAP() |
60 return handled; | 61 return handled; |
61 } | 62 } |
62 | 63 |
63 void IndexedDBDispatcher::RequestIDBCursorUpdate( | 64 void IndexedDBDispatcher::RequestIDBCursorUpdate( |
64 const SerializedScriptValue& value, | 65 const SerializedScriptValue& value, |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } | 371 } |
371 | 372 |
372 void IndexedDBDispatcher::OnSuccessOpenCursor(int32 repsonse_id, | 373 void IndexedDBDispatcher::OnSuccessOpenCursor(int32 repsonse_id, |
373 int32 object_id) { | 374 int32 object_id) { |
374 WebIDBCallbacks* callbacks = | 375 WebIDBCallbacks* callbacks = |
375 pending_callbacks_.Lookup(repsonse_id); | 376 pending_callbacks_.Lookup(repsonse_id); |
376 callbacks->onSuccess(new RendererWebIDBCursorImpl(object_id)); | 377 callbacks->onSuccess(new RendererWebIDBCursorImpl(object_id)); |
377 pending_callbacks_.Remove(repsonse_id); | 378 pending_callbacks_.Remove(repsonse_id); |
378 } | 379 } |
379 | 380 |
| 381 void IndexedDBDispatcher::OnBlocked(int32 response_id) { |
| 382 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); |
| 383 callbacks->onBlocked(); |
| 384 } |
| 385 |
380 void IndexedDBDispatcher::OnError(int32 response_id, int code, | 386 void IndexedDBDispatcher::OnError(int32 response_id, int code, |
381 const string16& message) { | 387 const string16& message) { |
382 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); | 388 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id); |
383 callbacks->onError(WebIDBDatabaseError(code, message)); | 389 callbacks->onError(WebIDBDatabaseError(code, message)); |
384 pending_callbacks_.Remove(response_id); | 390 pending_callbacks_.Remove(response_id); |
385 } | 391 } |
386 | 392 |
387 void IndexedDBDispatcher::OnAbort(int32 transaction_id) { | 393 void IndexedDBDispatcher::OnAbort(int32 transaction_id) { |
388 WebIDBTransactionCallbacks* callbacks = | 394 WebIDBTransactionCallbacks* callbacks = |
389 pending_transaction_callbacks_.Lookup(transaction_id); | 395 pending_transaction_callbacks_.Lookup(transaction_id); |
390 callbacks->onAbort(); | 396 callbacks->onAbort(); |
391 pending_transaction_callbacks_.Remove(transaction_id); | 397 pending_transaction_callbacks_.Remove(transaction_id); |
392 } | 398 } |
393 | 399 |
394 void IndexedDBDispatcher::OnComplete(int32 transaction_id) { | 400 void IndexedDBDispatcher::OnComplete(int32 transaction_id) { |
395 WebIDBTransactionCallbacks* callbacks = | 401 WebIDBTransactionCallbacks* callbacks = |
396 pending_transaction_callbacks_.Lookup(transaction_id); | 402 pending_transaction_callbacks_.Lookup(transaction_id); |
397 callbacks->onComplete(); | 403 callbacks->onComplete(); |
398 pending_transaction_callbacks_.Remove(transaction_id); | 404 pending_transaction_callbacks_.Remove(transaction_id); |
399 } | 405 } |
400 | 406 |
401 void IndexedDBDispatcher::OnTimeout(int32 transaction_id) { | 407 void IndexedDBDispatcher::OnTimeout(int32 transaction_id) { |
402 WebIDBTransactionCallbacks* callbacks = | 408 WebIDBTransactionCallbacks* callbacks = |
403 pending_transaction_callbacks_.Lookup(transaction_id); | 409 pending_transaction_callbacks_.Lookup(transaction_id); |
404 callbacks->onTimeout(); | 410 callbacks->onTimeout(); |
405 pending_transaction_callbacks_.Remove(transaction_id); | 411 pending_transaction_callbacks_.Remove(transaction_id); |
406 } | 412 } |
OLD | NEW |