PerformanceObserver's callback gets garbage collected |
||||
Issue description
I'm not a javascript novice, so perhaps that's the issue but the following code eventually breaks because the PerformanceObserverCallback gets gc'd and m_callback.isEmpty() is true in PerformanceObserverCallback::call.
My code:
function perfCallback(list) { console.log('hello'); }
let observer = new PerformanceObserver(perfCallback);
observer.observe({entryTypes: ['resource']});
I have a site that sequentially loads 300 resources. After each it checks the timing before fetching the next. Sometimes it succeeds, but usually it gets stuck pretty quickly because the callback gets collected and the observer doesn't fire.
That should work right? My work-around is to make a top-level variable that references the function and pass that to the PerformanceObserver callback.
,
Apr 12 2017
Er, note that my original comment was supposed to say that I *am* a JS novice ;)
,
Apr 12 2017
This issue was already fixed here: https://bugs.chromium.org/p/chromium/issues/detail?id=658030#c1 Can you verify on M57 stable?
,
Apr 13 2017
,
May 11 2017
jkarlin@ - ping, can you verify this is fixed.
,
May 22 2017
Seems to be fixed. Thanks! |
||||
►
Sign in to add a comment |
||||
Comment 1 by tdres...@chromium.org
, Apr 12 2017