WebIDL callback interface handling should run microtasks |
|||||
Issue description
"callback interfaces" in WebIDL can either be functions or objects with a certain property. E.g., one can pass `{ handleEvent: function() { console.log(42); } }` to addEventListener. To get a handle to the function, Blink needs to invoke a JavaScript "Get" operation on the passed-in object, which may run arbitrary code. E.g.:
```
addEventListener("message", {
get handleEvent() {
console.log("getter called");
Promise.resolve().then(() => console.log("Promise resolved"));
return () => console.log("listener called");
}});
addEventListener("message", () => console.log("second listener called"));
postMessage(42, "*");
```
This should print:
```
getter called
Promise resolved
listener called
```
but instead prints:
```
getter called
listener called
Promise resolved
```
For more background, see issue 728583
,
Jan 4 2018
,
Jan 23 2018
Users experienced this crash on the following builds: Mac Beta 64.0.3282.99 - 0.14 CPM, 7 reports, 7 clients (signature blink::BeforeCallEnteredCallback) If this update was incorrect, please add "Fracas-Wrong" label to prevent future updates. - Go/Fracas
,
Feb 6 2018
Users experienced this crash on the following builds: Mac Canary 66.0.3341.0 - 1.08 CPM, 1 reports, 1 clients (signature blink::BeforeCallEnteredCallback) Linux Dev 65.0.3325.31 - 2.17 CPM, 10 reports, 1 clients (signature blink::BeforeCallEnteredCallback) If this update was incorrect, please add "Fracas-Wrong" label to prevent future updates. - Go/Fracas
,
Feb 8 2018
Just to update latest behavior, still crash instances are observed on chrome latest stable #64.0.3282.140 with 91 instances. As of now no crashes are seen on chrome dev and canary market builds. Last crash observed on M66 #66.0.3341.0 with 1 instance. Link to list of the builds: ---------------------------- https://crash.corp.google.com/browse?q=product.name%3D%27Chrome_Mac%27%20%20AND%20expanded_custom_data.ChromeCrashProto.magic_signature_1.name%3D%27blink%3A%3ABeforeCallEnteredCallback%27#-samplereports,productversion:1000 Thanks!
,
Feb 8 2018
Sorry, just noticed that Fracas incorrectly blamed this bug. I've opened a new bug to track the crashes: issue 810566 |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by haraken@chromium.org
, Jan 4 2018