| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "modules/indexeddb/IDBTransaction.h" | 27 #include "modules/indexeddb/IDBTransaction.h" |
| 28 | 28 |
| 29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 30 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 31 #include "bindings/core/v8/V8PerIsolateData.h" | 31 #include "bindings/core/v8/V8PerIsolateData.h" |
| 32 #include "core/dom/DOMException.h" |
| 33 #include "core/dom/ExceptionCode.h" |
| 32 #include "core/dom/ExecutionContext.h" | 34 #include "core/dom/ExecutionContext.h" |
| 33 #include "core/events/EventQueue.h" | 35 #include "core/events/EventQueue.h" |
| 34 #include "core/inspector/ScriptCallStack.h" | 36 #include "core/inspector/ScriptCallStack.h" |
| 35 #include "modules/IndexedDBNames.h" | 37 #include "modules/IndexedDBNames.h" |
| 36 #include "modules/indexeddb/IDBDatabase.h" | 38 #include "modules/indexeddb/IDBDatabase.h" |
| 37 #include "modules/indexeddb/IDBEventDispatcher.h" | 39 #include "modules/indexeddb/IDBEventDispatcher.h" |
| 38 #include "modules/indexeddb/IDBIndex.h" | 40 #include "modules/indexeddb/IDBIndex.h" |
| 39 #include "modules/indexeddb/IDBObjectStore.h" | 41 #include "modules/indexeddb/IDBObjectStore.h" |
| 40 #include "modules/indexeddb/IDBOpenDBRequest.h" | 42 #include "modules/indexeddb/IDBOpenDBRequest.h" |
| 41 #include "modules/indexeddb/IDBTracing.h" | 43 #include "modules/indexeddb/IDBTracing.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 visitor->trace(m_openDBRequest); | 116 visitor->trace(m_openDBRequest); |
| 115 visitor->trace(m_error); | 117 visitor->trace(m_error); |
| 116 visitor->trace(m_requestList); | 118 visitor->trace(m_requestList); |
| 117 visitor->trace(m_objectStoreMap); | 119 visitor->trace(m_objectStoreMap); |
| 118 visitor->trace(m_deletedObjectStores); | 120 visitor->trace(m_deletedObjectStores); |
| 119 visitor->trace(m_objectStoreCleanupMap); | 121 visitor->trace(m_objectStoreCleanupMap); |
| 120 RefCountedGarbageCollectedEventTargetWithInlineData<IDBTransaction>::trace(v
isitor); | 122 RefCountedGarbageCollectedEventTargetWithInlineData<IDBTransaction>::trace(v
isitor); |
| 121 ActiveDOMObject::trace(visitor); | 123 ActiveDOMObject::trace(visitor); |
| 122 } | 124 } |
| 123 | 125 |
| 124 void IDBTransaction::setError(DOMError* error) | 126 void IDBTransaction::setError(DOMException* error) |
| 125 { | 127 { |
| 126 ASSERT(m_state != Finished); | 128 ASSERT(m_state != Finished); |
| 127 ASSERT(error); | 129 ASSERT(error); |
| 128 | 130 |
| 129 // The first error to be set is the true cause of the | 131 // The first error to be set is the true cause of the |
| 130 // transaction abort. | 132 // transaction abort. |
| 131 if (!m_error) { | 133 if (!m_error) { |
| 132 m_error = error; | 134 m_error = error; |
| 133 } | 135 } |
| 134 } | 136 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 m_requestList.add(request); | 226 m_requestList.add(request); |
| 225 } | 227 } |
| 226 | 228 |
| 227 void IDBTransaction::unregisterRequest(IDBRequest* request) | 229 void IDBTransaction::unregisterRequest(IDBRequest* request) |
| 228 { | 230 { |
| 229 ASSERT(request); | 231 ASSERT(request); |
| 230 // If we aborted the request, it will already have been removed. | 232 // If we aborted the request, it will already have been removed. |
| 231 m_requestList.remove(request); | 233 m_requestList.remove(request); |
| 232 } | 234 } |
| 233 | 235 |
| 234 void IDBTransaction::onAbort(DOMError* error) | 236 void IDBTransaction::onAbort(DOMException* error) |
| 235 { | 237 { |
| 236 IDB_TRACE("IDBTransaction::onAbort"); | 238 IDB_TRACE("IDBTransaction::onAbort"); |
| 237 if (m_contextStopped) { | 239 if (m_contextStopped) { |
| 238 m_database->transactionFinished(this); | 240 m_database->transactionFinished(this); |
| 239 return; | 241 return; |
| 240 } | 242 } |
| 241 | 243 |
| 242 ASSERT(m_state != Finished); | 244 ASSERT(m_state != Finished); |
| 243 if (m_state != Finishing) { | 245 if (m_state != Finishing) { |
| 244 ASSERT(error); | 246 ASSERT(error); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 event->setTarget(this); | 404 event->setTarget(this); |
| 403 eventQueue->enqueueEvent(event); | 405 eventQueue->enqueueEvent(event); |
| 404 } | 406 } |
| 405 | 407 |
| 406 WebIDBDatabase* IDBTransaction::backendDB() const | 408 WebIDBDatabase* IDBTransaction::backendDB() const |
| 407 { | 409 { |
| 408 return m_database->backend(); | 410 return m_database->backend(); |
| 409 } | 411 } |
| 410 | 412 |
| 411 } // namespace blink | 413 } // namespace blink |
| OLD | NEW |