Thanks a lot for kindly answer.Yeah user clicking will yield:listenerIn such case, I want to get this time point, is there any available C++ API?microtask
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/26b02b28-4e5e-4276-974d-21e625ab0738%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6dbbed9b-e80f-4024-84d6-b479732c78af%40chromium.org.
Thank you very much!v8::MicrotasksScope::IsRunningMicrotasks is very helpful!And yes for the case of 2 fetch event listeners, the second listener should be able to call ExtendableEvent::waitUntil as well.Another question about blink::ScriptPromise..Promise.resolve().then(() => { doSomething(); });In C++ code , we can use ScriptPromise::Then to set {on_fulfilled, on_rejected} handlers against this ScriptPromise,but I found that on_fulfilled handler is always called back before doSomething() is called,then how could we get notified that doSomething() execution has just completed? I checked around ScriptPromise but did not find a way..
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/c58ad8a6-a5c4-4caa-8a7d-d32b642022a6%40chromium.org.
Sorry I should have clarified more context for my question.Inside some event handlers(oninstall, onfetch etc.) of serviceworkerglobalscope [1],onfetch = function(e) {e.waituntil(|some promise|);--> ExtendableEvent::waituntil [2] is called in middle of event handler execution, this is OK.};butonfetch = function(e) {Promise.resolve().then(() => e.waituntil(|some promise|));--> waituntil will be called by a microtask execution, this should NOT be allowed, while currently Chromium is allowing this.