Title: [221908] trunk/Source/WebCore
Revision
221908
Author
fred.w...@free.fr
Date
2017-09-12 00:36:57 -0700 (Tue, 12 Sep 2017)

Log Message

Remove unnecessary virtual keyword from JS test files
https://bugs.webkit.org/show_bug.cgi?id=176683

Patch by Frederic Wang <fw...@igalia.com> on 2017-09-12
Reviewed by Simon Fraser.

JS bindings headers do not comply with the WebKit coding style since they use both the
"virtual" and "override" keywords. This patch modifies the generator script to only use
"override" and regenerates the bindings accordingly.

No new tests, behavior unchanged.

* bindings/scripts/CodeGeneratorJS.pm:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
* bindings/scripts/test/JS/JSTestCallbackInterface.h:
* bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (221907 => 221908)


--- trunk/Source/WebCore/ChangeLog	2017-09-12 06:59:48 UTC (rev 221907)
+++ trunk/Source/WebCore/ChangeLog	2017-09-12 07:36:57 UTC (rev 221908)
@@ -1,3 +1,24 @@
+2017-09-12  Frederic Wang  <fw...@igalia.com>
+
+        Remove unnecessary virtual keyword from JS test files
+        https://bugs.webkit.org/show_bug.cgi?id=176683
+
+        Reviewed by Simon Fraser.
+
+        JS bindings headers do not comply with the WebKit coding style since they use both the
+        "virtual" and "override" keywords. This patch modifies the generator script to only use
+        "override" and regenerates the bindings accordingly.
+
+        No new tests, behavior unchanged.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/test/JS/JSTestCallbackFunction.h:
+        * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h:
+        * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h:
+        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
+        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
+        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
+
 2017-09-11  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (221907 => 221908)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2017-09-12 06:59:48 UTC (rev 221907)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2017-09-12 07:36:57 UTC (rev 221908)
@@ -5862,7 +5862,7 @@
             # FIXME: Change the default name (used for callback functions) to something other than handleEvent. It makes little sense.
             my $functionName = $operation->name || "handleEvent";
 
-            push(@$contentRef, "    virtual ${nativeReturnType} ${functionName}(" . join(", ", @arguments) . ") override;\n");
+            push(@$contentRef, "    ${nativeReturnType} ${functionName}(" . join(", ", @arguments) . ") override;\n");
         }
     }
 
@@ -5870,7 +5870,7 @@
 
     push(@$contentRef, "    ${className}(JSC::JSObject*, JSDOMGlobalObject*);\n\n");
 
-    push(@$contentRef, "    virtual void visitJSFunction(JSC::SlotVisitor&) override;\n\n") if $interfaceOrCallback->extendedAttributes->{IsWeakCallback};
+    push(@$contentRef, "    void visitJSFunction(JSC::SlotVisitor&) override;\n\n") if $interfaceOrCallback->extendedAttributes->{IsWeakCallback};
 
     push(@$contentRef, "    ${callbackDataType}* m_data;\n");
     push(@$contentRef, "};\n\n");

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h (221907 => 221908)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h	2017-09-12 06:59:48 UTC (rev 221907)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h	2017-09-12 07:36:57 UTC (rev 221908)
@@ -40,7 +40,7 @@
     JSCallbackDataStrong* callbackData() { return m_data; }
 
     // Functions
-    virtual CallbackResult<typename IDLDOMString::ImplementationType> handleEvent(typename IDLLong::ParameterType argument) override;
+    CallbackResult<typename IDLDOMString::ImplementationType> handleEvent(typename IDLLong::ParameterType argument) override;
 
 private:
     JSTestCallbackFunction(JSC::JSObject*, JSDOMGlobalObject*);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h (221907 => 221908)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h	2017-09-12 06:59:48 UTC (rev 221907)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h	2017-09-12 07:36:57 UTC (rev 221908)
@@ -40,7 +40,7 @@
     JSCallbackDataStrong* callbackData() { return m_data; }
 
     // Functions
-    virtual CallbackResult<typename IDLDOMString::ImplementationType> handleEvent(typename IDLSequence<IDLLong>::ParameterType argument) override;
+    CallbackResult<typename IDLDOMString::ImplementationType> handleEvent(typename IDLSequence<IDLLong>::ParameterType argument) override;
 
 private:
     JSTestCallbackFunctionRethrow(JSC::JSObject*, JSDOMGlobalObject*);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h (221907 => 221908)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h	2017-09-12 06:59:48 UTC (rev 221907)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h	2017-09-12 07:36:57 UTC (rev 221908)
@@ -40,7 +40,7 @@
     JSCallbackDataStrong* callbackData() { return m_data; }
 
     // Functions
-    virtual CallbackResult<typename IDLVoid::ImplementationType> handleEvent(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLSequence<IDLInterface<TestNode>>::ParameterType parameter) override;
+    CallbackResult<typename IDLVoid::ImplementationType> handleEvent(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLSequence<IDLInterface<TestNode>>::ParameterType parameter) override;
 
 private:
     JSTestCallbackFunctionWithThisObject(JSC::JSObject*, JSDOMGlobalObject*);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h (221907 => 221908)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h	2017-09-12 06:59:48 UTC (rev 221907)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h	2017-09-12 07:36:57 UTC (rev 221908)
@@ -40,7 +40,7 @@
     JSCallbackDataStrong* callbackData() { return m_data; }
 
     // Functions
-    virtual CallbackResult<typename IDLVoid::ImplementationType> handleEvent(typename IDLSequence<IDLNullable<IDLLong>>::ParameterType sequenceArg, typename IDLLong::ParameterType longArg) override;
+    CallbackResult<typename IDLVoid::ImplementationType> handleEvent(typename IDLSequence<IDLNullable<IDLLong>>::ParameterType sequenceArg, typename IDLLong::ParameterType longArg) override;
 
 private:
     JSTestCallbackFunctionWithTypedefs(JSC::JSObject*, JSDOMGlobalObject*);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h (221907 => 221908)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h	2017-09-12 06:59:48 UTC (rev 221907)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h	2017-09-12 07:36:57 UTC (rev 221908)
@@ -45,17 +45,17 @@
     static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
 
     // Functions
-    virtual CallbackResult<typename IDLVoid::ImplementationType> callbackWithNoParam() override;
-    virtual CallbackResult<typename IDLVoid::ImplementationType> callbackWithArrayParam(typename IDLFloat32Array::ParameterType arrayParam) override;
-    virtual CallbackResult<typename IDLVoid::ImplementationType> callbackWithSerializedScriptValueParam(typename IDLSerializedScriptValue<SerializedScriptValue>::ParameterType srzParam, typename IDLDOMString::ParameterType strParam) override;
-    virtual CallbackResult<typename IDLLong::ImplementationType> customCallback(typename IDLInterface<TestObj>::ParameterType testObjParam, typename IDLInterface<TestNode>::ParameterType testNodeParam) override;
-    virtual CallbackResult<typename IDLVoid::ImplementationType> callbackWithStringList(typename IDLInterface<DOMStringList>::ParameterType listParam) override;
-    virtual CallbackResult<typename IDLVoid::ImplementationType> callbackWithBoolean(typename IDLBoolean::ParameterType boolParam) override;
-    virtual CallbackResult<typename IDLVoid::ImplementationType> callbackRequiresThisToPass(typename IDLLong::ParameterType longParam, typename IDLInterface<TestNode>::ParameterType testNodeParam) override;
-    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;
+    CallbackResult<typename IDLVoid::ImplementationType> callbackWithNoParam() override;
+    CallbackResult<typename IDLVoid::ImplementationType> callbackWithArrayParam(typename IDLFloat32Array::ParameterType arrayParam) override;
+    CallbackResult<typename IDLVoid::ImplementationType> callbackWithSerializedScriptValueParam(typename IDLSerializedScriptValue<SerializedScriptValue>::ParameterType srzParam, typename IDLDOMString::ParameterType strParam) override;
+    CallbackResult<typename IDLLong::ImplementationType> customCallback(typename IDLInterface<TestObj>::ParameterType testObjParam, typename IDLInterface<TestNode>::ParameterType testNodeParam) override;
+    CallbackResult<typename IDLVoid::ImplementationType> callbackWithStringList(typename IDLInterface<DOMStringList>::ParameterType listParam) override;
+    CallbackResult<typename IDLVoid::ImplementationType> callbackWithBoolean(typename IDLBoolean::ParameterType boolParam) override;
+    CallbackResult<typename IDLVoid::ImplementationType> callbackRequiresThisToPass(typename IDLLong::ParameterType longParam, typename IDLInterface<TestNode>::ParameterType testNodeParam) override;
+    CallbackResult<typename IDLDOMString::ImplementationType> callbackWithAReturnValue() override;
+    CallbackResult<typename IDLDOMString::ImplementationType> callbackThatRethrowsExceptions(typename IDLEnumeration<TestCallbackInterface::Enum>::ParameterType enumParam) override;
+    CallbackResult<typename IDLDOMString::ImplementationType> callbackThatSkipsInvokeCheck(typename IDLDictionary<TestCallbackInterface::Dictionary>::ParameterType dictionaryParam) override;
+    CallbackResult<typename IDLDOMString::ImplementationType> callbackWithThisObject(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLInterface<TestObj>::ParameterType testObjParam) override;
 
 private:
     JSTestCallbackInterface(JSC::JSObject*, JSDOMGlobalObject*);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.h (221907 => 221908)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.h	2017-09-12 06:59:48 UTC (rev 221907)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.h	2017-09-12 07:36:57 UTC (rev 221908)
@@ -42,7 +42,7 @@
     JSCallbackDataStrong* callbackData() { return m_data; }
 
     // Functions
-    virtual CallbackResult<typename IDLVoid::ImplementationType> handleEvent(typename IDLFloat32Array::ParameterType arrayParam, typename IDLSerializedScriptValue<SerializedScriptValue>::ParameterType srzParam, typename IDLDOMString::ParameterType strArg, typename IDLBoolean::ParameterType boolParam, typename IDLLong::ParameterType longParam, typename IDLInterface<TestNode>::ParameterType testNodeParam) override;
+    CallbackResult<typename IDLVoid::ImplementationType> handleEvent(typename IDLFloat32Array::ParameterType arrayParam, typename IDLSerializedScriptValue<SerializedScriptValue>::ParameterType srzParam, typename IDLDOMString::ParameterType strArg, typename IDLBoolean::ParameterType boolParam, typename IDLLong::ParameterType longParam, typename IDLInterface<TestNode>::ParameterType testNodeParam) override;
 
 private:
     JSTestVoidCallbackFunction(JSC::JSObject*, JSDOMGlobalObject*);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to