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/browser/in_process_webkit/indexed_db_transaction_callbacks.h" | 5 #include "content/browser/in_process_webkit/indexed_db_transaction_callbacks.h" |
6 | 6 |
7 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" | 7 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
8 #include "content/common/indexed_db/indexed_db_messages.h" | 8 #include "content/common/indexed_db/indexed_db_messages.h" |
9 | 9 |
10 IndexedDBTransactionCallbacks::IndexedDBTransactionCallbacks( | 10 IndexedDBTransactionCallbacks::IndexedDBTransactionCallbacks( |
11 IndexedDBDispatcherHost* dispatcher_host, | 11 IndexedDBDispatcherHost* dispatcher_host, |
12 int thread_id, | 12 int thread_id, |
13 int transaction_id) | 13 int transaction_id) |
14 : dispatcher_host_(dispatcher_host), | 14 : dispatcher_host_(dispatcher_host), |
15 thread_id_(thread_id), | 15 thread_id_(thread_id), |
16 transaction_id_(transaction_id) { | 16 transaction_id_(transaction_id) { |
17 } | 17 } |
18 | 18 |
19 IndexedDBTransactionCallbacks::~IndexedDBTransactionCallbacks() { | 19 IndexedDBTransactionCallbacks::~IndexedDBTransactionCallbacks() { |
20 } | 20 } |
21 | 21 |
22 // TODO(jsbell): Remove once WK99097 has landed. | |
23 void IndexedDBTransactionCallbacks::onAbort() { | |
24 dispatcher_host_->Send( | |
25 new IndexedDBMsg_TransactionCallbacksAbortLegacy( | |
26 thread_id_, transaction_id_)); | |
27 } | |
28 | |
29 void IndexedDBTransactionCallbacks::onAbort( | 22 void IndexedDBTransactionCallbacks::onAbort( |
30 const WebKit::WebIDBDatabaseError& error) { | 23 const WebKit::WebIDBDatabaseError& error) { |
31 dispatcher_host_->Send( | 24 dispatcher_host_->Send( |
32 new IndexedDBMsg_TransactionCallbacksAbort( | 25 new IndexedDBMsg_TransactionCallbacksAbort( |
33 thread_id_, transaction_id_, error.code(), error.message())); | 26 thread_id_, transaction_id_, error.code(), error.message())); |
34 } | 27 } |
35 | 28 |
36 void IndexedDBTransactionCallbacks::onComplete() { | 29 void IndexedDBTransactionCallbacks::onComplete() { |
37 dispatcher_host_->TransactionComplete(transaction_id_); | 30 dispatcher_host_->TransactionComplete(transaction_id_); |
38 dispatcher_host_->Send( | 31 dispatcher_host_->Send( |
39 new IndexedDBMsg_TransactionCallbacksComplete(thread_id_, | 32 new IndexedDBMsg_TransactionCallbacksComplete(thread_id_, |
40 transaction_id_)); | 33 transaction_id_)); |
41 } | 34 } |
OLD | NEW |