New issue
Advanced search Search tips

Issue 678621 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

PerformanceObserver's callback gets garbage collected

Project Member Reported by jkarlin@chromium.org, Jan 5 2017

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.
 
Cc: panicker@chromium.org
Shubhie, this sounds pretty bad. Do you know who would be a reasonable owner for this?
Er, note that my original comment was supposed to say that I *am* a JS novice ;)
Owner: jkarlin@chromium.org
This issue was already fixed here:
https://bugs.chromium.org/p/chromium/issues/detail?id=658030#c1

Can you verify on M57 stable?

Comment 4 by panicker@google.com, Apr 13 2017

Status: Unconfirmed (was: Untriaged)
jkarlin@ - ping, can you verify this is fixed.
Status: Fixed (was: Unconfirmed)
Seems to be fixed. Thanks!

Sign in to add a comment