Reland: Sequentialise access to callbacks in DWriteFontLookupTableBuilder
This reland fixes the sequenced task runner initialisation. Set the task runner in the constructor and reset it for each unit test execution. Since there may be multiple instance of DWriteFontProxyImpl instantiated for multiple RenderProcessHosts, and DWriteFontProxyImpl::GetUniqueNameLookupTable may access DWriteFontLookupTableBuilder::QueueShareMemoryRegionWhenReady from separate threads, there may be race conditions around the pending_callbacks_ member of DWriteFontLookupTableBuilder. Sequentialise and guard access to pending_callbacks_ with a separate sequenced task runner. Remove explicit configuration of the FontUniqueNameBrowserTest cache directory as [1] introduced a callback function in ShellContentBrowserClient which sets this correctly. This avoids instantiating DWriteFontLookupTableBuilder too early when the ThreadPool is not yet available in a BrowserTest. [1] https://chromium-review.googlesource.com/c/chromium/src/+/1776358/9/content/shell/browser/shell_content_browser_client.cc#422 Fixed: 1047054 Change-Id: I38cf8b84a48315980624b68bbf55d3727be457b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2032119Reviewed-by:Matthew Denton <mpdenton@chromium.org> Commit-Queue: Dominik Röttsches <drott@chromium.org> Cr-Commit-Position: refs/heads/master@{#737466}
Showing
Please register or sign in to comment