Speculative fix for crash in CSSFontFace::FontLoaded
When font scanning finished, Blink receives a Mojo IPC callback that local font matching is now available in notifies all WeakPtr's to LocalFontFaceSource's if those WeakPtrs are individually still valid. After consulting with haraken@ it turns out that using a WeakPtr and WeakPtrFactory on a heap object is bad practice, as an object may remain allocated for a little while after being marked for GC - but the WeakPtr state does not reflect that yet. So when we have callbacks bound to the WeakPtr they still get executed. Instead, use WrapWeakPersistent() to in the Bind call in order to drop the callbacks if the target object for the callback has been collected by GC. This should address the assumed GC race condition which is most likely the underlying issue for issue 1017078. FontUniqueNameLookupWin: :ReceiveReadOnlySharedMemoryRegion, then it Bug: 1017078 Change-Id: I9812ec292f2986fc15a3d14cbbfe5381788634d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895334Reviewed-by:Kentaro Hara <haraken@chromium.org> Commit-Queue: Dominik Röttsches <drott@chromium.org> Cr-Commit-Position: refs/heads/master@{#712128}
Showing
Please register or sign in to comment