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 12 matching lines...) Expand all Loading... |
23 void IndexedDBDatabaseCallbacks::OnForcedClose() { | 23 void IndexedDBDatabaseCallbacks::OnForcedClose() { |
24 if (!dispatcher_host_.get()) | 24 if (!dispatcher_host_.get()) |
25 return; | 25 return; |
26 | 26 |
27 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksForcedClose( | 27 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksForcedClose( |
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 old_version, | 33 void IndexedDBDatabaseCallbacks::OnVersionChange(int64_t old_version, |
34 int64 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_DatabaseCallbacksIntVersionChange( |
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( | 42 void IndexedDBDatabaseCallbacks::OnAbort(int64_t host_transaction_id, |
43 int64 host_transaction_id, | 43 const IndexedDBDatabaseError& error) { |
44 const IndexedDBDatabaseError& error) { | |
45 if (!dispatcher_host_.get()) | 44 if (!dispatcher_host_.get()) |
46 return; | 45 return; |
47 | 46 |
48 dispatcher_host_->FinishTransaction(host_transaction_id, false); | 47 dispatcher_host_->FinishTransaction(host_transaction_id, false); |
49 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksAbort( | 48 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksAbort( |
50 ipc_thread_id_, | 49 ipc_thread_id_, |
51 ipc_database_callbacks_id_, | 50 ipc_database_callbacks_id_, |
52 dispatcher_host_->RendererTransactionId(host_transaction_id), | 51 dispatcher_host_->RendererTransactionId(host_transaction_id), |
53 error.code(), | 52 error.code(), |
54 error.message())); | 53 error.message())); |
55 } | 54 } |
56 | 55 |
57 void IndexedDBDatabaseCallbacks::OnComplete(int64 host_transaction_id) { | 56 void IndexedDBDatabaseCallbacks::OnComplete(int64_t host_transaction_id) { |
58 if (!dispatcher_host_.get()) | 57 if (!dispatcher_host_.get()) |
59 return; | 58 return; |
60 | 59 |
61 dispatcher_host_->FinishTransaction(host_transaction_id, true); | 60 dispatcher_host_->FinishTransaction(host_transaction_id, true); |
62 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksComplete( | 61 dispatcher_host_->Send(new IndexedDBMsg_DatabaseCallbacksComplete( |
63 ipc_thread_id_, | 62 ipc_thread_id_, |
64 ipc_database_callbacks_id_, | 63 ipc_database_callbacks_id_, |
65 dispatcher_host_->RendererTransactionId(host_transaction_id))); | 64 dispatcher_host_->RendererTransactionId(host_transaction_id))); |
66 } | 65 } |
67 | 66 |
68 } // namespace content | 67 } // namespace content |
OLD | NEW |