OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/indexed_db/indexed_db_database_callbacks.h" | 5 #include "content/browser/indexed_db/indexed_db_database_callbacks.h" |
6 | 6 |
7 #include "content/browser/indexed_db/indexed_db_database_error.h" | 7 #include "content/browser/indexed_db/indexed_db_database_error.h" |
8 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" | 8 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
9 #include "content/common/indexed_db/indexed_db_messages.h" | 9 #include "content/common/indexed_db/indexed_db_messages.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 ipc_thread_id_, ipc_database_callbacks_id_)); | 28 ipc_thread_id_, ipc_database_callbacks_id_)); |
29 | 29 |
30 dispatcher_host_ = NULL; | 30 dispatcher_host_ = NULL; |
31 } | 31 } |
32 | 32 |
33 void IndexedDBDatabaseCallbacks::OnVersionChange(int64_t old_version, | 33 void IndexedDBDatabaseCallbacks::OnVersionChange(int64_t old_version, |
34 int64_t new_version) { | 34 int64_t new_version) { |
35 if (!dispatcher_host_.get()) | 35 if (!dispatcher_host_.get()) |
36 return; | 36 return; |
37 | 37 |
38 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksIntVersionChange( | 38 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksVersionChange( |
39 ipc_thread_id_, ipc_database_callbacks_id_, old_version, new_version)); | 39 ipc_thread_id_, ipc_database_callbacks_id_, old_version, new_version)); |
40 } | 40 } |
41 | 41 |
42 void IndexedDBDatabaseCallbacks::OnAbort(int64_t host_transaction_id, | 42 void IndexedDBDatabaseCallbacks::OnAbort(int64_t host_transaction_id, |
43 const IndexedDBDatabaseError& error) { | 43 const IndexedDBDatabaseError& error) { |
44 if (!dispatcher_host_.get()) | 44 if (!dispatcher_host_.get()) |
45 return; | 45 return; |
46 | 46 |
47 dispatcher_host_->FinishTransaction(host_transaction_id, false); | 47 dispatcher_host_->FinishTransaction(host_transaction_id, false); |
48 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksAbort( | 48 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksAbort( |
49 ipc_thread_id_, | 49 ipc_thread_id_, |
50 ipc_database_callbacks_id_, | 50 ipc_database_callbacks_id_, |
51 dispatcher_host_->RendererTransactionId(host_transaction_id), | 51 dispatcher_host_->RendererTransactionId(host_transaction_id), |
52 error.code(), | 52 error.code(), |
53 error.message())); | 53 error.message())); |
54 } | 54 } |
55 | 55 |
56 void IndexedDBDatabaseCallbacks::OnComplete(int64_t host_transaction_id) { | 56 void IndexedDBDatabaseCallbacks::OnComplete(int64_t host_transaction_id) { |
57 if (!dispatcher_host_.get()) | 57 if (!dispatcher_host_.get()) |
58 return; | 58 return; |
59 | 59 |
60 dispatcher_host_->FinishTransaction(host_transaction_id, true); | 60 dispatcher_host_->FinishTransaction(host_transaction_id, true); |
61 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksComplete( | 61 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksComplete( |
62 ipc_thread_id_, | 62 ipc_thread_id_, |
63 ipc_database_callbacks_id_, | 63 ipc_database_callbacks_id_, |
64 dispatcher_host_->RendererTransactionId(host_transaction_id))); | 64 dispatcher_host_->RendererTransactionId(host_transaction_id))); |
65 } | 65 } |
66 | 66 |
67 } // namespace content | 67 } // namespace content |
OLD | NEW |