| 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/IDBDatabase.h" | 27 #include "modules/indexeddb/IDBDatabase.h" |
| 28 | 28 |
| 29 #include "bindings/v8/ExceptionState.h" | 29 #include "bindings/v8/ExceptionState.h" |
| 30 #include "bindings/v8/ExceptionStatePlaceholder.h" | 30 #include "bindings/v8/ExceptionStatePlaceholder.h" |
| 31 #include "bindings/v8/IDBBindingUtilities.h" | 31 #include "bindings/v8/IDBBindingUtilities.h" |
| 32 #include "bindings/v8/SerializedScriptValue.h" |
| 32 #include "core/dom/ExecutionContext.h" | 33 #include "core/dom/ExecutionContext.h" |
| 33 #include "core/events/EventQueue.h" | 34 #include "core/events/EventQueue.h" |
| 34 #include "core/inspector/ScriptCallStack.h" | 35 #include "core/inspector/ScriptCallStack.h" |
| 35 #include "modules/indexeddb/IDBAny.h" | 36 #include "modules/indexeddb/IDBAny.h" |
| 36 #include "modules/indexeddb/IDBEventDispatcher.h" | 37 #include "modules/indexeddb/IDBEventDispatcher.h" |
| 37 #include "modules/indexeddb/IDBHistograms.h" | 38 #include "modules/indexeddb/IDBHistograms.h" |
| 38 #include "modules/indexeddb/IDBIndex.h" | 39 #include "modules/indexeddb/IDBIndex.h" |
| 39 #include "modules/indexeddb/IDBKeyPath.h" | 40 #include "modules/indexeddb/IDBKeyPath.h" |
| 40 #include "modules/indexeddb/IDBTracing.h" | 41 #include "modules/indexeddb/IDBTracing.h" |
| 41 #include "modules/indexeddb/IDBVersionChangeEvent.h" | 42 #include "modules/indexeddb/IDBVersionChangeEvent.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 354 |
| 354 void IDBDatabase::onVersionChange(int64_t oldVersion, int64_t newVersion) | 355 void IDBDatabase::onVersionChange(int64_t oldVersion, int64_t newVersion) |
| 355 { | 356 { |
| 356 IDB_TRACE("IDBDatabase::onVersionChange"); | 357 IDB_TRACE("IDBDatabase::onVersionChange"); |
| 357 if (m_contextStopped || !executionContext()) | 358 if (m_contextStopped || !executionContext()) |
| 358 return; | 359 return; |
| 359 | 360 |
| 360 if (m_closePending) | 361 if (m_closePending) |
| 361 return; | 362 return; |
| 362 | 363 |
| 363 RefPtr<IDBAny> newVersionAny = newVersion == IDBDatabaseMetadata::NoIntVersi
on ? IDBAny::createNull() : IDBAny::create(newVersion); | 364 RefPtr<SerializedScriptValue> newVersionSSV = (newVersion == IDBDatabaseMeta
data::NoIntVersion) ? SerializedScriptValue::nullValue() : SerializedScriptValue
::numberValue(newVersion); |
| 364 enqueueEvent(IDBVersionChangeEvent::create(IDBAny::create(oldVersion), newVe
rsionAny.release(), EventTypeNames::versionchange)); | 365 enqueueEvent(IDBVersionChangeEvent::create(EventTypeNames::versionchange, Se
rializedScriptValue::numberValue(oldVersion), newVersionSSV.release())); |
| 365 } | 366 } |
| 366 | 367 |
| 367 void IDBDatabase::enqueueEvent(PassRefPtr<Event> event) | 368 void IDBDatabase::enqueueEvent(PassRefPtr<Event> event) |
| 368 { | 369 { |
| 369 ASSERT(!m_contextStopped); | 370 ASSERT(!m_contextStopped); |
| 370 ASSERT(executionContext()); | 371 ASSERT(executionContext()); |
| 371 EventQueue* eventQueue = executionContext()->eventQueue(); | 372 EventQueue* eventQueue = executionContext()->eventQueue(); |
| 372 event->setTarget(this); | 373 event->setTarget(this); |
| 373 eventQueue->enqueueEvent(event.get()); | 374 eventQueue->enqueueEvent(event.get()); |
| 374 m_enqueuedEvents.append(event); | 375 m_enqueuedEvents.append(event); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 { | 421 { |
| 421 return EventTargetNames::IDBDatabase; | 422 return EventTargetNames::IDBDatabase; |
| 422 } | 423 } |
| 423 | 424 |
| 424 ExecutionContext* IDBDatabase::executionContext() const | 425 ExecutionContext* IDBDatabase::executionContext() const |
| 425 { | 426 { |
| 426 return ActiveDOMObject::executionContext(); | 427 return ActiveDOMObject::executionContext(); |
| 427 } | 428 } |
| 428 | 429 |
| 429 } // namespace WebCore | 430 } // namespace WebCore |
| OLD | NEW |