| 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/common/indexed_db/proxy_webidbtransaction_impl.h" | 5 #include "content/common/indexed_db/proxy_webidbtransaction_impl.h" |
| 6 | 6 |
| 7 #include "content/common/indexed_db/indexed_db_messages.h" | 7 #include "content/common/indexed_db/indexed_db_messages.h" |
| 8 #include "content/common/indexed_db/indexed_db_dispatcher.h" | 8 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
| 9 #include "content/common/indexed_db/proxy_webidbobjectstore_impl.h" | 9 #include "content/common/indexed_db/proxy_webidbobjectstore_impl.h" |
| 10 #include "content/common/child_thread.h" | 10 #include "content/common/child_thread.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() { | 24 RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() { |
| 25 // It's not possible for there to be pending callbacks that address this | 25 // It's not possible for there to be pending callbacks that address this |
| 26 // object since inside WebKit, they hold a reference to the object wich owns | 26 // object since inside WebKit, they hold a reference to the object wich owns |
| 27 // this object. But, if that ever changed, then we'd need to invalidate | 27 // this object. But, if that ever changed, then we'd need to invalidate |
| 28 // any such pointers. | 28 // any such pointers. |
| 29 IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionDestroyed( | 29 IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionDestroyed( |
| 30 idb_transaction_id_)); | 30 idb_transaction_id_)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 int RendererWebIDBTransactionImpl::mode() const | 33 int RendererWebIDBTransactionImpl::mode() const { |
| 34 { | |
| 35 int mode; | 34 int mode; |
| 36 IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionMode( | 35 IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionMode( |
| 37 idb_transaction_id_, &mode)); | 36 idb_transaction_id_, &mode)); |
| 38 return mode; | 37 return mode; |
| 39 } | 38 } |
| 40 | 39 |
| 41 WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( | 40 WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( |
| 42 const WebString& name, | 41 const WebString& name, |
| 43 WebKit::WebExceptionCode& ec) | 42 WebKit::WebExceptionCode& ec) { |
| 44 { | |
| 45 int object_store_id; | 43 int object_store_id; |
| 46 IndexedDBDispatcher::Send( | 44 IndexedDBDispatcher::Send( |
| 47 new IndexedDBHostMsg_TransactionObjectStore( | 45 new IndexedDBHostMsg_TransactionObjectStore( |
| 48 idb_transaction_id_, name, &object_store_id, &ec)); | 46 idb_transaction_id_, name, &object_store_id, &ec)); |
| 49 if (!object_store_id) | 47 if (!object_store_id) |
| 50 return NULL; | 48 return NULL; |
| 51 return new RendererWebIDBObjectStoreImpl(object_store_id); | 49 return new RendererWebIDBObjectStoreImpl(object_store_id); |
| 52 } | 50 } |
| 53 | 51 |
| 54 void RendererWebIDBTransactionImpl::abort() | 52 void RendererWebIDBTransactionImpl::commit() { |
| 55 { | 53 IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionCommit( |
| 54 idb_transaction_id_)); |
| 55 } |
| 56 |
| 57 void RendererWebIDBTransactionImpl::abort() { |
| 56 IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionAbort( | 58 IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionAbort( |
| 57 idb_transaction_id_)); | 59 idb_transaction_id_)); |
| 58 } | 60 } |
| 59 | 61 |
| 60 void RendererWebIDBTransactionImpl::didCompleteTaskEvents() | 62 void RendererWebIDBTransactionImpl::didCompleteTaskEvents() { |
| 61 { | |
| 62 IndexedDBDispatcher::Send( | 63 IndexedDBDispatcher::Send( |
| 63 new IndexedDBHostMsg_TransactionDidCompleteTaskEvents( | 64 new IndexedDBHostMsg_TransactionDidCompleteTaskEvents( |
| 64 idb_transaction_id_)); | 65 idb_transaction_id_)); |
| 65 } | 66 } |
| 66 | 67 |
| 67 void RendererWebIDBTransactionImpl::setCallbacks( | 68 void RendererWebIDBTransactionImpl::setCallbacks( |
| 68 WebIDBTransactionCallbacks* callbacks) | 69 WebIDBTransactionCallbacks* callbacks) { |
| 69 { | |
| 70 IndexedDBDispatcher* dispatcher = | 70 IndexedDBDispatcher* dispatcher = |
| 71 IndexedDBDispatcher::ThreadSpecificInstance(); | 71 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 72 dispatcher->RegisterWebIDBTransactionCallbacks(callbacks, | 72 dispatcher->RegisterWebIDBTransactionCallbacks(callbacks, |
| 73 idb_transaction_id_); | 73 idb_transaction_id_); |
| 74 } | 74 } |
| OLD | NEW |