Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: Source/modules/indexeddb/IDBDatabase.cpp

Issue 177633006: Implement IDBVersionChangeEvent ctor w/ IDBVersionChangeEventInit dict (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/Nullable.h ('k') | Source/modules/indexeddb/IDBOpenDBRequest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « Source/bindings/v8/Nullable.h ('k') | Source/modules/indexeddb/IDBOpenDBRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698