Ensure MemoryPressureListenerRegistry instance is created on the main thread
MemoryPressureListenerRegistry is a garbage collected object and was instantiated lazily. This could be a problem when we start a service worker on the IO thread because blink::scheduler::WorkerThread tries to get the instance of the registry during worker start up. Since the IO thread runs without Oilpan and thus can't create garbage collected objects, MakeGarbageCollected() would fail when the instance hasn't been instantiated. This CL ensures the instantiation happens on the main thread. This moves the instantiation earlier than before but it wouldn't affect overall performance because it just creates a garbage collected object and instantiation eventually happens as blink loads resources. Bug: 988335 Change-Id: I3c2fa3f2be5bd1de913bd916b761548fbff4dda0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1732111Reviewed-by:Kentaro Hara <haraken@chromium.org> Commit-Queue: Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/master@{#683478}
Showing
Please register or sign in to comment