Unreviewed, rolling out r219361.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 20:43:37 +0000 (20:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 20:43:37 +0000 (20:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174434

Huge PLUM memory regression on iOS (Requested by kling on
#webkit).

Reverted changeset:

"[WebIDL] Convert MutationCallback to be a normal generate
callback"
https://bugs.webkit.org/show_bug.cgi?id=174140
http://trac.webkit.org/changeset/219361

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219421 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/MutationObserver/mutation-observer-constructor-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp
Source/WebCore/Modules/mediastream/MediaDevicesRequest.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/IDLTypes.h
Source/WebCore/bindings/js/JSCallbackData.cpp
Source/WebCore/bindings/js/JSCallbackData.h
Source/WebCore/bindings/js/JSMutationCallback.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/JSMutationCallback.h [moved from Source/WebCore/dom/MutationCallback.idl with 57% similarity]
Source/WebCore/bindings/js/JSMutationObserverCustom.cpp
Source/WebCore/bindings/scripts/CodeGenerator.pm
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.json
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp [deleted file]
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h [deleted file]
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp
Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithThisObject.idl [deleted file]
Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl
Source/WebCore/css/FontFaceSet.h
Source/WebCore/dom/MutationCallback.h
Source/WebCore/dom/MutationObserver.cpp
Source/WebCore/dom/MutationObserver.idl
Source/WebCore/page/IntersectionObserverCallback.h

index 4787680..c73d00e 100644 (file)
@@ -1,3 +1,18 @@
+2017-07-12  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r219361.
+        https://bugs.webkit.org/show_bug.cgi?id=174434
+
+        Huge PLUM memory regression on iOS (Requested by kling on
+        #webkit).
+
+        Reverted changeset:
+
+        "[WebIDL] Convert MutationCallback to be a normal generate
+        callback"
+        https://bugs.webkit.org/show_bug.cgi?id=174140
+        http://trac.webkit.org/changeset/219361
+
 2017-07-12  Eric Carlson  <eric.carlson@apple.com>
 
         [MediaStream] a capture source failure should end the MediaStreamTrack
index 20a2313..4a63076 100644 (file)
@@ -8,10 +8,10 @@ PASS typeof WebKitMutationObserver.prototype.observe is "function"
 PASS typeof WebKitMutationObserver.prototype.disconnect is "function"
 PASS typeof observer.observe is "function"
 PASS typeof observer.disconnect is "function"
-PASS new MutationObserver({ handleEvent: function() {} }) threw exception TypeError: Argument 1 ('callback') to the MutationObserver constructor must be a function.
-PASS new MutationObserver({}) threw exception TypeError: Argument 1 ('callback') to the MutationObserver constructor must be a function.
-PASS new MutationObserver(42) threw exception TypeError: Argument 1 ('callback') to the MutationObserver constructor must be a function.
-PASS new MutationObserver("foo") threw exception TypeError: Argument 1 ('callback') to the MutationObserver constructor must be a function.
+PASS new MutationObserver({ handleEvent: function() {} }) threw exception TypeError: Argument 1 ('callback') to the MutationObserver constructor must be an instance of MutationCallback.
+PASS new MutationObserver({}) threw exception TypeError: Argument 1 ('callback') to the MutationObserver constructor must be an instance of MutationCallback.
+PASS new MutationObserver(42) threw exception TypeError: Argument 1 ('callback') to the MutationObserver constructor must be an instance of MutationCallback.
+PASS new MutationObserver("foo") threw exception TypeError: Argument 1 ('callback') to the MutationObserver constructor must be an instance of MutationCallback.
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 33726a5..bdc17c8 100644 (file)
@@ -464,7 +464,6 @@ set(WebCore_NON_SVG_IDL_FILES
     dom/MessagePort.idl
     dom/MouseEvent.idl
     dom/MouseEventInit.idl
-    dom/MutationCallback.idl
     dom/MutationEvent.idl
     dom/MutationObserver.idl
     dom/MutationRecord.idl
@@ -1210,6 +1209,7 @@ set(WebCore_SOURCES
     bindings/js/JSMessageChannelCustom.cpp
     bindings/js/JSMessageEventCustom.cpp
     bindings/js/JSMessagePortCustom.cpp
+    bindings/js/JSMutationCallback.cpp
     bindings/js/JSMutationObserverCustom.cpp
     bindings/js/JSNodeCustom.cpp
     bindings/js/JSNodeIteratorCustom.cpp
index 9963e99..2a5497b 100644 (file)
@@ -1,3 +1,18 @@
+2017-07-12  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r219361.
+        https://bugs.webkit.org/show_bug.cgi?id=174434
+
+        Huge PLUM memory regression on iOS (Requested by kling on
+        #webkit).
+
+        Reverted changeset:
+
+        "[WebIDL] Convert MutationCallback to be a normal generate
+        callback"
+        https://bugs.webkit.org/show_bug.cgi?id=174140
+        http://trac.webkit.org/changeset/219361
+
 2017-07-12  Eric Carlson  <eric.carlson@apple.com>
 
         [MediaStream] a capture source failure should end the MediaStreamTrack
index 21f15f6..e1acaf4 100644 (file)
@@ -399,7 +399,6 @@ JS_BINDING_IDLS = \
     $(WebCore)/dom/MessagePort.idl \
     $(WebCore)/dom/MouseEvent.idl \
     $(WebCore)/dom/MouseEventInit.idl \
-    $(WebCore)/dom/MutationCallback.idl \
     $(WebCore)/dom/MutationEvent.idl \
     $(WebCore)/dom/MutationObserver.idl \
     $(WebCore)/dom/MutationRecord.idl \
index c11827f..18e2597 100644 (file)
@@ -79,7 +79,7 @@ void MediaDevicesRequest::contextDestroyed()
     ContextDestructionObserver::contextDestroyed();
 }
 
-void MediaDevicesRequest::filterDeviceList(Vector<Ref<MediaDeviceInfo>>& devices)
+void MediaDevicesRequest::filterDeviceList(Vector<RefPtr<MediaDeviceInfo>>& devices)
 {
 #if !PLATFORM(COCOA)
     UNUSED_PARAM(devices);
@@ -95,7 +95,7 @@ void MediaDevicesRequest::filterDeviceList(Vector<Ref<MediaDeviceInfo>>& devices
 
     int cameraCount = 0;
     int microphoneCount = 0;
-    devices.removeAllMatching([&](const Ref<MediaDeviceInfo>& device) -> bool {
+    devices.removeAllMatching([&](const RefPtr<MediaDeviceInfo>& device) -> bool {
         if (device->kind() == MediaDeviceInfo::Kind::Videoinput && ++cameraCount > defaultCameraCount)
             return true;
         if (device->kind() == MediaDeviceInfo::Kind::Audioinput && ++microphoneCount > defaultMicrophoneCount)
@@ -120,7 +120,7 @@ void MediaDevicesRequest::start()
         Document& document = downcast<Document>(*scriptExecutionContext());
         document.setDeviceIDHashSalt(deviceIdentifierHashSalt);
 
-        Vector<Ref<MediaDeviceInfo>> devices;
+        Vector<RefPtr<MediaDeviceInfo>> devices;
         for (auto& deviceInfo : captureDevices) {
             auto label = emptyString();
             if (originHasPersistentAccess || document.hasHadActiveMediaStreamTrack())
index 33abbd6..4af017d 100644 (file)
@@ -51,7 +51,7 @@ private:
 
     void contextDestroyed() final;
 
-    void filterDeviceList(Vector<Ref<MediaDeviceInfo>>&);
+    void filterDeviceList(Vector<RefPtr<MediaDeviceInfo>>&);
 
     MediaDevices::EnumerateDevicesPromise m_promise;
     RefPtr<MediaDevicesRequest> m_protector;
index 93ec861..b843c17 100644 (file)
                7C93F34E1AA6BF0700A98BAB /* ContentExtensionCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C93F34C1AA6BF0700A98BAB /* ContentExtensionCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7C9DBFED1A9C49B1000D6B25 /* JSHTMLAttachmentElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C9DBFEB1A9C49B1000D6B25 /* JSHTMLAttachmentElement.cpp */; };
                7C9DBFEE1A9C49B1000D6B25 /* JSHTMLAttachmentElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9DBFEC1A9C49B1000D6B25 /* JSHTMLAttachmentElement.h */; };
-               7CACB6051F1535AD0007101C /* JSMutationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CACB6031F1535AC0007101C /* JSMutationCallback.cpp */; };
-               7CACB6061F1535AD0007101C /* JSMutationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CACB6041F1535AC0007101C /* JSMutationCallback.h */; };
                7CB5CA3F1E525C7100FAEF13 /* MediaQueryExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CB5CA3D1E525C6C00FAEF13 /* MediaQueryExpression.cpp */; };
                7CB5CA401E525C7300FAEF13 /* MediaQueryExpression.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CB5CA3E1E525C6C00FAEF13 /* MediaQueryExpression.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7CBA5BA71F0B4BDE0034D745 /* JSDOMConvertWebGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CBA5BA61F0B4BDE0034D745 /* JSDOMConvertWebGL.cpp */; };
                C6F0902C14327D4F00685849 /* JSMutationObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F0902414327D4F00685849 /* JSMutationObserver.cpp */; };
                C6F0902D14327D4F00685849 /* JSMutationObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = C6F0902514327D4F00685849 /* JSMutationObserver.h */; };
                C6F0917F143A2BB900685849 /* JSMutationObserverCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F0917E143A2BB900685849 /* JSMutationObserverCustom.cpp */; };
+               C6F420A216B7164E0052A9F2 /* JSMutationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */; };
+               C6F420A316B7164E0052A9F2 /* JSMutationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */; };
                C9026B651B1CF5FE001D99A7 /* JSMediaRemoteControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C9026B631B1CF5AB001D99A7 /* JSMediaRemoteControls.cpp */; };
                C9027F411B1D0AD200BFBFEF /* MediaSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C9027F3F1B1D0AD200BFBFEF /* MediaSession.cpp */; };
                C9027F421B1D0AD200BFBFEF /* MediaSession.h in Headers */ = {isa = PBXBuildFile; fileRef = C9027F401B1D0AD200BFBFEF /* MediaSession.h */; };
                7C9DBFEA1A9C489F000D6B25 /* HTMLAttachmentElement.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HTMLAttachmentElement.idl; sourceTree = "<group>"; };
                7C9DBFEB1A9C49B1000D6B25 /* JSHTMLAttachmentElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLAttachmentElement.cpp; sourceTree = "<group>"; };
                7C9DBFEC1A9C49B1000D6B25 /* JSHTMLAttachmentElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLAttachmentElement.h; sourceTree = "<group>"; };
-               7CACB6031F1535AC0007101C /* JSMutationCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMutationCallback.cpp; sourceTree = "<group>"; };
-               7CACB6041F1535AC0007101C /* JSMutationCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMutationCallback.h; sourceTree = "<group>"; };
-               7CACB6071F1535DF0007101C /* MutationCallback.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MutationCallback.idl; sourceTree = "<group>"; };
                7CB5CA3D1E525C6C00FAEF13 /* MediaQueryExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaQueryExpression.cpp; sourceTree = "<group>"; };
                7CB5CA3E1E525C6C00FAEF13 /* MediaQueryExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaQueryExpression.h; sourceTree = "<group>"; };
                7CBA5BA61F0B4BDE0034D745 /* JSDOMConvertWebGL.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMConvertWebGL.cpp; sourceTree = "<group>"; };
                C6F0902414327D4F00685849 /* JSMutationObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMutationObserver.cpp; sourceTree = "<group>"; };
                C6F0902514327D4F00685849 /* JSMutationObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMutationObserver.h; sourceTree = "<group>"; };
                C6F0917E143A2BB900685849 /* JSMutationObserverCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMutationObserverCustom.cpp; sourceTree = "<group>"; };
+               C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMutationCallback.cpp; sourceTree = "<group>"; };
+               C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMutationCallback.h; sourceTree = "<group>"; };
                C9026B631B1CF5AB001D99A7 /* JSMediaRemoteControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaRemoteControls.cpp; sourceTree = "<group>"; };
                C9026B641B1CF5AB001D99A7 /* JSMediaRemoteControls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaRemoteControls.h; sourceTree = "<group>"; };
                C9027F3E1B1D0AB900BFBFEF /* MediaSession.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MediaSession.idl; sourceTree = "<group>"; };
                                BC64649611D82349006455B0 /* JSDOMStringMap.h */,
                                65DF31E509D1CC60000BE325 /* JSElement.cpp */,
                                65DF31E609D1CC60000BE325 /* JSElement.h */,
-                               7CACB6031F1535AC0007101C /* JSMutationCallback.cpp */,
-                               7CACB6041F1535AC0007101C /* JSMutationCallback.h */,
                                C6F0902414327D4F00685849 /* JSMutationObserver.cpp */,
                                C6F0902514327D4F00685849 /* JSMutationObserver.h */,
                                C6F08FC71431000D00685849 /* JSMutationRecord.cpp */,
                                93B70D4E09EB0C7C009D8468 /* JSEventListener.h */,
                                935F45400F7C3B5F00D7C1FB /* JSLazyEventListener.cpp */,
                                935F45410F7C3B5F00D7C1FB /* JSLazyEventListener.h */,
+                               C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */,
+                               C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */,
                                BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */,
                                BCA378BB0D15F64200B793D6 /* ScheduledAction.h */,
                        );
                                85031B310A44EFC700F992E0 /* MouseRelatedEvent.cpp */,
                                85031B320A44EFC700F992E0 /* MouseRelatedEvent.h */,
                                C6F0900114327B6100685849 /* MutationCallback.h */,
-                               7CACB6071F1535DF0007101C /* MutationCallback.idl */,
                                85031B330A44EFC700F992E0 /* MutationEvent.cpp */,
                                85031B340A44EFC700F992E0 /* MutationEvent.h */,
                                93EEC1F309C2877700C515D1 /* MutationEvent.idl */,
                                CD19A2681A13E700008D650E /* DiagnosticLoggingClient.h in Headers */,
                                46FCB6181A70820E00C5A21E /* DiagnosticLoggingKeys.h in Headers */,
                                8372DB311A6780A800C697C5 /* DiagnosticLoggingResultType.h in Headers */,
-                               7CACB6061F1535AD0007101C /* JSMutationCallback.h in Headers */,
                                CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */,
                                CECADFC9153778FF00E37068 /* DictationCommand.h in Headers */,
                                D0BD4F5D1408850F006839B6 /* DictationCommandIOS.h in Headers */,
                                2D6F3E951C1F85550061DBD4 /* JSMockPageOverlay.h in Headers */,
                                A86629D109DA2B48009633A5 /* JSMouseEvent.h in Headers */,
                                830A36BD1DAC5FAD006D7D09 /* JSMouseEventInit.h in Headers */,
+                               C6F420A316B7164E0052A9F2 /* JSMutationCallback.h in Headers */,
                                65DF31FC09D1CC60000BE325 /* JSMutationEvent.h in Headers */,
                                C6F0902D14327D4F00685849 /* JSMutationObserver.h in Headers */,
                                C6F08FCA1431000D00685849 /* JSMutationRecord.h in Headers */,
                1C09D0501E31C32900725F18 /* libPAL.a */ = {
                        isa = PBXReferenceProxy;
                        fileType = archive.ar;
-                       path = libPAL.a;
+                       name = libPAL.a;
+                       path = lib.a;
                        remoteRef = 1C09D04F1E31C32900725F18 /* PBXContainerItemProxy */;
                        sourceTree = BUILT_PRODUCTS_DIR;
                };
                                07277E5217D018CC0015534D /* JSMediaStreamTrack.cpp in Sources */,
                                415CDAF71E6CE0DE004F11EE /* JSMediaStreamTrackCustom.cpp in Sources */,
                                07277E5417D018CC0015534D /* JSMediaStreamTrackEvent.cpp in Sources */,
-                               7CACB6051F1535AD0007101C /* JSMutationCallback.cpp in Sources */,
                                932CC0D41DFFD667004C0F9F /* JSMediaTrackConstraints.cpp in Sources */,
                                0787C4691BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.cpp in Sources */,
                                E107400D0E77BDC00033AF24 /* JSMessageChannel.cpp in Sources */,
                                E1ADED470E76B8DD004A1A5E /* JSMessagePortCustom.cpp in Sources */,
                                A86629D209DA2B48009633A5 /* JSMouseEvent.cpp in Sources */,
                                830A36BC1DAC5FAD006D7D09 /* JSMouseEventInit.cpp in Sources */,
+                               C6F420A216B7164E0052A9F2 /* JSMutationCallback.cpp in Sources */,
                                65DF31FB09D1CC60000BE325 /* JSMutationEvent.cpp in Sources */,
                                C6F0902C14327D4F00685849 /* JSMutationObserver.cpp in Sources */,
                                C6F0917F143A2BB900685849 /* JSMutationObserverCustom.cpp in Sources */,
index 18b3d4e..d0df9ef 100644 (file)
@@ -62,9 +62,6 @@ struct IDLType {
     using ParameterType = T;
     using NullableParameterType = std::optional<ImplementationType>;
 
-    using InnerParameterType = T;
-    using NullableInnerParameterType = std::optional<ImplementationType>;
-
     using NullableType = std::optional<ImplementationType>;
     static NullableType nullValue() { return std::nullopt; }
     static bool isNullValue(const NullableType& value) { return !value; }
@@ -156,9 +153,6 @@ template<typename T> struct IDLWrapper : IDLType<RefPtr<T>> {
     using ParameterType = T&;
     using NullableParameterType = T*;
 
-    using InnerParameterType = Ref<T>;
-    using NullableInnerParameterType = RefPtr<T>;
-
     using NullableType = RefPtr<T>;
     static inline std::nullptr_t nullValue() { return nullptr; }
     template<typename U> static inline bool isNullValue(U&& value) { return !value; }
@@ -182,9 +176,6 @@ template<typename T> struct IDLNullable : IDLType<typename T::NullableType> {
     using ParameterType = typename T::NullableParameterType;
     using NullableParameterType = typename T::NullableParameterType;
 
-    using InnerParameterType = typename T::NullableInnerParameterType;
-    using NullableInnerParameterType = typename T::NullableInnerParameterType;
-
     using NullableType = typename T::NullableType;
     static inline auto nullValue() -> decltype(T::nullValue()) { return T::nullValue(); }
     template<typename U> static inline bool isNullValue(U&& value) { return T::isNullValue(std::forward<U>(value)); }
@@ -194,8 +185,8 @@ template<typename T> struct IDLNullable : IDLType<typename T::NullableType> {
 template<typename T> struct IDLSequence : IDLType<Vector<typename T::ImplementationType>> {
     using InnerType = T;
 
-    using ParameterType = const Vector<typename T::InnerParameterType>&;
-    using NullableParameterType = const std::optional<Vector<typename T::InnerParameterType>>&;
+    using ParameterType = const Vector<typename T::ImplementationType>&;
+    using NullableParameterType = const std::optional<Vector<typename T::ImplementationType>>&;
 };
 
 template<typename T> struct IDLFrozenArray : IDLType<Vector<typename T::ImplementationType>> {
index 64bc426..655eaf4 100644 (file)
@@ -39,7 +39,7 @@ using namespace JSC;
     
 namespace WebCore {
 
-JSValue JSCallbackData::invokeCallback(JSDOMGlobalObject& globalObject, JSObject* callback, JSValue thisValue, MarkedArgumentBuffer& args, CallbackType method, PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)
+JSValue JSCallbackData::invokeCallback(JSDOMGlobalObject& globalObject, JSObject* callback, MarkedArgumentBuffer& args, CallbackType method, PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)
 {
     ASSERT(callback);
 
@@ -79,8 +79,8 @@ JSValue JSCallbackData::invokeCallback(JSDOMGlobalObject& globalObject, JSObject
 
     returnedException = nullptr;
     JSValue result = context->isDocument()
-        ? JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, function, callType, callData, thisValue, args, returnedException)
-        : JSC::profiledCall(exec, JSC::ProfilingReason::Other, function, callType, callData, thisValue, args, returnedException);
+        ? JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, function, callType, callData, callback, args, returnedException)
+        : JSC::profiledCall(exec, JSC::ProfilingReason::Other, function, callType, callData, callback, args, returnedException);
 
     InspectorInstrumentation::didCallFunction(cookie, context);
 
index ddf9819..3ea990e 100644 (file)
@@ -64,7 +64,7 @@ protected:
 #endif
     }
     
-    static JSC::JSValue invokeCallback(JSDOMGlobalObject&, JSC::JSObject* callback, JSC::JSValue thisValue, JSC::MarkedArgumentBuffer&, CallbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException);
+    static JSC::JSValue invokeCallback(JSDOMGlobalObject&, JSC::JSObject* callback, JSC::MarkedArgumentBuffer&, CallbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException);
 
 private:
     JSC::Weak<JSDOMGlobalObject> m_globalObject;
@@ -83,13 +83,13 @@ public:
 
     JSC::JSObject* callback() { return m_callback.get(); }
 
-    JSC::JSValue invokeCallback(JSC::JSValue thisValue, JSC::MarkedArgumentBuffer& args, CallbackType callbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)
+    JSC::JSValue invokeCallback(JSC::MarkedArgumentBuffer& args, CallbackType callbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)
     {
         auto* globalObject = this->globalObject();
         if (!globalObject)
             return { };
 
-        return JSCallbackData::invokeCallback(*globalObject, callback(), thisValue, args, callbackType, functionName, returnedException);
+        return JSCallbackData::invokeCallback(*globalObject, callback(), args, callbackType, functionName, returnedException);
     }
 
 private:
@@ -106,13 +106,13 @@ public:
 
     JSC::JSObject* callback() { return m_callback.get(); }
 
-    JSC::JSValue invokeCallback(JSC::JSValue thisValue, JSC::MarkedArgumentBuffer& args, CallbackType callbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)
+    JSC::JSValue invokeCallback(JSC::MarkedArgumentBuffer& args, CallbackType callbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)
     {
         auto* globalObject = this->globalObject();
         if (!globalObject)
             return { };
 
-        return JSCallbackData::invokeCallback(*globalObject, callback(), thisValue, args, callbackType, functionName, returnedException);
+        return JSCallbackData::invokeCallback(*globalObject, callback(), args, callbackType, functionName, returnedException);
     }
 
 private:
diff --git a/Source/WebCore/bindings/js/JSMutationCallback.cpp b/Source/WebCore/bindings/js/JSMutationCallback.cpp
new file mode 100644 (file)
index 0000000..318cd45
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2013 Google 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS 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"
+#include "JSMutationCallback.h"
+
+#include "JSDOMConvertInterface.h"
+#include "JSDOMConvertSequences.h"
+#include "JSDOMGlobalObject.h"
+#include "JSMainThreadExecState.h"
+#include "JSMainThreadExecStateInstrumentation.h"
+#include "JSMutationObserver.h"
+#include "JSMutationRecord.h"
+#include "ScriptExecutionContext.h"
+#include <heap/WeakInlines.h>
+#include <runtime/JSLock.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSMutationCallback::JSMutationCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
+    : ActiveDOMCallback(globalObject->scriptExecutionContext())
+    , m_callback(callback)
+    , m_isolatedWorld(globalObject->world())
+{
+}
+
+JSMutationCallback::~JSMutationCallback()
+{
+}
+
+void JSMutationCallback::call(const Vector<Ref<MutationRecord>>& mutations, MutationObserver* observer)
+{
+    if (!canInvokeCallback())
+        return;
+
+    Ref<JSMutationCallback> protectedThis(*this);
+
+    JSLockHolder lock(m_isolatedWorld->vm());
+
+    if (!m_callback)
+        return;
+
+    JSValue callback = m_callback.get();
+    CallData callData;
+    CallType callType = getCallData(callback, callData);
+    if (callType == CallType::None) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+
+    ScriptExecutionContext* context = scriptExecutionContext();
+    if (!context)
+        return;
+    ASSERT(context->isDocument());
+
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld);
+    ExecState* exec = globalObject->globalExec();
+
+    JSValue jsObserver = toJS(exec, globalObject, observer);
+
+    MarkedArgumentBuffer args;
+    args.append(toJS<IDLSequence<IDLInterface<MutationRecord>>>(*exec, *globalObject, mutations));
+    args.append(jsObserver);
+
+    InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(context, callType, callData);
+
+    NakedPtr<JSC::Exception> exception;
+    JSMainThreadExecState::profiledCall(exec, JSC::ProfilingReason::Other, callback, callType, callData, jsObserver, args, exception);
+
+    InspectorInstrumentation::didCallFunction(cookie, context);
+
+    if (exception)
+        reportException(exec, exception);
+}
+
+} // namespace WebCore
similarity index 57%
rename from Source/WebCore/dom/MutationCallback.idl
rename to Source/WebCore/bindings/js/JSMutationCallback.h
index 1473944..a5b391f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    CallbackNeedsCanInvoke,
-    CallbackThisObject=MutationObserver
-] callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer);
+#pragma once
+
+#include "ActiveDOMCallback.h"
+#include "DOMWrapperWorld.h"
+#include "MutationCallback.h"
+#include <heap/Weak.h>
+#include <runtime/JSObject.h>
+
+namespace WebCore {
+
+class JSDOMGlobalObject;
+
+class JSMutationCallback final : public MutationCallback, public ActiveDOMCallback {
+public:
+    static Ref<JSMutationCallback> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
+    {
+        return adoptRef(*new JSMutationCallback(callback, globalObject));
+    }
+
+    virtual ~JSMutationCallback();
+
+    void call(const Vector<Ref<MutationRecord>>&, MutationObserver*) override;
+    bool canInvokeCallback() const override { return ActiveDOMCallback::canInvokeCallback(); }
+
+private:
+    JSMutationCallback(JSC::JSObject* callback, JSDOMGlobalObject*);
+
+    mutable JSC::Weak<JSC::JSObject> m_callback;
+    Ref<DOMWrapperWorld> m_isolatedWorld;
+};
+
+} // namespace WebCore
index 94147b8..33c5509 100644 (file)
 #include "config.h"
 #include "JSMutationObserver.h"
 
+#include "ExceptionCode.h"
+#include "JSDOMConstructorBase.h"
+#include "JSMutationCallback.h"
 #include "JSNodeCustom.h"
+#include "MutationObserver.h"
+#include <runtime/Error.h>
+#include <runtime/PrivateName.h>
 
 using namespace JSC;
 
 namespace WebCore {
 
+EncodedJSValue JSC_HOST_CALL constructJSMutationObserver(ExecState& exec)
+{
+    VM& vm = exec.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
+    if (exec.argumentCount() < 1)
+        return throwVMError(&exec, scope, createNotEnoughArgumentsError(&exec));
+
+    JSObject* object = exec.uncheckedArgument(0).getObject();
+    CallData callData;
+    if (!object || object->methodTable()->getCallData(object, callData) == CallType::None)
+        return throwArgumentTypeError(exec, scope, 0, "callback", "MutationObserver", nullptr, "MutationCallback");
+
+    auto* jsConstructor = jsCast<JSDOMConstructorBase*>(exec.jsCallee());
+    auto callback = JSMutationCallback::create(object, jsConstructor->globalObject());
+    JSObject* jsObserver = asObject(toJSNewlyCreated(&exec, jsConstructor->globalObject(), MutationObserver::create(WTFMove(callback))));
+    PrivateName propertyName;
+    jsObserver->putDirect(vm, propertyName, object);
+    return JSValue::encode(jsObserver);
+}
+
 bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
     for (auto* node : jsCast<JSMutationObserver*>(handle.slot()->asCell())->wrapped().observedNodes()) {
index c9e057e..70dd3d5 100644 (file)
@@ -120,7 +120,6 @@ my $idlFiles;
 my $cachedInterfaces = {};
 my $cachedExternalDictionaries = {};
 my $cachedExternalEnumerations = {};
-my $cachedTypes = {};
 
 sub assert
 {
@@ -370,20 +369,6 @@ sub ParseInterface
     die("Could NOT find interface definition for $interfaceName in $filename");
 }
 
-sub ParseType
-{
-    my ($object, $typeString) = @_;
-
-    return $cachedTypes->{$typeString} if exists($cachedTypes->{$typeString});
-
-    my $parser = IDLParser->new(1);
-    my $type = $parser->ParseType($typeString, $idlAttributes);
-
-    $cachedTypes->{$typeString} = $type;
-
-    return $type;
-}
-
 # Helpers for all CodeGenerator***.pm modules
 
 sub IsNumericType
index 6ece3be..9503b84 100644 (file)
@@ -599,10 +599,10 @@ sub GenerateNamedGetterLambda
 
     push(@$outputArray, "    auto getterFunctor = [] (auto& thisObject, auto propertyName) -> ${returnType} {\n");
 
-    my @arguments = GenerateCallWithUsingReferences($namedGetterOperation->extendedAttributes->{CallWith}, $outputArray, "std::nullopt", "thisObject", "        ");
-    push(@arguments, "propertyNameToAtomicString(propertyName)");
+    my @args = GenerateCallWithUsingReferences($namedGetterOperation->extendedAttributes->{CallWith}, $outputArray, "std::nullopt", "thisObject", "        ");
+    push(@args, "propertyNameToAtomicString(propertyName)");
 
-    push(@$outputArray, "        auto result = thisObject.wrapped().${namedGetterFunctionName}(" . join(", ", @arguments) . ");\n");
+    push(@$outputArray, "        auto result = thisObject.wrapped().${namedGetterFunctionName}(" . join(", ", @args) . ");\n");
     
     if ($namedGetterOperation->extendedAttributes->{MayThrowException}) {
         push(@$outputArray, "        if (result.hasException())\n");
@@ -5808,7 +5808,6 @@ sub GenerateCallbackHeaderContent
     push(@$contentRef, "    static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);\n") if @{$constants};
 
     push(@$contentRef, "    virtual bool operator==(const ${name}&) const override;\n\n") if $interfaceOrCallback->extendedAttributes->{CallbackNeedsOperatorEqual};
-    push(@$contentRef, "    virtual bool canInvoke() const override { return ActiveDOMCallback::canInvokeCallback(); }\n\n") if $interfaceOrCallback->extendedAttributes->{CallbackNeedsCanInvoke};
 
     # Operations
     my $numOperations = @{$operations};
@@ -5816,14 +5815,6 @@ sub GenerateCallbackHeaderContent
         push(@$contentRef, "\n    // Functions\n");
         foreach my $operation (@{$operations}) {
             my @arguments = ();
-
-            my $callbackThisObject = $operation->extendedAttributes->{CallbackThisObject};
-            if ($callbackThisObject) {
-                my $thisObjectType = $codeGenerator->ParseType($callbackThisObject);
-                my $IDLType = GetIDLType($interfaceOrCallback, $thisObjectType);
-                push(@arguments, "typename ${IDLType}::ParameterType thisObject");
-            }
-
             foreach my $argument (@{$operation->arguments}) {
                 my $IDLType = GetIDLType($interfaceOrCallback, $argument->type);
                 push(@arguments, "typename ${IDLType}::ParameterType " . $argument->name);
@@ -5955,31 +5946,15 @@ sub GenerateCallbackImplementationContent
             # FIXME: Change the default name (used for callback functions) to something other than handleEvent. It makes little sense.
             my $functionName = $operation->name || "handleEvent";
 
-            my @arguments = ();
-
-            my $thisValue = "jsUndefined()";
-
-            my $callbackThisObject = $operation->extendedAttributes->{CallbackThisObject};
-            if ($callbackThisObject) {
-                my $thisObjectType = $codeGenerator->ParseType($callbackThisObject);
-
-                AddToIncludesForIDLType($thisObjectType, $includesRef, 1);
-                my $IDLType = GetIDLType($interfaceOrCallback, $thisObjectType);
-                push(@arguments, "typename ${IDLType}::ParameterType thisObject");
-
-                my $thisObjectArgument = IDLArgument->new();
-                $thisObjectArgument->type($thisObjectType);
-
-                $thisValue = NativeToJSValueUsingReferences($thisObjectArgument, $interfaceOrCallback, "thisObject", "globalObject");
-            }
-
+            my @args = ();
             foreach my $argument (@{$operation->arguments}) {
                 AddToIncludesForIDLType($argument->type, $includesRef, 1);
+
                 my $IDLType = GetIDLType($interfaceOrCallback, $argument->type);
-                push(@arguments, "typename ${IDLType}::ParameterType " . $argument->name);
+                push(@args, "typename ${IDLType}::ParameterType " . $argument->name);
             }
             
-            push(@$contentRef, "${nativeReturnType} ${className}::${functionName}(" . join(", ", @arguments) . ")\n");
+            push(@$contentRef, "${nativeReturnType} ${className}::${functionName}(" . join(", ", @args) . ")\n");
             push(@$contentRef, "{\n");
 
             # FIXME: This is needed for NodeFilter, which works even for disconnected iframes. We should investigate
@@ -5995,8 +5970,6 @@ sub GenerateCallbackImplementationContent
             push(@$contentRef, "    JSLockHolder lock(vm);\n");
 
             push(@$contentRef, "    auto& state = *globalObject.globalExec();\n");
-
-            push(@$contentRef, "    JSValue thisValue = ${thisValue};\n");
             push(@$contentRef, "    MarkedArgumentBuffer args;\n");
 
             foreach my $argument (@{$operation->arguments}) {
@@ -6007,10 +5980,10 @@ sub GenerateCallbackImplementationContent
 
             my $callbackInvocation;
             if (ref($interfaceOrCallback) eq "IDLCallbackFunction") {
-                $callbackInvocation = "m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException)";
+                $callbackInvocation = "m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException)";
             } else {
                 my $callbackType = $numOperations > 1 ? "Object" : "FunctionOrObject";
-                $callbackInvocation = "m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::${callbackType}, Identifier::fromString(&vm, \"${functionName}\"), returnedException)";
+                $callbackInvocation = "m_data->invokeCallback(args, JSCallbackData::CallbackType::${callbackType}, Identifier::fromString(&vm, \"${functionName}\"), returnedException)";
             }
 
             if ($operation->type->name eq "void") {
@@ -6045,11 +6018,12 @@ sub GenerateCallbackImplementationContent
         }
     }
 
+    # toJS() implementation.
     push(@$contentRef, "JSC::JSValue toJS(${name}& impl)\n");
     push(@$contentRef, "{\n");
     push(@$contentRef, "    if (!static_cast<${className}&>(impl).callbackData())\n");
     push(@$contentRef, "        return jsNull();\n\n");
-    push(@$contentRef, "    return static_cast<${className}&>(impl).callbackData()->callback();\n");
+    push(@$contentRef, "    return static_cast<${className}&>(impl).callbackData()->callback();\n\n");
     push(@$contentRef, "}\n\n");
 }
 
index 37a76b7..456452f 100644 (file)
         "CachedAttribute": {
             "contextsAllowed": ["attribute"]
         },
-        "CallbackNeedsCanInvoke": {
-            "contextsAllowed": ["callback-function"]
-        },
         "CallbackNeedsOperatorEqual": {
             "contextsAllowed": ["callback-function"]
         },
-        "CallbackThisObject": {
-            "contextsAllowed": ["callback-function", "operation"]
-        },
         "CallWith": {
             "contextsAllowed": ["attribute", "operation"],
             "values": ["Document", "ScriptExecutionContext", "ScriptState", "GlobalObject", "ActiveWindow", "FirstWindow", "ResponsibleDocument", "World"]
index 7c867d6..d2d4e86 100644 (file)
@@ -346,30 +346,6 @@ sub Parse
     return $document;
 }
 
-sub ParseType
-{
-    my ($self, $type, $idlAttributes) = @_;
-
-    $self->{Line} = $type;
-    $self->{DocumentContent} = $type;
-    $self->{ExtendedAttributeMap} = $idlAttributes;
-
-    addBuiltinTypedefs();
-
-    my $result;
-
-    $self->getToken();
-    eval {
-        $result = $self->parseType();
-
-        my $next = $self->nextToken();
-        $self->assertTokenType($next, EmptyToken);
-    };
-    assert $@ . " parsing type ${type}" if $@;
-
-    return $result;
-}
-
 sub nextToken
 {
     my $self = shift;
index a33d965..9f675bb 100644 (file)
@@ -64,12 +64,11 @@ CallbackResult<typename IDLDOMString::ImplementationType> JSTestCallbackFunction
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLLong>(argument));
 
     NakedPtr<JSC::Exception> returnedException;
-    auto jsResult = m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    auto jsResult = m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -87,6 +86,7 @@ JSC::JSValue toJS(TestCallbackFunction& impl)
         return jsNull();
 
     return static_cast<JSTestCallbackFunction&>(impl).callbackData()->callback();
+
 }
 
 } // namespace WebCore
index 3d51b55..6c32ee0 100644 (file)
@@ -67,12 +67,11 @@ CallbackResult<typename IDLDOMString::ImplementationType> JSTestCallbackFunction
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLSequence<IDLLong>>(state, globalObject, argument));
 
     NakedPtr<JSC::Exception> returnedException;
-    auto jsResult = m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    auto jsResult = m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
     if (returnedException) {
         auto throwScope = DECLARE_THROW_SCOPE(vm);
         throwException(&state, throwScope, returnedException);
@@ -91,6 +90,7 @@ JSC::JSValue toJS(TestCallbackFunctionRethrow& impl)
         return jsNull();
 
     return static_cast<JSTestCallbackFunctionRethrow&>(impl).callbackData()->callback();
+
 }
 
 } // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp
deleted file mode 100644 (file)
index 2f386c0..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-    This file is part of the WebKit open source project.
-    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-#include "JSTestCallbackFunctionWithThisObject.h"
-
-#include "JSDOMConvertInterface.h"
-#include "JSDOMConvertSequences.h"
-#include "JSDOMExceptionHandling.h"
-#include "JSDOMGlobalObject.h"
-#include "JSTestNode.h"
-#include "ScriptExecutionContext.h"
-#include <runtime/JSArray.h>
-#include <runtime/JSLock.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSTestCallbackFunctionWithThisObject::JSTestCallbackFunctionWithThisObject(JSObject* callback, JSDOMGlobalObject* globalObject)
-    : TestCallbackFunctionWithThisObject()
-    , ActiveDOMCallback(globalObject->scriptExecutionContext())
-    , m_data(new JSCallbackDataStrong(callback, globalObject, this))
-{
-}
-
-JSTestCallbackFunctionWithThisObject::~JSTestCallbackFunctionWithThisObject()
-{
-    ScriptExecutionContext* context = scriptExecutionContext();
-    // When the context is destroyed, all tasks with a reference to a callback
-    // should be deleted. So if the context is 0, we are on the context thread.
-    if (!context || context->isContextThread())
-        delete m_data;
-    else
-        context->postTask(DeleteCallbackDataTask(m_data));
-#ifndef NDEBUG
-    m_data = nullptr;
-#endif
-}
-
-CallbackResult<typename IDLVoid::ImplementationType> JSTestCallbackFunctionWithThisObject::handleEvent(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLSequence<IDLInterface<TestNode>>::ParameterType parameter)
-{
-    if (!canInvokeCallback())
-        return CallbackResultType::UnableToExecute;
-
-    Ref<JSTestCallbackFunctionWithThisObject> protectedThis(*this);
-
-    auto& globalObject = *m_data->globalObject();
-    auto& vm = globalObject.vm();
-
-    JSLockHolder lock(vm);
-    auto& state = *globalObject.globalExec();
-    JSValue thisValue = toJS<IDLInterface<TestNode>>(state, globalObject, thisObject);
-    MarkedArgumentBuffer args;
-    args.append(toJS<IDLSequence<IDLInterface<TestNode>>>(state, globalObject, parameter));
-
-    NakedPtr<JSC::Exception> returnedException;
-    m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
-    if (returnedException) {
-        reportException(&state, returnedException);
-        return CallbackResultType::ExceptionThrown;
-     }
-
-    return { };
-}
-
-JSC::JSValue toJS(TestCallbackFunctionWithThisObject& impl)
-{
-    if (!static_cast<JSTestCallbackFunctionWithThisObject&>(impl).callbackData())
-        return jsNull();
-
-    return static_cast<JSTestCallbackFunctionWithThisObject&>(impl).callbackData()->callback();
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h b/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h
deleted file mode 100644 (file)
index 8ba9deb..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-    This file is part of the WebKit open source project.
-    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#pragma once
-
-#include "ActiveDOMCallback.h"
-#include "IDLTypes.h"
-#include "JSCallbackData.h"
-#include "TestCallbackFunctionWithThisObject.h"
-#include <wtf/Forward.h>
-
-namespace WebCore {
-
-class JSTestCallbackFunctionWithThisObject final : public TestCallbackFunctionWithThisObject, public ActiveDOMCallback {
-public:
-    static Ref<JSTestCallbackFunctionWithThisObject> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
-    {
-        return adoptRef(*new JSTestCallbackFunctionWithThisObject(callback, globalObject));
-    }
-
-    virtual ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
-
-    virtual ~JSTestCallbackFunctionWithThisObject();
-    JSCallbackDataStrong* callbackData() { return m_data; }
-
-    // Functions
-    virtual CallbackResult<typename IDLVoid::ImplementationType> handleEvent(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLSequence<IDLInterface<TestNode>>::ParameterType parameter) override;
-
-private:
-    JSTestCallbackFunctionWithThisObject(JSC::JSObject*, JSDOMGlobalObject*);
-
-    JSCallbackDataStrong* m_data;
-};
-
-JSC::JSValue toJS(TestCallbackFunctionWithThisObject&);
-inline JSC::JSValue toJS(TestCallbackFunctionWithThisObject* impl) { return impl ? toJS(*impl) : JSC::jsNull(); }
-
-} // namespace WebCore
index abdc7a2..c5282d5 100644 (file)
@@ -67,13 +67,12 @@ CallbackResult<typename IDLVoid::ImplementationType> JSTestCallbackFunctionWithT
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLSequence<IDLNullable<IDLLong>>>(state, globalObject, sequenceArg));
     args.append(toJS<IDLLong>(longArg));
 
     NakedPtr<JSC::Exception> returnedException;
-    m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -88,6 +87,7 @@ JSC::JSValue toJS(TestCallbackFunctionWithTypedefs& impl)
         return jsNull();
 
     return static_cast<JSTestCallbackFunctionWithTypedefs&>(impl).callbackData()->callback();
+
 }
 
 } // namespace WebCore
index e2b5f46..06c0e6f 100644 (file)
@@ -35,7 +35,6 @@
 #include "JSDOMGlobalObject.h"
 #include "JSDOMStringList.h"
 #include "JSTestNode.h"
-#include "JSTestObj.h"
 #include "ScriptExecutionContext.h"
 #include "SerializedScriptValue.h"
 #include <runtime/FunctionPrototype.h>
@@ -169,11 +168,10 @@ CallbackResult<typename IDLVoid::ImplementationType> JSTestCallbackInterface::ca
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
 
     NakedPtr<JSC::Exception> returnedException;
-    m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithNoParam"), returnedException);
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithNoParam"), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -194,12 +192,11 @@ CallbackResult<typename IDLVoid::ImplementationType> JSTestCallbackInterface::ca
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLFloat32Array>(state, globalObject, arrayParam));
 
     NakedPtr<JSC::Exception> returnedException;
-    m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithArrayParam"), returnedException);
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithArrayParam"), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -220,13 +217,12 @@ CallbackResult<typename IDLVoid::ImplementationType> JSTestCallbackInterface::ca
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, globalObject, srzParam));
     args.append(toJS<IDLDOMString>(state, strParam));
 
     NakedPtr<JSC::Exception> returnedException;
-    m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithSerializedScriptValueParam"), returnedException);
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithSerializedScriptValueParam"), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -247,12 +243,11 @@ CallbackResult<typename IDLVoid::ImplementationType> JSTestCallbackInterface::ca
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLInterface<DOMStringList>>(state, globalObject, listParam));
 
     NakedPtr<JSC::Exception> returnedException;
-    m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithStringList"), returnedException);
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithStringList"), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -273,12 +268,11 @@ CallbackResult<typename IDLVoid::ImplementationType> JSTestCallbackInterface::ca
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLBoolean>(boolParam));
 
     NakedPtr<JSC::Exception> returnedException;
-    m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithBoolean"), returnedException);
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithBoolean"), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -299,13 +293,12 @@ CallbackResult<typename IDLVoid::ImplementationType> JSTestCallbackInterface::ca
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLLong>(longParam));
     args.append(toJS<IDLInterface<TestNode>>(state, globalObject, testNodeParam));
 
     NakedPtr<JSC::Exception> returnedException;
-    m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackRequiresThisToPass"), returnedException);
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackRequiresThisToPass"), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -326,11 +319,10 @@ CallbackResult<typename IDLDOMString::ImplementationType> JSTestCallbackInterfac
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
 
     NakedPtr<JSC::Exception> returnedException;
-    auto jsResult = m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithAReturnValue"), returnedException);
+    auto jsResult = m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithAReturnValue"), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -354,12 +346,11 @@ CallbackResult<typename IDLDOMString::ImplementationType> JSTestCallbackInterfac
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLEnumeration<TestCallbackInterface::Enum>>(state, enumParam));
 
     NakedPtr<JSC::Exception> returnedException;
-    auto jsResult = m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackThatRethrowsExceptions"), returnedException);
+    auto jsResult = m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackThatRethrowsExceptions"), returnedException);
     if (returnedException) {
         auto throwScope = DECLARE_THROW_SCOPE(vm);
         throwException(&state, throwScope, returnedException);
@@ -381,41 +372,11 @@ CallbackResult<typename IDLDOMString::ImplementationType> JSTestCallbackInterfac
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLDictionary<TestCallbackInterface::Dictionary>>(state, globalObject, dictionaryParam));
 
     NakedPtr<JSC::Exception> returnedException;
-    auto jsResult = m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackThatSkipsInvokeCheck"), returnedException);
-    if (returnedException) {
-        reportException(&state, returnedException);
-        return CallbackResultType::ExceptionThrown;
-     }
-
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    auto returnValue = convert<IDLDOMString>(state, jsResult);
-    RETURN_IF_EXCEPTION(throwScope, CallbackResultType::ExceptionThrown);
-    return WTFMove(returnValue);
-}
-
-CallbackResult<typename IDLDOMString::ImplementationType> JSTestCallbackInterface::callbackWithThisObject(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLInterface<TestObj>::ParameterType testObjParam)
-{
-    if (!canInvokeCallback())
-        return CallbackResultType::UnableToExecute;
-
-    Ref<JSTestCallbackInterface> protectedThis(*this);
-
-    auto& globalObject = *m_data->globalObject();
-    auto& vm = globalObject.vm();
-
-    JSLockHolder lock(vm);
-    auto& state = *globalObject.globalExec();
-    JSValue thisValue = toJS<IDLInterface<TestNode>>(state, globalObject, thisObject);
-    MarkedArgumentBuffer args;
-    args.append(toJS<IDLInterface<TestObj>>(state, globalObject, testObjParam));
-
-    NakedPtr<JSC::Exception> returnedException;
-    auto jsResult = m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackWithThisObject"), returnedException);
+    auto jsResult = m_data->invokeCallback(args, JSCallbackData::CallbackType::Object, Identifier::fromString(&vm, "callbackThatSkipsInvokeCheck"), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -433,6 +394,7 @@ JSC::JSValue toJS(TestCallbackInterface& impl)
         return jsNull();
 
     return static_cast<JSTestCallbackInterface&>(impl).callbackData()->callback();
+
 }
 
 } // namespace WebCore
index 1997db1..25ef04a 100644 (file)
@@ -56,7 +56,6 @@ public:
     virtual CallbackResult<typename IDLDOMString::ImplementationType> callbackWithAReturnValue() override;
     virtual CallbackResult<typename IDLDOMString::ImplementationType> callbackThatRethrowsExceptions(typename IDLEnumeration<TestCallbackInterface::Enum>::ParameterType enumParam) override;
     virtual CallbackResult<typename IDLDOMString::ImplementationType> callbackThatSkipsInvokeCheck(typename IDLDictionary<TestCallbackInterface::Dictionary>::ParameterType dictionaryParam) override;
-    virtual CallbackResult<typename IDLDOMString::ImplementationType> callbackWithThisObject(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLInterface<TestObj>::ParameterType testObjParam) override;
 
 private:
     JSTestCallbackInterface(JSC::JSObject*, JSDOMGlobalObject*);
index 8d9c55a..13a34ed 100644 (file)
@@ -74,7 +74,6 @@ CallbackResult<typename IDLVoid::ImplementationType> JSTestVoidCallbackFunction:
 
     JSLockHolder lock(vm);
     auto& state = *globalObject.globalExec();
-    JSValue thisValue = jsUndefined();
     MarkedArgumentBuffer args;
     args.append(toJS<IDLFloat32Array>(state, globalObject, arrayParam));
     args.append(toJS<IDLSerializedScriptValue<SerializedScriptValue>>(state, globalObject, srzParam));
@@ -84,7 +83,7 @@ CallbackResult<typename IDLVoid::ImplementationType> JSTestVoidCallbackFunction:
     args.append(toJS<IDLInterface<TestNode>>(state, globalObject, testNodeParam));
 
     NakedPtr<JSC::Exception> returnedException;
-    m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
+    m_data->invokeCallback(args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);
     if (returnedException) {
         reportException(&state, returnedException);
         return CallbackResultType::ExceptionThrown;
@@ -99,6 +98,7 @@ JSC::JSValue toJS(TestVoidCallbackFunction& impl)
         return jsNull();
 
     return static_cast<JSTestVoidCallbackFunction&>(impl).callbackData()->callback();
+
 }
 
 } // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithThisObject.idl b/Source/WebCore/bindings/scripts/test/TestCallbackFunctionWithThisObject.idl
deleted file mode 100644 (file)
index 616ab86..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2015 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:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  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.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
- */
-
-[
-    CallbackThisObject=TestNode
-] callback TestCallbackFunctionWithThisObject = void (sequence<TestNode> parameter);
index e24c7bb..6380eef 100644 (file)
@@ -52,5 +52,4 @@ dictionary TestCallbackInterfaceDictionary {
     DOMString callbackWithAReturnValue();
     [RethrowException] DOMString callbackThatRethrowsExceptions(TestCallbackInterfaceEnum enumParam);
     [SkipCallbackInvokeCheck] DOMString callbackThatSkipsInvokeCheck(TestCallbackInterfaceDictionary dictionaryParam);
-    [CallbackThisObject=TestNode] DOMString callbackWithThisObject(TestObj testObjParam);
 };
index eea6dfe..e84d095 100644 (file)
@@ -84,7 +84,7 @@ private:
         PendingPromise(LoadPromise&&);
 
     public:
-        Vector<Ref<FontFace>> faces;
+        Vector<RefPtr<FontFace>> faces;
         LoadPromise promise;
         bool hasReachedTerminalState { false };
     };
index 3751178..fbc35ce 100644 (file)
@@ -30,7 +30,6 @@
 
 #pragma once
 
-#include "CallbackResult.h"
 #include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
@@ -44,8 +43,8 @@ class MutationCallback : public RefCounted<MutationCallback> {
 public:
     virtual ~MutationCallback() { }
 
-    virtual CallbackResult<void> handleEvent(MutationObserver&, const Vector<Ref<MutationRecord>>&, MutationObserver&) = 0;
-    virtual bool canInvoke() const = 0;
+    virtual void call(const Vector<Ref<MutationRecord>>&, MutationObserver*) = 0;
+    virtual bool canInvokeCallback() const = 0;
 };
 
 } // namespace WebCore
index 6257459..0b4b1f9 100644 (file)
@@ -209,7 +209,7 @@ HashSet<Node*> MutationObserver::observedNodes() const
 
 bool MutationObserver::canDeliver()
 {
-    return m_callback->canInvoke();
+    return m_callback->canInvokeCallback();
 }
 
 void MutationObserver::deliver()
@@ -232,7 +232,7 @@ void MutationObserver::deliver()
     Vector<Ref<MutationRecord>> records;
     records.swap(m_records);
 
-    m_callback->handleEvent(*this, records, *this);
+    m_callback->call(records, this);
 }
 
 void MutationObserver::notifyMutationObservers()
index 8f2384e..7e03b34 100644 (file)
@@ -29,7 +29,7 @@
  */
 
 [
-    Constructor(MutationCallback callback),
+    CustomConstructor(MutationCallback callback),
     CustomIsReachable,
     ImplementationLacksVTable,
     LegacyWindowAlias=WebKitMutationObserver,
index b1d6eaf..59ba7b0 100644 (file)
@@ -39,7 +39,7 @@ class IntersectionObserverEntry;
 class IntersectionObserverCallback : public RefCounted<IntersectionObserverCallback> {
 public:
     virtual ~IntersectionObserverCallback() { }
-    virtual CallbackResult<void> handleEvent(const Vector<Ref<IntersectionObserverEntry>>&, IntersectionObserver&) = 0;
+    virtual CallbackResult<void> handleEvent(const Vector<RefPtr<IntersectionObserverEntry>>&, IntersectionObserver&) = 0;
 };
 
 } // namespace WebCore