Title: [248267] trunk
- Revision
- 248267
- Author
- [email protected]
- Date
- 2019-08-04 23:54:07 -0700 (Sun, 04 Aug 2019)
Log Message
WebRTC: got incorrect `this` in negotiationneeded event
https://bugs.webkit.org/show_bug.cgi?id=200427
Reviewed by Darin Adler.
Source/WebCore:
Make sure a dom object created through a JS built-in constructor is added to the wrapper cache.
Test: webrtc/onnegotiationneeded.html
* bindings/js/JSDOMBuiltinConstructor.h:
(WebCore::createJSObjectFromWrapper):
(WebCore::createJSObject):
LayoutTests:
* webrtc/onnegotiationneeded-expected.txt: Added.
* webrtc/onnegotiationneeded.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (248266 => 248267)
--- trunk/LayoutTests/ChangeLog 2019-08-05 03:26:33 UTC (rev 248266)
+++ trunk/LayoutTests/ChangeLog 2019-08-05 06:54:07 UTC (rev 248267)
@@ -1,3 +1,13 @@
+2019-08-04 Youenn Fablet <[email protected]>
+
+ WebRTC: got incorrect `this` in negotiationneeded event
+ https://bugs.webkit.org/show_bug.cgi?id=200427
+
+ Reviewed by Darin Adler.
+
+ * webrtc/onnegotiationneeded-expected.txt: Added.
+ * webrtc/onnegotiationneeded.html: Added.
+
2019-08-04 Chris Dumez <[email protected]>
Ping loads should not prevent page caching
Added: trunk/LayoutTests/webrtc/onnegotiationneeded-expected.txt (0 => 248267)
--- trunk/LayoutTests/webrtc/onnegotiationneeded-expected.txt (rev 0)
+++ trunk/LayoutTests/webrtc/onnegotiationneeded-expected.txt 2019-08-05 06:54:07 UTC (rev 248267)
@@ -0,0 +1,3 @@
+
+PASS Make sure event target is the connection
+
Added: trunk/LayoutTests/webrtc/onnegotiationneeded.html (0 => 248267)
--- trunk/LayoutTests/webrtc/onnegotiationneeded.html (rev 0)
+++ trunk/LayoutTests/webrtc/onnegotiationneeded.html 2019-08-05 06:54:07 UTC (rev 248267)
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Testing onnegotiationneeded</title>
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script>
+promise_test(() => {
+ let done;
+ const promise = new Promise(resolve => done = resolve);
+
+ const pc = new RTCPeerConnection();
+ pc._onnegotiationneeded_ = function(e) {
+ assert_equals(pc, this);
+ done();
+ }
+ pc.createDataChannel('x');
+ return promise;
+}, "Make sure event target is the connection");
+ </script>
+ </body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (248266 => 248267)
--- trunk/Source/WebCore/ChangeLog 2019-08-05 03:26:33 UTC (rev 248266)
+++ trunk/Source/WebCore/ChangeLog 2019-08-05 06:54:07 UTC (rev 248267)
@@ -1,3 +1,18 @@
+2019-08-04 Youenn Fablet <[email protected]>
+
+ WebRTC: got incorrect `this` in negotiationneeded event
+ https://bugs.webkit.org/show_bug.cgi?id=200427
+
+ Reviewed by Darin Adler.
+
+ Make sure a dom object created through a JS built-in constructor is added to the wrapper cache.
+
+ Test: webrtc/onnegotiationneeded.html
+
+ * bindings/js/JSDOMBuiltinConstructor.h:
+ (WebCore::createJSObjectFromWrapper):
+ (WebCore::createJSObject):
+
2019-08-04 Sam Weinig <[email protected]>
Mangled WHLSL names don't need to allocate Strings
Modified: trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructor.h (248266 => 248267)
--- trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructor.h 2019-08-05 03:26:33 UTC (rev 248266)
+++ trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructor.h 2019-08-05 06:54:07 UTC (rev 248267)
@@ -91,14 +91,13 @@
return callConstructor(state, *object);
}
-template<typename JSClass> inline
+template<typename JSClass>
typename std::enable_if<JSDOMObjectInspector<JSClass>::isSimpleWrapper, JSC::JSObject&>::type createJSObject(JSDOMBuiltinConstructor<JSClass>& constructor)
{
- auto& globalObject = *constructor.globalObject();
- return *JSClass::create(getDOMStructure<JSClass>(globalObject.vm(), globalObject), &globalObject, JSClass::DOMWrapped::create());
+ return *createWrapper<typename JSClass::DOMWrapped>(constructor.globalObject(), JSClass::DOMWrapped::create());
}
-template<typename JSClass> inline
+template<typename JSClass>
typename std::enable_if<JSDOMObjectInspector<JSClass>::isBuiltin, JSC::JSObject&>::type createJSObject(JSDOMBuiltinConstructor<JSClass>& constructor)
{
auto& globalObject = *constructor.globalObject();
@@ -105,14 +104,11 @@
return *JSClass::create(getDOMStructure<JSClass>(globalObject.vm(), globalObject), &globalObject);
}
-template<typename JSClass> inline
+template<typename JSClass>
typename std::enable_if<JSDOMObjectInspector<JSClass>::isComplexWrapper, JSC::JSObject*>::type createJSObject(JSDOMBuiltinConstructor<JSClass>& constructor)
{
- ScriptExecutionContext* context = constructor.scriptExecutionContext();
- if (!context)
- return nullptr;
- auto& globalObject = *constructor.globalObject();
- return JSClass::create(getDOMStructure<JSClass>(globalObject.vm(), globalObject), &globalObject, JSClass::DOMWrapped::create(*context));
+ auto* context = constructor.scriptExecutionContext();
+ return context ? createWrapper<typename JSClass::DOMWrapped>(constructor.globalObject(), JSClass::DOMWrapped::create(*context)) : nullptr;
}
template<typename JSClass> inline JSC::EncodedJSValue JSC_HOST_CALL JSDOMBuiltinConstructor<JSClass>::construct(JSC::ExecState* state)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes