Commit a83d645e authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Avoid triggering DWriteFontLookupTableBuilder callbacks in shutdown

Speculative fix for test flakiness in issues below.

As per dcheng@'s recommendations in issue 1066456, remove
CallbackWrappers:

1) For DWriteFontProxyImpl::GetUniqueNameLookupTableIfAvailable we can
immediately return by calling the callback explicitly.

2) For DWriteFontProxyImpl::GetUniqueNameLookupTable the callback is
enqueued in DWriteFontLookupTableBuilder in a
base::DeferredSequencedTaskRunner and gets run from there or does not
during shutdown - which is as expected. No need for an extra wrapper.

Bug: 1066456
Change-Id: I21891bd3cf5db7379b9e8d366cb405e7f43e8326
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164828
Auto-Submit: Dominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762871}
parent 537871b4
......@@ -350,13 +350,7 @@ IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, DISABLED_ExpiredFlagDoesntApply) {
}
#endif
// Flaky on Windows 7: https://crbug.com/1066456
#if defined(OS_WIN)
#define MAYBE_FormRestore DISABLED_FormRestore
#else
#define MAYBE_FormRestore FormRestore
#endif
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, MAYBE_FormRestore) {
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, FormRestore) {
NavigateToFlagsPage();
content::WebContents* contents =
browser()->tab_strip_model()->GetActiveWebContents();
......
......@@ -217,15 +217,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionSettingsUIBrowserTest, ListenerRegistration) {
}
}
// Flaky on Windows: crbug.com/
#if defined(OS_WIN)
#define MAYBE_ActivityLogInactiveWithoutSwitch \
DISABLED_ActivityLogInactiveWithoutSwitch
#else
#define MAYBE_ActivityLogInactiveWithoutSwitch ActivityLogInactiveWithoutSwitch
#endif // OS_WIN
IN_PROC_BROWSER_TEST_F(ExtensionSettingsUIBrowserTest,
MAYBE_ActivityLogInactiveWithoutSwitch) {
ActivityLogInactiveWithoutSwitch) {
// Navigate to chrome://extensions which is a whitelisted URL for the
// chrome.activityLogPrivate API.
GURL extensions_url("chrome://extensions");
......
......@@ -393,12 +393,10 @@ void DWriteFontProxyImpl::MapCharacters(
void DWriteFontProxyImpl::GetUniqueNameLookupTableIfAvailable(
GetUniqueNameLookupTableIfAvailableCallback callback) {
DCHECK(base::FeatureList::IsEnabled(features::kFontSrcLocalMatching));
base::ReadOnlySharedMemoryRegion invalid_region;
callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun(
std::move(callback), false, std::move(invalid_region));
/* Table is not synchronously available, return immediately. */
if (!DWriteFontLookupTableBuilder::GetInstance()
->FontUniqueNameTableReady()) {
std::move(callback).Run(false, base::ReadOnlySharedMemoryRegion());
return;
}
......@@ -497,9 +495,6 @@ void DWriteFontProxyImpl::GetUniqueFontLookupMode(
void DWriteFontProxyImpl::GetUniqueNameLookupTable(
GetUniqueNameLookupTableCallback callback) {
DCHECK(base::FeatureList::IsEnabled(features::kFontSrcLocalMatching));
callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun(
std::move(callback), base::ReadOnlySharedMemoryRegion());
DWriteFontLookupTableBuilder::GetInstance()->QueueShareMemoryRegionWhenReady(
base::SequencedTaskRunnerHandle::Get(), std::move(callback));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment