Title: [207806] trunk
Revision
207806
Author
[email protected]
Date
2016-10-24 22:16:00 -0700 (Mon, 24 Oct 2016)

Log Message

IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter
https://bugs.webkit.org/show_bug.cgi?id=163916

Reviewed by Darin Adler.

Source/WebCore:

IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter:
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
- https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStoreParameters

Align our IDL with the specification.

No new tests, no expected Web-exposed behavior change.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPath::IDBKeyPath):
* Modules/indexeddb/IDBKeyPath.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue): Deleted.
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSIDBDatabaseCustom.cpp: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
(GenerateConstructorDefinition):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
* dom/MessageEvent.h:
* testing/TypeConversions.h:
(WebCore::TypeConversions::setTypeConversionsDictionary):

LayoutTests:

Rebaseline existing tests now that the exception messages differ slightly.

* storage/indexeddb/create-object-store-options-expected.txt:
* storage/indexeddb/create-object-store-options-private-expected.txt:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (207805 => 207806)


--- trunk/LayoutTests/ChangeLog	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/LayoutTests/ChangeLog	2016-10-25 05:16:00 UTC (rev 207806)
@@ -1,3 +1,15 @@
+2016-10-24  Chris Dumez  <[email protected]>
+
+        IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter
+        https://bugs.webkit.org/show_bug.cgi?id=163916
+
+        Reviewed by Darin Adler.
+
+        Rebaseline existing tests now that the exception messages differ slightly.
+
+        * storage/indexeddb/create-object-store-options-expected.txt:
+        * storage/indexeddb/create-object-store-options-private-expected.txt:
+
 2016-10-24  Alex Christensen  <[email protected]>
 
         URLParser should match old URL::parse with %2E in path

Modified: trunk/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt (207805 => 207806)


--- trunk/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt	2016-10-25 05:16:00 UTC (rev 207806)
@@ -15,10 +15,10 @@
 trans.objectStore('a').put({'a': 0})
 Expecting TypeError exception from db.createObjectStore('d', 'bar');
 PASS Exception was thrown.
-PASS db.createObjectStore('d', 'bar'); threw TypeError: Not an object.
+PASS db.createObjectStore('d', 'bar'); threw TypeError: Type error
 Expecting TypeError exception from db.createObjectStore('e', false);
 PASS Exception was thrown.
-PASS db.createObjectStore('e', false); threw TypeError: Not an object.
+PASS db.createObjectStore('e', false); threw TypeError: Type error
 trans.objectStore('b').put({'a': 0}, 0)
 trans.objectStore('a').get(0)
 PASS event.target.result.a is {a: 0}

Modified: trunk/LayoutTests/storage/indexeddb/create-object-store-options-private-expected.txt (207805 => 207806)


--- trunk/LayoutTests/storage/indexeddb/create-object-store-options-private-expected.txt	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/LayoutTests/storage/indexeddb/create-object-store-options-private-expected.txt	2016-10-25 05:16:00 UTC (rev 207806)
@@ -15,10 +15,10 @@
 trans.objectStore('a').put({'a': 0})
 Expecting TypeError exception from db.createObjectStore('d', 'bar');
 PASS Exception was thrown.
-PASS db.createObjectStore('d', 'bar'); threw TypeError: Not an object.
+PASS db.createObjectStore('d', 'bar'); threw TypeError: Type error
 Expecting TypeError exception from db.createObjectStore('e', false);
 PASS Exception was thrown.
-PASS db.createObjectStore('e', false); threw TypeError: Not an object.
+PASS db.createObjectStore('e', false); threw TypeError: Type error
 trans.objectStore('b').put({'a': 0}, 0)
 trans.objectStore('a').get(0)
 PASS event.target.result.a is {a: 0}

Modified: trunk/Source/WebCore/CMakeLists.txt (207805 => 207806)


--- trunk/Source/WebCore/CMakeLists.txt	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/CMakeLists.txt	2016-10-25 05:16:00 UTC (rev 207806)
@@ -1146,7 +1146,6 @@
     bindings/js/JSHistoryCustom.cpp
     bindings/js/JSIDBCursorCustom.cpp
     bindings/js/JSIDBCursorWithValueCustom.cpp
-    bindings/js/JSIDBDatabaseCustom.cpp
     bindings/js/JSIDBIndexCustom.cpp
     bindings/js/JSIDBObjectStoreCustom.cpp
     bindings/js/JSIDBRequestCustom.cpp

Modified: trunk/Source/WebCore/ChangeLog (207805 => 207806)


--- trunk/Source/WebCore/ChangeLog	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/ChangeLog	2016-10-25 05:16:00 UTC (rev 207806)
@@ -1,3 +1,40 @@
+2016-10-24  Chris Dumez  <[email protected]>
+
+        IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter
+        https://bugs.webkit.org/show_bug.cgi?id=163916
+
+        Reviewed by Darin Adler.
+
+        IDBDatabase.createObjectStore() should take a IDBObjectStoreParameters dictionary in parameter:
+        - https://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
+        - https://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStoreParameters
+
+        Align our IDL with the specification.
+
+        No new tests, no expected Web-exposed behavior change.
+
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::createObjectStore):
+        * Modules/indexeddb/IDBDatabase.h:
+        * Modules/indexeddb/IDBDatabase.idl:
+        * Modules/indexeddb/IDBKeyPath.cpp:
+        (WebCore::IDBKeyPath::IDBKeyPath):
+        * Modules/indexeddb/IDBKeyPath.h:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::idbKeyPathFromValue): Deleted.
+        * bindings/js/IDBBindingUtilities.h:
+        * bindings/js/JSIDBDatabaseCustom.cpp: Removed.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateParametersCheck):
+        (GenerateConstructorDefinition):
+        * dom/MessageEvent.cpp:
+        (WebCore::MessageEvent::MessageEvent):
+        (WebCore::MessageEvent::create):
+        * dom/MessageEvent.h:
+        * testing/TypeConversions.h:
+        (WebCore::TypeConversions::setTypeConversionsDictionary):
+
 2016-10-24  Alex Christensen  <[email protected]>
 
         URLParser should match old URL::parse with %2E in path

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (207805 => 207806)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp	2016-10-25 05:16:00 UTC (rev 207806)
@@ -130,14 +130,8 @@
     m_versionChangeTransaction->renameIndex(index, newName);
 }
 
-ExceptionOr<Ref<IDBObjectStore>> IDBDatabase::createObjectStore(const String&, const Dictionary&)
+ExceptionOr<Ref<IDBObjectStore>> IDBDatabase::createObjectStore(const String& name, ObjectStoreParameters&& parameters)
 {
-    ASSERT_NOT_REACHED();
-    return Exception { IDBDatabaseException::InvalidStateError };
-}
-
-ExceptionOr<Ref<IDBObjectStore>> IDBDatabase::createObjectStore(const String& name, const IDBKeyPath& keyPath, bool autoIncrement)
-{
     LOG(IndexedDB, "IDBDatabase::createObjectStore - (%s %s)", m_info.name().utf8().data(), name.utf8().data());
 
     ASSERT(currentThread() == originThreadID());
@@ -152,14 +146,15 @@
     if (m_info.hasObjectStore(name))
         return Exception { IDBDatabaseException::ConstraintError, ASCIILiteral("Failed to execute 'createObjectStore' on 'IDBDatabase': An object store with the specified name already exists.") };
 
+    IDBKeyPath keyPath(WTFMove(parameters.keyPath));
     if (!keyPath.isNull() && !keyPath.isValid())
         return Exception { IDBDatabaseException::SyntaxError, ASCIILiteral("Failed to execute 'createObjectStore' on 'IDBDatabase': The keyPath option is not a valid key path.") };
 
-    if (autoIncrement && ((keyPath.type() == IDBKeyPath::Type::String && keyPath.string().isEmpty()) || keyPath.type() == IDBKeyPath::Type::Array))
+    if (parameters.autoIncrement && ((keyPath.type() == IDBKeyPath::Type::String && keyPath.string().isEmpty()) || keyPath.type() == IDBKeyPath::Type::Array))
         return Exception { IDBDatabaseException::InvalidAccessError, ASCIILiteral("Failed to execute 'createObjectStore' on 'IDBDatabase': The autoIncrement option was set but the keyPath option was empty or an array.") };
 
     // Install the new ObjectStore into the connection's metadata.
-    auto info = m_info.createNewObjectStore(name, keyPath, autoIncrement);
+    auto info = m_info.createNewObjectStore(name, keyPath, parameters.autoIncrement);
 
     // Create the actual IDBObjectStore from the transaction, which also schedules the operation server side.
     return m_versionChangeTransaction->createObjectStore(info);

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h (207805 => 207806)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h	2016-10-25 05:16:00 UTC (rev 207806)
@@ -34,6 +34,7 @@
 #include "IDBConnectionProxy.h"
 #include "IDBConnectionToServer.h"
 #include "IDBDatabaseInfo.h"
+#include "IDBKeyPath.h"
 
 namespace WebCore {
 
@@ -55,8 +56,13 @@
     uint64_t version() const;
     RefPtr<DOMStringList> objectStoreNames() const;
 
-    ExceptionOr<Ref<IDBObjectStore>> createObjectStore(const String& name, const Dictionary&);
-    ExceptionOr<Ref<IDBObjectStore>> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement);
+    struct ObjectStoreParameters {
+        Optional<IDBKeyPathVariant> keyPath;
+        bool autoIncrement;
+    };
+
+    ExceptionOr<Ref<IDBObjectStore>> createObjectStore(const String& name, ObjectStoreParameters&&);
+
     ExceptionOr<Ref<IDBTransaction>> transaction(const Vector<String>&, const String& mode);
     ExceptionOr<Ref<IDBTransaction>> transaction(const String&, const String& mode);
     ExceptionOr<void> deleteObjectStore(const String& name);

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl (207805 => 207806)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl	2016-10-25 05:16:00 UTC (rev 207806)
@@ -34,7 +34,7 @@
     readonly attribute unsigned long long version;
     readonly attribute DOMStringList objectStoreNames;
 
-    [Custom, MayThrowException] IDBObjectStore createObjectStore(DOMString name, optional Dictionary options);
+    [MayThrowException] IDBObjectStore createObjectStore(DOMString name, optional IDBObjectStoreParameters parameters);
     [MayThrowException] void deleteObjectStore(DOMString name);
     [MayThrowException] IDBTransaction transaction(DOMString storeName, optional DOMString mode = "readonly");
     [MayThrowException] IDBTransaction transaction(sequence<DOMString> storeNames, optional DOMString mode = "readonly");
@@ -47,3 +47,8 @@
     attribute EventHandler onerror;
     attribute EventHandler onversionchange;
 };
+
+dictionary IDBObjectStoreParameters {
+    (DOMString or sequence<DOMString>)? keyPath = null;
+    boolean autoIncrement = false;
+};

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp (207805 => 207806)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp	2016-10-25 05:16:00 UTC (rev 207806)
@@ -208,6 +208,20 @@
 #endif
 }
 
+IDBKeyPath::IDBKeyPath(Optional<IDBKeyPathVariant>&& variant)
+{
+    if (!variant)
+        return;
+
+    if (WTF::holds_alternative<String>(*variant)) {
+        m_type = Type::String;
+        m_string = WTFMove(WTF::get<String>(*variant));
+    } else {
+        m_type = Type::Array;
+        m_array = WTFMove(WTF::get<Vector<String>>(*variant));
+    }
+}
+
 bool IDBKeyPath::isValid() const
 {
     switch (m_type) {

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.h (207805 => 207806)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.h	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.h	2016-10-25 05:16:00 UTC (rev 207806)
@@ -27,11 +27,14 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include <wtf/Variant.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
+using IDBKeyPathVariant = WTF::Variant<String, Vector<String>>;
+
 class KeyedDecoder;
 class KeyedEncoder;
 
@@ -44,11 +47,13 @@
 
 void IDBParseKeyPath(const String&, Vector<String>&, IDBKeyPathParseError&);
 
+// FIXME: We should be able to replace IDBKeyPath with IDBKeyPathVariant.
 class IDBKeyPath {
 public:
     IDBKeyPath() { }
     WEBCORE_EXPORT IDBKeyPath(const String&);
     WEBCORE_EXPORT IDBKeyPath(const Vector<String>& array);
+    WEBCORE_EXPORT IDBKeyPath(Optional<IDBKeyPathVariant>&&);
 
     enum class Type { Null, String, Array };
     Type type() const { return m_type; }

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207805 => 207806)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-10-25 05:16:00 UTC (rev 207806)
@@ -1547,9 +1547,9 @@
 		415071581685067300C3C7B3 /* SelectorFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 415071561685067300C3C7B3 /* SelectorFilter.h */; };
 		4150F9F112B6E0E70008C860 /* SliderThumbElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */; };
 		4150F9F212B6E0E70008C860 /* SliderThumbElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */; };
+		415670471DBE1533009AC3BB /* PeerConnectionStates.h in Headers */ = {isa = PBXBuildFile; fileRef = 415670461DBE1524009AC3BB /* PeerConnectionStates.h */; };
 		4157AF8012F1FB0400A8C6F5 /* MediaControlsApple.h in Headers */ = {isa = PBXBuildFile; fileRef = 4157AF7E12F1FB0400A8C6F5 /* MediaControlsApple.h */; };
 		4157AF8112F1FB0400A8C6F5 /* MediaControlsApple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4157AF7F12F1FB0400A8C6F5 /* MediaControlsApple.cpp */; };
-		415670471DBE1533009AC3BB /* PeerConnectionStates.h in Headers */ = {isa = PBXBuildFile; fileRef = 415670461DBE1524009AC3BB /* PeerConnectionStates.h */; };
 		41614A781DA6423B004AD06F /* HTTPHeaderValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41614A761DA64236004AD06F /* HTTPHeaderValues.cpp */; };
 		41614A791DA64241004AD06F /* HTTPHeaderValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 41614A771DA64236004AD06F /* HTTPHeaderValues.h */; };
 		4162A450101145AE00DFF3ED /* DedicatedWorkerGlobalScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4162A44D101145AE00DFF3ED /* DedicatedWorkerGlobalScope.cpp */; };
@@ -2001,7 +2001,6 @@
 		511EF2C917F0FD3500E4FA16 /* JSIDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2B317F0FC4800E4FA16 /* JSIDBRequest.cpp */; };
 		511EF2CA17F0FD3500E4FA16 /* JSIDBTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2B417F0FC4800E4FA16 /* JSIDBTransaction.cpp */; };
 		511EF2CB17F0FD3500E4FA16 /* JSIDBVersionChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269239911505E1AA009E57FC /* JSIDBVersionChangeEvent.cpp */; };
-		511EF2D017F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2CD17F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp */; };
 		511EF2D117F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */; };
 		5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */; };
 		5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5126E6BA0A2E3B12005C29FA /* IconDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -8546,9 +8545,9 @@
 		415071561685067300C3C7B3 /* SelectorFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorFilter.h; sourceTree = "<group>"; };
 		4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SliderThumbElement.h; sourceTree = "<group>"; };
 		4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SliderThumbElement.cpp; sourceTree = "<group>"; };
+		415670461DBE1524009AC3BB /* PeerConnectionStates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeerConnectionStates.h; sourceTree = "<group>"; };
 		4157AF7E12F1FB0400A8C6F5 /* MediaControlsApple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaControlsApple.h; sourceTree = "<group>"; };
 		4157AF7F12F1FB0400A8C6F5 /* MediaControlsApple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControlsApple.cpp; sourceTree = "<group>"; };
-		415670461DBE1524009AC3BB /* PeerConnectionStates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeerConnectionStates.h; sourceTree = "<group>"; };
 		41614A761DA64236004AD06F /* HTTPHeaderValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderValues.cpp; sourceTree = "<group>"; };
 		41614A771DA64236004AD06F /* HTTPHeaderValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPHeaderValues.h; sourceTree = "<group>"; };
 		4162A44D101145AE00DFF3ED /* DedicatedWorkerGlobalScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DedicatedWorkerGlobalScope.cpp; sourceTree = "<group>"; };
@@ -9071,7 +9070,6 @@
 		511EF2B217F0FC4800E4FA16 /* JSIDBOpenDBRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSIDBOpenDBRequest.h; sourceTree = "<group>"; };
 		511EF2B317F0FC4800E4FA16 /* JSIDBRequest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBRequest.cpp; sourceTree = "<group>"; };
 		511EF2B417F0FC4800E4FA16 /* JSIDBTransaction.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBTransaction.cpp; sourceTree = "<group>"; };
-		511EF2CD17F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBDatabaseCustom.cpp; sourceTree = "<group>"; };
 		511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBObjectStoreCustom.cpp; sourceTree = "<group>"; };
 		511FAEA91BDC989A00B4AFE4 /* ThreadSafeDataBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadSafeDataBuffer.h; sourceTree = "<group>"; };
 		5123AF161890A4CA0031CDC9 /* IDBKeyRangeData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBKeyRangeData.cpp; sourceTree = "<group>"; };
@@ -21621,7 +21619,6 @@
 				D6F7960C166FFECE0076DD18 /* JSHTMLTemplateElementCustom.cpp */,
 				512BDB4C1C46B0FF006494DF /* JSIDBCursorCustom.cpp */,
 				5141298D1C5FD7E90059E714 /* JSIDBCursorWithValueCustom.cpp */,
-				511EF2CD17F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp */,
 				5141299A1C6C166D0059E714 /* JSIDBIndexCustom.cpp */,
 				511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */,
 				934F31B41CC0737200DB43DC /* JSIDBRequestCustom.cpp */,
@@ -29386,7 +29383,6 @@
 				511EF2C217F0FD3500E4FA16 /* JSIDBCursorWithValue.cpp in Sources */,
 				5141298E1C5FD83A0059E714 /* JSIDBCursorWithValueCustom.cpp in Sources */,
 				511EF2C317F0FD3500E4FA16 /* JSIDBDatabase.cpp in Sources */,
-				511EF2D017F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp in Sources */,
 				511EF2C417F0FD3500E4FA16 /* JSIDBFactory.cpp in Sources */,
 				511EF2C517F0FD3500E4FA16 /* JSIDBIndex.cpp in Sources */,
 				5141299B1C6C16740059E714 /* JSIDBIndexCustom.cpp in Sources */,

Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (207805 => 207806)


--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2016-10-25 05:16:00 UTC (rev 207806)
@@ -176,16 +176,6 @@
     return IDBKey::createInvalid();
 }
 
-IDBKeyPath idbKeyPathFromValue(ExecState& exec, JSValue keyPathValue)
-{
-    IDBKeyPath keyPath;
-    if (isJSArray(keyPathValue))
-        keyPath = IDBKeyPath(convert<IDLSequence<IDLDOMString>>(exec, keyPathValue));
-    else
-        keyPath = IDBKeyPath(keyPathValue.toWTFString(&exec));
-    return keyPath;
-}
-
 static JSValue getNthValueOnKeyPath(ExecState& exec, JSValue rootValue, const Vector<String>& keyPathElements, size_t index)
 {
     JSValue currentValue(rootValue);

Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h (207805 => 207806)


--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h	2016-10-25 05:16:00 UTC (rev 207806)
@@ -47,7 +47,6 @@
 class JSDOMGlobalObject;
 class ThreadSafeDataBuffer;
 
-IDBKeyPath idbKeyPathFromValue(JSC::ExecState&, JSC::JSValue);
 JSC::JSValue toJS(JSC::ExecState&, JSDOMGlobalObject&, const IDBKeyPath&);
 
 RefPtr<IDBKey> maybeCreateIDBKeyFromScriptValueAndKeyPath(JSC::ExecState&, const JSC::JSValue&, const IDBKeyPath&);

Deleted: trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp (207805 => 207806)


--- trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp	2016-10-25 05:16:00 UTC (rev 207806)
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2012 Michael Pruett <[email protected]>
- * Copyright (C) 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 are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "JSIDBDatabase.h"
-
-#include "IDBBindingUtilities.h"
-#include "IDBDatabase.h"
-#include "IDBKeyPath.h"
-#include "IDBObjectStore.h"
-#include "JSDOMBinding.h"
-#include "JSDOMStringList.h"
-#include "JSIDBObjectStore.h"
-#include <runtime/Error.h>
-#include <runtime/JSString.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSIDBDatabase::createObjectStore(ExecState& state)
-{
-    VM& vm = state.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    if (state.argumentCount() < 1)
-        return throwException(&state, scope, createNotEnoughArgumentsError(&state));
-
-    String name = state.argument(0).toString(&state)->value(&state);
-    RETURN_IF_EXCEPTION(scope, JSValue());
-
-    JSValue optionsValue = state.argument(1);
-    if (!optionsValue.isUndefinedOrNull() && !optionsValue.isObject())
-        return throwTypeError(&state, scope, ASCIILiteral("Not an object."));
-
-    IDBKeyPath keyPath;
-    bool autoIncrement = false;
-    if (!optionsValue.isUndefinedOrNull()) {
-        JSValue keyPathValue = optionsValue.get(&state, Identifier::fromString(&state, "keyPath"));
-        RETURN_IF_EXCEPTION(scope, JSValue());
-
-        if (!keyPathValue.isUndefinedOrNull()) {
-            keyPath = idbKeyPathFromValue(state, keyPathValue);
-            RETURN_IF_EXCEPTION(scope, JSValue());
-        }
-
-        autoIncrement = optionsValue.get(&state, Identifier::fromString(&state, "autoIncrement")).toBoolean(&state);
-        RETURN_IF_EXCEPTION(scope, JSValue());
-    }
-
-    return toJS(state, *globalObject(), scope, wrapped().createObjectStore(name, keyPath, autoIncrement));
-}
-
-}
-
-#endif

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207805 => 207806)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-25 05:16:00 UTC (rev 207806)
@@ -4428,7 +4428,7 @@
             if ($codeGenerator->IsTypedArrayType($type) and $parameter->type ne "ArrayBuffer") {
                $value = $shouldPassByReference ? "$name.releaseNonNull()" : "WTFMove($name)";
             } elsif ($codeGenerator->IsDictionaryType($type)) {
-                $value = "${name}";
+                $value = "WTFMove($name)";
             }
         }
 
@@ -5866,8 +5866,6 @@
                 last if $index eq $paramIndex;
                 if (ShouldPassWrapperByReference($parameter, $interface)) {
                     push(@constructorArgList, "*" . $parameter->name);
-                } elsif ($codeGenerator->IsDictionaryType($parameter->type)) {
-                    push(@constructorArgList, $parameter->name);
                 } else {
                     push(@constructorArgList, "WTFMove(" . $parameter->name . ")");
                 }

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp (207805 => 207806)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp	2016-10-25 05:16:00 UTC (rev 207806)
@@ -129,7 +129,7 @@
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     auto eventInitDict = convert<IDLDictionary<TestEventConstructor::Init>>(*state, state->argument(1));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto object = TestEventConstructor::create(WTFMove(type), eventInitDict);
+    auto object = TestEventConstructor::create(WTFMove(type), WTFMove(eventInitDict));
     return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (207805 => 207806)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-10-25 05:16:00 UTC (rev 207806)
@@ -8177,7 +8177,7 @@
         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
     auto init = convert<IDLDictionary<TestObj::Dictionary>>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    impl.attachShadowRoot(init);
+    impl.attachShadowRoot(WTFMove(init));
     return JSValue::encode(jsUndefined());
 }
 
@@ -8197,7 +8197,7 @@
         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
     auto dict = convert<IDLDictionary<DictionaryImplName>>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    impl.operationWithExternalDictionaryParameter(dict);
+    impl.operationWithExternalDictionaryParameter(WTFMove(dict));
     return JSValue::encode(jsUndefined());
 }
 

Modified: trunk/Source/WebCore/dom/MessageEvent.cpp (207805 => 207806)


--- trunk/Source/WebCore/dom/MessageEvent.cpp	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/dom/MessageEvent.cpp	2016-10-25 05:16:00 UTC (rev 207806)
@@ -41,7 +41,7 @@
 {
 }
 
-inline MessageEvent::MessageEvent(ExecState& state, const AtomicString& type, Init& initializer, IsTrusted isTrusted)
+inline MessageEvent::MessageEvent(ExecState& state, const AtomicString& type, Init&& initializer, IsTrusted isTrusted)
     : Event(type, initializer, isTrusted)
     , m_dataType(DataTypeScriptValue)
     , m_dataAsScriptValue(state.vm(), initializer.data)
@@ -126,9 +126,9 @@
     return adoptRef(*new MessageEvent);
 }
 
-Ref<MessageEvent> MessageEvent::create(ExecState& state, const AtomicString& type, Init& initializer, IsTrusted isTrusted)
+Ref<MessageEvent> MessageEvent::create(ExecState& state, const AtomicString& type, Init&& initializer, IsTrusted isTrusted)
 {
-    return adoptRef(*new MessageEvent(state, type, initializer, isTrusted));
+    return adoptRef(*new MessageEvent(state, type, WTFMove(initializer), isTrusted));
 }
 
 MessageEvent::~MessageEvent()

Modified: trunk/Source/WebCore/dom/MessageEvent.h (207805 => 207806)


--- trunk/Source/WebCore/dom/MessageEvent.h	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/dom/MessageEvent.h	2016-10-25 05:16:00 UTC (rev 207806)
@@ -56,7 +56,7 @@
         Optional<MessageEventSource> source;
         Vector<RefPtr<MessagePort>> ports;
     };
-    static Ref<MessageEvent> create(JSC::ExecState&, const AtomicString& type, Init&, IsTrusted = IsTrusted::No);
+    static Ref<MessageEvent> create(JSC::ExecState&, const AtomicString& type, Init&&, IsTrusted = IsTrusted::No);
 
     virtual ~MessageEvent();
 
@@ -91,7 +91,7 @@
     
 private:
     MessageEvent();
-    MessageEvent(JSC::ExecState&, const AtomicString&, Init&, IsTrusted);
+    MessageEvent(JSC::ExecState&, const AtomicString&, Init&&, IsTrusted);
     MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
     MessageEvent(const AtomicString& type, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId);
     MessageEvent(const String& data, const String& origin);

Modified: trunk/Source/WebCore/testing/TypeConversions.h (207805 => 207806)


--- trunk/Source/WebCore/testing/TypeConversions.h	2016-10-25 04:40:23 UTC (rev 207805)
+++ trunk/Source/WebCore/testing/TypeConversions.h	2016-10-25 05:16:00 UTC (rev 207806)
@@ -104,12 +104,12 @@
     const TestUnion& testUnion() const { return m_union; }
     void setTestUnion(const TestUnion& value) { m_union = value; }
 
-    void setTypeConversionsDictionary(Dictionary& dictionary)
+    void setTypeConversionsDictionary(Dictionary&& dictionary)
     {
         m_typeConversionsDictionaryLongValue = dictionary.longValue;
-        m_typeConversionsDictionaryStringValue = dictionary.stringValue;
-        m_typeConversionsDictionarySequenceValue = dictionary.sequenceValue;
-        m_typeConversionsDictionaryUnionValue = dictionary.unionValue;
+        m_typeConversionsDictionaryStringValue = WTFMove(dictionary.stringValue);
+        m_typeConversionsDictionarySequenceValue = WTFMove(dictionary.sequenceValue);
+        m_typeConversionsDictionaryUnionValue = WTFMove(dictionary.unionValue);
     }
 
     int typeConversionsDictionaryLongValue() { return m_typeConversionsDictionaryLongValue; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to