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/Nullable.h" |
| 33 #include "bindings/v8/SerializedScriptValue.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/indexeddb/IDBAny.h" | 37 #include "modules/indexeddb/IDBAny.h" |
36 #include "modules/indexeddb/IDBEventDispatcher.h" | 38 #include "modules/indexeddb/IDBEventDispatcher.h" |
37 #include "modules/indexeddb/IDBHistograms.h" | 39 #include "modules/indexeddb/IDBHistograms.h" |
38 #include "modules/indexeddb/IDBIndex.h" | 40 #include "modules/indexeddb/IDBIndex.h" |
39 #include "modules/indexeddb/IDBKeyPath.h" | 41 #include "modules/indexeddb/IDBKeyPath.h" |
40 #include "modules/indexeddb/IDBTracing.h" | 42 #include "modules/indexeddb/IDBTracing.h" |
41 #include "modules/indexeddb/IDBVersionChangeEvent.h" | 43 #include "modules/indexeddb/IDBVersionChangeEvent.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 355 |
354 void IDBDatabase::onVersionChange(int64_t oldVersion, int64_t newVersion) | 356 void IDBDatabase::onVersionChange(int64_t oldVersion, int64_t newVersion) |
355 { | 357 { |
356 IDB_TRACE("IDBDatabase::onVersionChange"); | 358 IDB_TRACE("IDBDatabase::onVersionChange"); |
357 if (m_contextStopped || !executionContext()) | 359 if (m_contextStopped || !executionContext()) |
358 return; | 360 return; |
359 | 361 |
360 if (m_closePending) | 362 if (m_closePending) |
361 return; | 363 return; |
362 | 364 |
363 RefPtr<IDBAny> newVersionAny = newVersion == IDBDatabaseMetadata::NoIntVersi
on ? IDBAny::createNull() : IDBAny::create(newVersion); | 365 Nullable<unsigned long long> newVersionNullable = (newVersion == IDBDatabase
Metadata::NoIntVersion) ? Nullable<unsigned long long>() : Nullable<unsigned lon
g long>(newVersion); |
364 enqueueEvent(IDBVersionChangeEvent::create(IDBAny::create(oldVersion), newVe
rsionAny.release(), EventTypeNames::versionchange)); | 366 enqueueEvent(IDBVersionChangeEvent::create(EventTypeNames::versionchange, ol
dVersion, newVersionNullable)); |
365 } | 367 } |
366 | 368 |
367 void IDBDatabase::enqueueEvent(PassRefPtr<Event> event) | 369 void IDBDatabase::enqueueEvent(PassRefPtr<Event> event) |
368 { | 370 { |
369 ASSERT(!m_contextStopped); | 371 ASSERT(!m_contextStopped); |
370 ASSERT(executionContext()); | 372 ASSERT(executionContext()); |
371 EventQueue* eventQueue = executionContext()->eventQueue(); | 373 EventQueue* eventQueue = executionContext()->eventQueue(); |
372 event->setTarget(this); | 374 event->setTarget(this); |
373 eventQueue->enqueueEvent(event.get()); | 375 eventQueue->enqueueEvent(event.get()); |
374 m_enqueuedEvents.append(event); | 376 m_enqueuedEvents.append(event); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 { | 422 { |
421 return EventTargetNames::IDBDatabase; | 423 return EventTargetNames::IDBDatabase; |
422 } | 424 } |
423 | 425 |
424 ExecutionContext* IDBDatabase::executionContext() const | 426 ExecutionContext* IDBDatabase::executionContext() const |
425 { | 427 { |
426 return ActiveDOMObject::executionContext(); | 428 return ActiveDOMObject::executionContext(); |
427 } | 429 } |
428 | 430 |
429 } // namespace WebCore | 431 } // namespace WebCore |
OLD | NEW |