Title: [185468] trunk/Source/WebCore
Revision
185468
Author
[email protected]
Date
2015-06-11 13:21:07 -0700 (Thu, 11 Jun 2015)

Log Message

Unreviewed, rolling out r185464.
https://bugs.webkit.org/show_bug.cgi?id=145894

"This patch is breaking binding tests" (Requested by youenn on
#webkit).

Reverted changeset:

"Bindings generator should generate code for Promise-based
APIs"
https://bugs.webkit.org/show_bug.cgi?id=145833
http://trac.webkit.org/changeset/185464

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (185467 => 185468)


--- trunk/Source/WebCore/ChangeLog	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/ChangeLog	2015-06-11 20:21:07 UTC (rev 185468)
@@ -1,5 +1,20 @@
 2015-06-11  Commit Queue  <[email protected]>
 
+        Unreviewed, rolling out r185464.
+        https://bugs.webkit.org/show_bug.cgi?id=145894
+
+        "This patch is breaking binding tests" (Requested by youenn on
+        #webkit).
+
+        Reverted changeset:
+
+        "Bindings generator should generate code for Promise-based
+        APIs"
+        https://bugs.webkit.org/show_bug.cgi?id=145833
+        http://trac.webkit.org/changeset/185464
+
+2015-06-11  Commit Queue  <[email protected]>
+
         Unreviewed, rolling out r185465.
         https://bugs.webkit.org/show_bug.cgi?id=145893
 

Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.idl (185467 => 185468)


--- trunk/Source/WebCore/Modules/webaudio/AudioContext.idl	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.idl	2015-06-11 20:21:07 UTC (rev 185468)
@@ -50,9 +50,9 @@
     // All panning is relative to this listener.
     readonly attribute AudioListener listener;
 
-    Promise suspend();
-    Promise resume();
-    Promise close();
+    [Custom] Promise suspend();
+    [Custom] Promise resume();
+    [Custom] Promise close();
 
     readonly attribute AudioContextState state;
     attribute EventHandler onstatechange;

Modified: trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp (185467 => 185468)


--- trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp	2015-06-11 20:21:07 UTC (rev 185468)
@@ -111,6 +111,33 @@
     return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor->globalObject(), AudioContext, audioContext.get()));
 }
 
+JSValue JSAudioContext::suspend(ExecState* state)
+{
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(state, globalObject());
+
+    impl().suspend(DeferredWrapper(state, globalObject(), promiseDeferred));
+
+    return promiseDeferred->promise();
+}
+
+JSValue JSAudioContext::resume(ExecState* state)
+{
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(state, globalObject());
+
+    impl().resume(DeferredWrapper(state, globalObject(), promiseDeferred));
+
+    return promiseDeferred->promise();
+}
+
+JSValue JSAudioContext::close(ExecState* state)
+{
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(state, globalObject());
+
+    impl().close(DeferredWrapper(state, globalObject(), promiseDeferred));
+
+    return promiseDeferred->promise();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(WEB_AUDIO)

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (185467 => 185468)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2015-06-11 20:21:07 UTC (rev 185468)
@@ -1047,7 +1047,7 @@
                 $needsVisitChildren = 1;
                 push(@headerContent, "#endif\n") if $conditionalString;
             }
-            elsif (IsReturningPromise($attribute)) {
+            elsif ($attribute->signature->type eq "Promise") {
                 $headerIncludes{"JSDOMPromise.h"} = 1;
 
                 my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
@@ -2759,7 +2759,7 @@
 
             next if $isCustom && $isOverloaded && $function->{overloadIndex} > 1;
 
-            AddIncludesForTypeInImpl($function->signature->type) unless $isCustom or IsReturningPromise($function);
+            AddIncludesForTypeInImpl($function->signature->type) unless $isCustom;
 
             my $functionName = GetFunctionName($className, $function);
 
@@ -3386,8 +3386,6 @@
         $argsIndex++;
     }
 
-    push(@arguments, "DeferredWrapper(exec, castedThis->globalObject(), promiseDeferred)") if IsReturningPromise($function);
-
     push(@arguments, "ec") if $raisesException;
 
     return ("$functionName(" . join(", ", @arguments) . ")", scalar @arguments);
@@ -3656,17 +3654,9 @@
             push(@implContent, "#else\n");
             push(@implContent, $indent . "result = " . NativeToJSValue($function->signature, 1, $interfaceName, $functionString, $thisObject) . ";\n");
             push(@implContent, "#endif\n");
-        } elsif (IsReturningPromise($function)) {
-            AddToImplIncludes("JSDOMPromise.h");
-
-            push(@implContent, $indent . "auto* promiseDeferred = JSPromiseDeferred::create(exec, castedThis->globalObject());\n");
-            push(@implContent, $indent . $functionString . ";\n");
-            push(@implContent, $indent . "JSValue result = promiseDeferred->promise();\n");
-
         } else {
             push(@implContent, $indent . "JSValue result = " . NativeToJSValue($function->signature, 1, $interfaceName, $functionString, $thisObject) . ";\n");
         }
-        # FIXME: In case of IsReturningPromise($function), the function should not throw. Exception should be used to reject the promise callback.
         push(@implContent, "\n" . $indent . "setDOMException(exec, ec);\n") if $raisesException;
 
         if ($codeGenerator->ExtendedAttributeContains($function->signature->extendedAttributes->{"CallWith"}, "ScriptState")) {
@@ -4784,13 +4774,6 @@
     return !$interface->extendedAttributes->{"NoInterfaceObject"} || $interface->extendedAttributes->{"CustomConstructor"};
 }
 
-sub IsReturningPromise
-{
-    my $function = shift;
-
-    return $function->signature->type eq "Promise";
-}
-
 sub IsConstructable
 {
     my $interface = shift;

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (185467 => 185468)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp	2015-06-11 20:21:07 UTC (rev 185468)
@@ -33,7 +33,6 @@
 #include "WebKitDOMDocumentPrivate.h"
 #include "WebKitDOMNodePrivate.h"
 #include "WebKitDOMPrivate.h"
-#include "WebKitDOMPromisePrivate.h"
 #include "WebKitDOMSVGPointPrivate.h"
 #include "WebKitDOMTestEnumTypePrivate.h"
 #include "WebKitDOMTestNodePrivate.h"
@@ -1552,15 +1551,6 @@
     item->any(a, b);
 }
 
-WebKitDOMPromise* webkit_dom_test_obj_test_promise_function(WebKitDOMTestObj* self)
-{
-    WebCore::JSMainThreadNullState state;
-    g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
-    WebCore::TestObj* item = WebKit::core(self);
-    RefPtr<WebCore::Promise> gobjectResult = WTF::getPtr(item->testPromiseFunction());
-    return WebKit::kit(gobjectResult.get());
-}
-
 glong webkit_dom_test_obj_get_read_only_long_attr(WebKitDOMTestObj* self)
 {
     WebCore::JSMainThreadNullState state;

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h (185467 => 185468)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h	2015-06-11 20:21:07 UTC (rev 185468)
@@ -651,17 +651,6 @@
 webkit_dom_test_obj_any(WebKitDOMTestObj* self, gfloat a, glong b);
 
 /**
- * webkit_dom_test_obj_test_promise_function:
- * @self: A #WebKitDOMTestObj
- *
- * Returns: (transfer none): A #WebKitDOMPromise
- *
- * Stability: Unstable
-**/
-WEBKIT_API WebKitDOMPromise*
-webkit_dom_test_obj_test_promise_function(WebKitDOMTestObj* self);
-
-/**
  * webkit_dom_test_obj_get_read_only_long_attr:
  * @self: A #WebKitDOMTestObj
  *

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


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2015-06-11 20:21:07 UTC (rev 185468)
@@ -29,7 +29,6 @@
 #include "Frame.h"
 #include "HTMLNames.h"
 #include "JSDOMBinding.h"
-#include "JSDOMPromise.h"
 #include "JSDOMStringList.h"
 #include "JSDocument.h"
 #include "JSEventListener.h"
@@ -155,7 +154,6 @@
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicDoubleMethod(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionVariadicNodeMethod(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAny(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunction(JSC::ExecState*);
 
 // Attributes
 
@@ -650,7 +648,6 @@
     { "variadicDoubleMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicDoubleMethod), (intptr_t) (2) },
     { "variadicNodeMethod", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVariadicNodeMethod), (intptr_t) (2) },
     { "any", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAny), (intptr_t) (2) },
-    { "testPromiseFunction", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunction), (intptr_t) (0) },
 };
 
 const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
@@ -4426,20 +4423,6 @@
     return JSValue::encode(jsUndefined());
 }
 
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestPromiseFunction(ExecState* exec)
-{
-    JSValue thisValue = exec->thisValue();
-    JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(thisValue);
-    if (UNLIKELY(!castedThis))
-        return throwThisTypeError(*exec, "TestObj", "testPromiseFunction");
-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
-    auto& impl = castedThis->impl();
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(exec, castedThis->globalObject());
-    impl.testPromiseFunction(DeferredWrapper(exec, castedThis->globalObject(), promiseDeferred));
-    JSValue result = promiseDeferred->promise();
-    return JSValue::encode(result);
-}
-
 void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
     auto* thisObject = jsCast<JSTestObj*>(cell);

Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h (185467 => 185468)


--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h	2015-06-11 20:21:07 UTC (rev 185468)
@@ -173,5 +173,4 @@
 - (void)variadicDoubleMethod:(double)head tail:(double)tail;
 - (void)variadicNodeMethod:(DOMNode *)head tail:(DOMNode *)tail;
 - (void)any:(float)a b:(int)b;
-- (DOMPromise *)testPromiseFunction;
 @end

Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (185467 => 185468)


--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm	2015-06-11 20:21:07 UTC (rev 185468)
@@ -1183,12 +1183,6 @@
     IMPL->any(a, b);
 }
 
-- (DOMPromise *)testPromiseFunction
-{
-    WebCore::JSMainThreadNullState state;
-    return kit(WTF::getPtr(IMPL->testPromiseFunction()));
-}
-
 @end
 
 WebCore::TestObj* core(DOMTestObj *wrapper)

Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (185467 => 185468)


--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2015-06-11 20:12:39 UTC (rev 185467)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2015-06-11 20:21:07 UTC (rev 185468)
@@ -274,8 +274,6 @@
     // Promise attributes
     [CustomGetter] readonly attribute Promise testPromiseAttr;
 
-    // Promise function
-    Promise testPromiseFunction();
 };
 
 // The following comment should not generate any code.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to