Title: [199750] trunk
Revision
199750
Author
beid...@apple.com
Date
2016-04-19 18:19:59 -0700 (Tue, 19 Apr 2016)

Log Message

Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
https://bugs.webkit.org/show_bug.cgi?id=156760

Reviewed by Darin Adler (and looked over by Chris Dumez and Alex Christensen).

Source/WebCore:

Test: storage/indexeddb/modern/idbversionchangeevent-constructor.html

Add WorkerGlobalScopeConstructors to the xcodeproj:
* WebCore.xcodeproj/project.pbxproj:

Remove the completely irrelevant webkit* prefixed constructors from DOMWindow:
* page/DOMWindow.idl:

Remove the poor way most objects were exposed on the WorkerGlobalScope:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:

Expose most of the objects on the WorkerGlobalScope the correct way:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBCursorWithValue.idl:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBKeyRange.idl:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBOpenDBRequest.idl:
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.idl:

Make IDBVersionChangeEvent constructible:
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
(WebCore::IDBVersionChangeEvent::newVersion): Deleted.
* Modules/indexeddb/IDBVersionChangeEvent.h:
* Modules/indexeddb/IDBVersionChangeEvent.idl:

* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::convertValue): Add a templated form of convertValue that
  handles Optional<>s.

LayoutTests:

* js/dom/global-constructors-attributes-idb-expected.txt: Updated for removed attributes.
* storage/indexeddb/modern/idbversionchangeevent-constructor-expected.txt: Added.
* storage/indexeddb/modern/idbversionchangeevent-constructor.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (199749 => 199750)


--- trunk/LayoutTests/ChangeLog	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/LayoutTests/ChangeLog	2016-04-20 01:19:59 UTC (rev 199750)
@@ -1,3 +1,14 @@
+2016-04-19  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
+        https://bugs.webkit.org/show_bug.cgi?id=156760
+
+        Reviewed by Darin Adler (and looked over by Chris Dumez and Alex Christensen).
+
+        * js/dom/global-constructors-attributes-idb-expected.txt: Updated for removed attributes.
+        * storage/indexeddb/modern/idbversionchangeevent-constructor-expected.txt: Added.
+        * storage/indexeddb/modern/idbversionchangeevent-constructor.html: Added.
+
 2016-04-19  Gyuyoung Kim  <gyuyoung....@webkit.org>
 
         [EFL] Unskip media tests since r199649

Modified: trunk/LayoutTests/js/dom/global-constructors-attributes-idb-expected.txt (199749 => 199750)


--- trunk/LayoutTests/js/dom/global-constructors-attributes-idb-expected.txt	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/LayoutTests/js/dom/global-constructors-attributes-idb-expected.txt	2016-04-20 01:19:59 UTC (rev 199750)
@@ -58,46 +58,6 @@
 PASS Object.getOwnPropertyDescriptor(global, 'IDBVersionChangeEvent').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'IDBVersionChangeEvent').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'IDBVersionChangeEvent').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBCursor').value is webkitIDBCursor
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBCursor').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBCursor').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBCursor').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBCursor').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBDatabase').value is webkitIDBDatabase
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBDatabase').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBDatabase').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBDatabase').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBDatabase').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBFactory').value is webkitIDBFactory
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBFactory').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBFactory').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBFactory').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBFactory').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBIndex').value is webkitIDBIndex
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBIndex').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBIndex').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBIndex').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBIndex').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBKeyRange').value is webkitIDBKeyRange
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBKeyRange').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBKeyRange').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBKeyRange').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBKeyRange').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBObjectStore').value is webkitIDBObjectStore
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBObjectStore').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBObjectStore').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBObjectStore').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBObjectStore').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBRequest').value is webkitIDBRequest
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBRequest').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBRequest').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBRequest').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBRequest').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBTransaction').value is webkitIDBTransaction
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBTransaction').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBTransaction').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBTransaction').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'webkitIDBTransaction').configurable is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Added: trunk/LayoutTests/storage/indexeddb/modern/idbversionchangeevent-constructor-expected.txt (0 => 199750)


--- trunk/LayoutTests/storage/indexeddb/modern/idbversionchangeevent-constructor-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbversionchangeevent-constructor-expected.txt	2016-04-20 01:19:59 UTC (rev 199750)
@@ -0,0 +1,22 @@
+PASS IDBVersionChangeEvent.length is 1
+event = new IDBVersionChangeEvent('foo');
+PASS event instanceof IDBVersionChangeEvent is true
+PASS event.toString() is "[object IDBVersionChangeEvent]"
+PASS event.oldVersion is 0
+PASS event.newVersion is null
+event = new IDBVersionChangeEvent('bar', { oldVersion: 2 });
+PASS event.oldVersion is 2
+PASS event.newVersion is null
+event = new IDBVersionChangeEvent('bar', { oldVersion: 6, newVersion: null });
+PASS event.oldVersion is 6
+PASS event.newVersion is null
+event = new IDBVersionChangeEvent('bar', { oldVersion: 0, newVersion: 17 });
+PASS event.oldVersion is 0
+PASS event.newVersion is 17
+event = new IDBVersionChangeEvent('bar', { oldVersion: 43876528735628, newVersion: 0 });
+PASS event.oldVersion is 43876528735628
+PASS event.newVersion is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/storage/indexeddb/modern/idbversionchangeevent-constructor.html (0 => 199750)


--- trunk/LayoutTests/storage/indexeddb/modern/idbversionchangeevent-constructor.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbversionchangeevent-constructor.html	2016-04-20 01:19:59 UTC (rev 199750)
@@ -0,0 +1,38 @@
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<script>
+
+shouldBeEqualToNumber("IDBVersionChangeEvent.length", 1);
+
+evalAndLog("event = new IDBVersionChangeEvent('foo');");
+
+shouldBeTrue("event instanceof IDBVersionChangeEvent");
+shouldBeEqualToString("event.toString()", "[object IDBVersionChangeEvent]");
+shouldBeEqualToNumber("event.oldVersion", 0);
+shouldBeNull("event.newVersion");
+
+evalAndLog("event = new IDBVersionChangeEvent('bar', { oldVersion: 2 });");
+shouldBeEqualToNumber("event.oldVersion", 2);
+shouldBeNull("event.newVersion");
+
+evalAndLog("event = new IDBVersionChangeEvent('bar', { oldVersion: 6, newVersion: null });");
+shouldBeEqualToNumber("event.oldVersion", 6);
+shouldBeNull("event.newVersion");
+
+evalAndLog("event = new IDBVersionChangeEvent('bar', { oldVersion: 0, newVersion: 17 });");
+shouldBeEqualToNumber("event.oldVersion", 0);
+shouldBeEqualToNumber("event.newVersion", 17);
+
+evalAndLog("event = new IDBVersionChangeEvent('bar', { oldVersion: 43876528735628, newVersion: 0 });");
+shouldBeEqualToNumber("event.oldVersion", 43876528735628);
+shouldBeEqualToNumber("event.newVersion", 0);
+
+finishJSTest();
+
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (199749 => 199750)


--- trunk/Source/WebCore/ChangeLog	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/ChangeLog	2016-04-20 01:19:59 UTC (rev 199750)
@@ -1,3 +1,44 @@
+2016-04-19  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
+        https://bugs.webkit.org/show_bug.cgi?id=156760
+
+        Reviewed by Darin Adler (and looked over by Chris Dumez and Alex Christensen).
+
+        Test: storage/indexeddb/modern/idbversionchangeevent-constructor.html
+
+        Add WorkerGlobalScopeConstructors to the xcodeproj:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        Remove the completely irrelevant webkit* prefixed constructors from DOMWindow:
+        * page/DOMWindow.idl:
+
+        Remove the poor way most objects were exposed on the WorkerGlobalScope:
+        * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:
+
+        Expose most of the objects on the WorkerGlobalScope the correct way:
+        * Modules/indexeddb/IDBCursor.idl:
+        * Modules/indexeddb/IDBCursorWithValue.idl:
+        * Modules/indexeddb/IDBDatabase.idl:
+        * Modules/indexeddb/IDBFactory.idl:
+        * Modules/indexeddb/IDBIndex.idl:
+        * Modules/indexeddb/IDBKeyRange.idl:
+        * Modules/indexeddb/IDBObjectStore.idl:
+        * Modules/indexeddb/IDBOpenDBRequest.idl:
+        * Modules/indexeddb/IDBRequest.idl:
+        * Modules/indexeddb/IDBTransaction.idl:
+
+        Make IDBVersionChangeEvent constructible:        
+        * Modules/indexeddb/IDBVersionChangeEvent.cpp:
+        (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
+        (WebCore::IDBVersionChangeEvent::newVersion): Deleted.
+        * Modules/indexeddb/IDBVersionChangeEvent.h:
+        * Modules/indexeddb/IDBVersionChangeEvent.idl:
+
+        * bindings/js/JSDictionary.h:
+        (WebCore::JSDictionary::convertValue): Add a templated form of convertValue that
+          handles Optional<>s.
+
 2016-04-19  Alex Christensen  <achristen...@webkit.org>
 
         Build fix after r199738

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -30,6 +30,7 @@
     ActiveDOMObject,
     SkipVTableValidation,
     JSCustomMarkFunction,
+    Exposed=(Window,Worker),
 ] interface IDBCursor {
     [CustomGetter] readonly attribute any source;
     readonly attribute DOMString direction;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -29,6 +29,7 @@
     ActiveDOMObject,
     SkipVTableValidation,
     JSCustomMarkFunction,
+    Exposed=(Window,Worker),
 ] interface IDBCursorWithValue : IDBCursor {
     readonly attribute any value;
 };

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -29,6 +29,7 @@
     ActiveDOMObject,
     EnabledAtRuntime=IndexedDB,
     SkipVTableValidation,
+    Exposed=(Window,Worker),
 ] interface IDBDatabase : EventTarget {
     readonly attribute DOMString name;
     readonly attribute unsigned long long version;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -27,6 +27,7 @@
     Conditional=INDEXED_DATABASE,
     EnabledAtRuntime=IndexedDB,
     SkipVTableValidation,
+    Exposed=(Window,Worker),
 ] interface IDBFactory {
     [CallWith=ScriptExecutionContext, RaisesException] IDBOpenDBRequest open(DOMString name, [EnforceRange] optional unsigned long long version);
     [CallWith=ScriptExecutionContext, RaisesException] IDBOpenDBRequest deleteDatabase(DOMString name);

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -29,6 +29,7 @@
     SkipVTableValidation,
     JSCustomMarkFunction,
     GenerateIsReachable=Impl,
+    Exposed=(Window,Worker),
 ] interface IDBIndex {
     readonly attribute DOMString name;
     readonly attribute IDBObjectStore objectStore;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRange.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -27,6 +27,7 @@
     Conditional=INDEXED_DATABASE,
     ImplementationLacksVTable,
     EnabledAtRuntime=IndexedDB,
+    Exposed=(Window,Worker),
 ] interface IDBKeyRange {
     [ImplementationReturnType=IDBKey] readonly attribute any lower;
     [ImplementationReturnType=IDBKey] readonly attribute any upper;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -29,6 +29,7 @@
     SkipVTableValidation,
     JSCustomMarkFunction,
     GenerateIsReachable=Impl,
+    Exposed=(Window,Worker),
 ] interface IDBObjectStore {
     readonly attribute DOMString? name;
     [ImplementationReturnType=IDBKeyPath] readonly attribute any keyPath;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -29,6 +29,7 @@
     JSGenerateToNativeObject,
     EnabledAtRuntime=IndexedDB,
     SkipVTableValidation,
+    Exposed=(Window,Worker),
 ] interface IDBOpenDBRequest : IDBRequest {
     attribute EventHandler onblocked;
     attribute EventHandler onupgradeneeded;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -33,6 +33,7 @@
     EnabledAtRuntime=IndexedDB,
     GenerateIsReachable=Impl,
     SkipVTableValidation,
+    Exposed=(Window,Worker),
 ] interface IDBRequest : EventTarget {
     [CustomGetter] readonly attribute any result;
     [GetterRaisesExceptionWithMessage] readonly attribute DOMError error;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -29,6 +29,7 @@
     ActiveDOMObject,
     EnabledAtRuntime=IndexedDB,
     SkipVTableValidation,
+    Exposed=(Window,Worker),
 ] interface IDBTransaction : EventTarget {
     readonly attribute DOMString mode;
     readonly attribute IDBDatabase db;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp	2016-04-20 01:19:59 UTC (rev 199750)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,15 +34,18 @@
     : Event(name, false /*canBubble*/, false /*cancelable*/)
     , m_requestIdentifier(requestIdentifier)
     , m_oldVersion(oldVersion)
-    , m_newVersion(newVersion)
 {
+    if (newVersion)
+        m_newVersion = newVersion;
+    else
+        m_newVersion = Nullopt;
 }
 
-Optional<uint64_t> IDBVersionChangeEvent::newVersion() const
+IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString& name, const IDBVersionChangeEventInit& init)
+    : Event(name, false /*canBubble*/, false /*cancelable*/)
+    , m_oldVersion(init.oldVersion)
+    , m_newVersion(init.newVersion)
 {
-    if (!m_newVersion)
-        return Nullopt;
-    return m_newVersion;
 }
 
 EventInterface IDBVersionChangeEvent::eventInterface() const

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h	2016-04-20 01:19:59 UTC (rev 199750)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,6 +33,11 @@
 
 namespace WebCore {
 
+struct IDBVersionChangeEventInit : public EventInit {
+    uint64_t oldVersion { 0 };
+    Optional<uint64_t> newVersion { Nullopt };
+};
+
 class IDBVersionChangeEvent final : public Event {
 public:
     static Ref<IDBVersionChangeEvent> create(uint64_t oldVersion, uint64_t newVersion, const AtomicString& eventType)
@@ -45,21 +50,27 @@
         return adoptRef(*new IDBVersionChangeEvent(requestIdentifier, oldVersion, newVersion, eventType));
     }
 
+    static Ref<IDBVersionChangeEvent> createForBindings(const AtomicString& type, const IDBVersionChangeEventInit& initializer)
+    {
+        return adoptRef(*new IDBVersionChangeEvent(type, initializer));
+    }
+
     const IDBResourceIdentifier& requestIdentifier() const { return m_requestIdentifier; }
 
     bool isVersionChangeEvent() const final { return true; }
 
     uint64_t oldVersion() const { return m_oldVersion; }
-    Optional<uint64_t> newVersion() const;
+    Optional<uint64_t> newVersion() const { return m_newVersion; }
 
 private:
     IDBVersionChangeEvent(const IDBResourceIdentifier& requestIdentifier, uint64_t oldVersion, uint64_t newVersion, const AtomicString& eventType);
+    IDBVersionChangeEvent(const AtomicString&, const IDBVersionChangeEventInit&);
 
     EventInterface eventInterface() const;
 
     IDBResourceIdentifier m_requestIdentifier;
     uint64_t m_oldVersion;
-    uint64_t m_newVersion;
+    Optional<uint64_t> m_newVersion;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -26,7 +26,9 @@
 [
     Conditional=INDEXED_DATABASE,
     EnabledAtRuntime=IndexedDB,
+    ConstructorTemplate=Event,
+    Exposed=(Window,Worker),
 ] interface IDBVersionChangeEvent : Event {
-    readonly attribute unsigned long long oldVersion;
-    readonly attribute unsigned long long? newVersion;
+    [InitializedByEventConstructor] readonly attribute unsigned long long oldVersion;
+    [InitializedByEventConstructor] readonly attribute unsigned long long? newVersion;
 };

Modified: trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl (199749 => 199750)


--- trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2016 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,29 +27,6 @@
 [
     Conditional=INDEXED_DATABASE_IN_WORKERS,
 ] partial interface WorkerGlobalScope {
-    [ImplementedAs=indexedDB] readonly attribute IDBFactory webkitIndexedDB;
-
-    attribute IDBCursorConstructor webkitIDBCursor;
-    attribute IDBDatabaseConstructor webkitIDBDatabase;
-    attribute IDBFactoryConstructor webkitIDBFactory;
-    attribute IDBIndexConstructor webkitIDBIndex;
-    attribute IDBKeyRangeConstructor webkitIDBKeyRange;
-    attribute IDBObjectStoreConstructor webkitIDBObjectStore;
-    attribute IDBRequestConstructor webkitIDBRequest;
-    attribute IDBTransactionConstructor webkitIDBTransaction;
-
-    readonly attribute IDBFactory indexedDB;
-
-    attribute IDBCursorConstructor IDBCursor;
-    attribute IDBCursorWithValueConstructor IDBCursorWithValue;
-    attribute IDBDatabaseConstructor IDBDatabase;
-    attribute IDBFactoryConstructor IDBFactory;
-    attribute IDBIndexConstructor IDBIndex;
-    attribute IDBKeyRangeConstructor IDBKeyRange;
-    attribute IDBObjectStoreConstructor IDBObjectStore;
-    attribute IDBOpenDBRequestConstructor IDBOpenDBRequest;
-    attribute IDBRequestConstructor IDBRequest;
-    attribute IDBTransactionConstructor IDBTransaction;
-    attribute IDBVersionChangeEventConstructor IDBVersionChangeEvent;
+    [EnabledAtRuntime=IndexedDB] readonly attribute IDBFactory indexedDB;
 };
 

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (199749 => 199750)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-04-20 01:19:59 UTC (rev 199750)
@@ -2794,10 +2794,10 @@
 		7E474E1E12494DC900235364 /* SQLiteDatabaseTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		7E474E1F12494DC900235364 /* SQLiteDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		7E474E2012494DC900235364 /* SQLiteDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */; };
+		7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */; };
 		7E4C96DC1AD4483500365A51 /* JSReadableStreamSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A51 /* JSReadableStreamSource.cpp */; };
+		7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A50 /* JSFetchRequest.h */; };
 		7E4C96DD1AD4483500365A51 /* JSReadableStreamSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A51 /* JSReadableStreamSource.h */; };
-		7E4C96DC1AD4483500365A50 /* JSFetchRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */; };
-		7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C96D91AD4483500365A50 /* JSFetchRequest.h */; };
 		7E4DE10D198B10B60051CB02 /* DiskCacheMonitorCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E4DE10C198B10B60051CB02 /* DiskCacheMonitorCocoa.mm */; };
 		7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */; };
 		7E5D7A77161D3F8F00896C34 /* OESElementIndexUint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */; };
@@ -8997,8 +8997,8 @@
 		4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamPrivateConstructors.h; sourceTree = "<group>"; };
 		413015D51C7B570400091C6E /* FetchResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchResponse.cpp; sourceTree = "<group>"; };
 		413015D51C7B570400091C6F /* FetchResponseSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchResponseSource.cpp; sourceTree = "<group>"; };
+		413015D61C7B570400091C6E /* FetchResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchResponse.h; sourceTree = "<group>"; };
 		413015D61C7B570400091C6F /* FetchResponseSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchResponseSource.h; sourceTree = "<group>"; };
-		413015D61C7B570400091C6E /* FetchResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchResponse.h; sourceTree = "<group>"; };
 		413015D71C7B570400091C6E /* FetchResponse.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FetchResponse.idl; sourceTree = "<group>"; };
 		413015D81C7B570400091C6E /* FetchResponse.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = FetchResponse.js; sourceTree = "<group>"; };
 		4138D3331244054800323D33 /* EventContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventContext.h; sourceTree = "<group>"; };
@@ -9659,6 +9659,7 @@
 		51741D0B0B07259A00ED442C /* BackForwardClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardClient.h; sourceTree = "<group>"; };
 		51741D0D0B07259A00ED442C /* HistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HistoryItem.h; sourceTree = "<group>"; };
 		51741D0E0B07259A00ED442C /* HistoryItem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryItem.cpp; sourceTree = "<group>"; };
+		51748FA21CC6EEEB00728D84 /* WorkerGlobalScopeConstructors.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = WorkerGlobalScopeConstructors.idl; sourceTree = "<group>"; };
 		5174E20810A1F44F00F95E6F /* PopStateEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PopStateEvent.h; sourceTree = "<group>"; };
 		5174E20B10A1F49A00F95E6F /* PopStateEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PopStateEvent.idl; sourceTree = "<group>"; };
 		51771DFC1BDB475600CAE8E4 /* MemoryObjectStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryObjectStore.cpp; sourceTree = "<group>"; };
@@ -10447,10 +10448,10 @@
 		7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteDatabaseTrackerClient.h; sourceTree = "<group>"; };
 		7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteDatabaseTracker.h; sourceTree = "<group>"; };
 		7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteDatabaseTracker.cpp; sourceTree = "<group>"; };
+		7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchRequest.cpp; sourceTree = "<group>"; };
 		7E4C96D81AD4483500365A51 /* JSReadableStreamSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamSource.cpp; sourceTree = "<group>"; };
+		7E4C96D91AD4483500365A50 /* JSFetchRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchRequest.h; sourceTree = "<group>"; };
 		7E4C96D91AD4483500365A51 /* JSReadableStreamSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamSource.h; sourceTree = "<group>"; };
-		7E4C96D81AD4483500365A50 /* JSFetchRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFetchRequest.cpp; sourceTree = "<group>"; };
-		7E4C96D91AD4483500365A50 /* JSFetchRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFetchRequest.h; sourceTree = "<group>"; };
 		7E4DE10C198B10B60051CB02 /* DiskCacheMonitorCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskCacheMonitorCocoa.mm; sourceTree = "<group>"; };
 		7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OESElementIndexUint.cpp; sourceTree = "<group>"; };
 		7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OESElementIndexUint.h; sourceTree = "<group>"; };
@@ -17694,6 +17695,7 @@
 				1A1414B413A0F0500019996C /* WebKitFontFamilyNames.h */,
 				99CC0B6818BEA1FF006CEBCC /* WebReplayInputs.cpp */,
 				99CC0B6918BEA1FF006CEBCC /* WebReplayInputs.h */,
+				51748FA21CC6EEEB00728D84 /* WorkerGlobalScopeConstructors.idl */,
 				9908B0F91BCAD07D00ED0F75 /* WritableStreamBuiltins.cpp */,
 				9B03D8061BB3110D00B764E8 /* WritableStreamBuiltins.h */,
 				9908B0FD1BCAD07D00ED0F75 /* WritableStreamInternalsBuiltins.cpp */,

Modified: trunk/Source/WebCore/bindings/js/JSDictionary.h (199749 => 199750)


--- trunk/Source/WebCore/bindings/js/JSDictionary.h	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.h	2016-04-20 01:19:59 UTC (rev 199750)
@@ -33,6 +33,7 @@
 #include <runtime/JSCInlines.h>
 #include <runtime/Uint8Array.h>
 #include <wtf/Forward.h>
+#include <wtf/Optional.h>
 
 namespace Deprecated {
 class ScriptValue;
@@ -101,6 +102,19 @@
     GetPropertyResult tryGetPropertyAndResult(const char* propertyName, T* context, void (*setter)(T* context, const Result&)) const;
     GetPropertyResult tryGetProperty(const char* propertyName, JSC::JSValue&) const;
 
+    template <typename T>
+    static void convertValue(JSC::ExecState* execState, JSC::JSValue value, Optional<T>& result)
+    {
+        if (value.isUndefinedOrNull()) {
+            result = Nullopt;
+            return;
+        }
+
+        T actualResult;
+        convertValue(execState, value, actualResult);
+        result = actualResult;
+    }
+    
     static void convertValue(JSC::ExecState*, JSC::JSValue, bool& result);
     static void convertValue(JSC::ExecState*, JSC::JSValue, int& result);
     static void convertValue(JSC::ExecState*, JSC::JSValue, unsigned& result);

Modified: trunk/Source/WebCore/page/DOMWindow.idl (199749 => 199750)


--- trunk/Source/WebCore/page/DOMWindow.idl	2016-04-20 01:05:36 UTC (rev 199749)
+++ trunk/Source/WebCore/page/DOMWindow.idl	2016-04-20 01:19:59 UTC (rev 199750)
@@ -193,14 +193,6 @@
 
     attribute DOMURLConstructor webkitURL; // FIXME: deprecate this.
     attribute MutationObserverConstructor WebKitMutationObserver; // FIXME: Add metrics to determine when we can remove this.
-    [Conditional=INDEXED_DATABASE, EnabledAtRuntime=IndexedDB] attribute IDBCursorConstructor webkitIDBCursor;
-    [Conditional=INDEXED_DATABASE, EnabledAtRuntime=IndexedDB] attribute IDBDatabaseConstructor webkitIDBDatabase;
-    [Conditional=INDEXED_DATABASE, EnabledAtRuntime=IndexedDB] attribute IDBFactoryConstructor webkitIDBFactory;
-    [Conditional=INDEXED_DATABASE, EnabledAtRuntime=IndexedDB] attribute IDBIndexConstructor webkitIDBIndex;
-    [Conditional=INDEXED_DATABASE, EnabledAtRuntime=IndexedDB] attribute IDBKeyRangeConstructor webkitIDBKeyRange;
-    [Conditional=INDEXED_DATABASE, EnabledAtRuntime=IndexedDB] attribute IDBObjectStoreConstructor webkitIDBObjectStore;
-    [Conditional=INDEXED_DATABASE, EnabledAtRuntime=IndexedDB] attribute IDBRequestConstructor webkitIDBRequest;
-    [Conditional=INDEXED_DATABASE, EnabledAtRuntime=IndexedDB] attribute IDBTransactionConstructor webkitIDBTransaction;
 #endif // defined(LANGUAGE_JAVASCRIPT)
 
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to