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

Revert "Share DWriteFontProxyImpl TaskRunner to DWriteFontLookupTableBuilder"

This reverts commit 0e244ee9.

Reason for revert: Causes flakiness in FontUniqueNameBrowserTest.ContentLocalFontsMatching

Original change's description:
> Share DWriteFontProxyImpl TaskRunner to DWriteFontLookupTableBuilder
> 
> Preparation for a follow-up CL that actually making queries for the font
> lookup table asynchronous. In that CL, DWriteFontLookupTableBuilder
> needs the task runner to run the Mojo message callback on the same task
> runner on which DWriteFontProxyImpl received it.
> 
> Move scheduling the lookup table construction to
> common_browser_interfaces.cc which is still around the same time in
> startup as before, but makes it much easier to share the same task
> runner.
> 
> Bug: 960263, 889864
> Tbr: avi
> Change-Id: I8be6d4a4d29014967d38f20ccf8a94948a7b8a1e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1626865
> Commit-Queue: Dominik Röttsches <drott@chromium.org>
> Reviewed-by: Dominik Röttsches <drott@chromium.org>
> Reviewed-by: Ken Rockot <rockot@google.com>
> Reviewed-by: François Doray <fdoray@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#663021}

TBR=avi@chromium.org,rockot@google.com,fdoray@chromium.org,drott@chromium.org

Change-Id: Ie88de224e40862a3fa62618c553501e51aa29599
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 960263, 889864
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628712Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663039}
parent 73083084
......@@ -1420,6 +1420,11 @@ int BrowserMainLoop::BrowserThreadsStarted() {
switches::kDisableGpuProcessForDX12VulkanInfoCollection)) {
GpuDataManagerImpl::GetInstance()->RequestGpuSupportedRuntimeVersion();
}
if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) {
content::DWriteFontLookupTableBuilder::GetInstance()
->SchedulePrepareFontUniqueNameTableIfNeeded();
}
#endif
if (MediaKeysListenerManager::IsMediaKeysListenerManagerEnabled()) {
......
......@@ -17,10 +17,8 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/singleton.h"
#include "base/optional.h"
#include "base/sequenced_task_runner.h"
#include "base/synchronization/waitable_event.h"
#include "base/time/time.h"
#include "content/common/content_export.h"
......@@ -46,13 +44,6 @@ class CONTENT_EXPORT DWriteFontLookupTableBuilder {
public:
static DWriteFontLookupTableBuilder* GetInstance();
// Configure the task runner that will be used for posting tasks to when
// executing Mojo result callbacks that were passed from DWriteFontProxyImpl.
void SetCallbackTaskRunner(
scoped_refptr<base::SequencedTaskRunner> callback_task_runner) {
callback_task_runner_ = callback_task_runner;
}
// Retrieve the prepared memory region if it is available.
// EnsureFontUniqueNameTable() must be checked before.
base::ReadOnlySharedMemoryRegion DuplicateMemoryRegion();
......@@ -200,7 +191,6 @@ class CONTENT_EXPORT DWriteFontLookupTableBuilder {
bool caching_enabled_ = true;
base::Optional<base::WaitableEvent> hang_event_for_testing_;
base::CancelableOnceCallback<void()> timeout_callback_;
scoped_refptr<base::SequencedTaskRunner> callback_task_runner_;
DISALLOW_COPY_AND_ASSIGN(DWriteFontLookupTableBuilder);
};
......
......@@ -11,7 +11,6 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/memory/ref_counted.h"
#include "base/task/post_task.h"
#include "base/task_runner.h"
......@@ -24,7 +23,6 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/connection_filter.h"
#include "content/public/common/content_features.h"
#include "content/public/common/service_manager_connection.h"
#include "content/public/common/service_names.mojom.h"
#include "mojo/public/cpp/bindings/interface_request.h"
......@@ -47,19 +45,10 @@ class ConnectionFilterImpl : public ConnectionFilter {
ConnectionFilterImpl() {
#if defined(OS_WIN)
registry_.AddInterface(base::BindRepeating(&FontCacheDispatcher::Create));
auto dwrite_font_proxy_task_runner =
registry_.AddInterface(
base::BindRepeating(&DWriteFontProxyImpl::Create),
base::CreateSequencedTaskRunnerWithTraits(
{base::TaskPriority::USER_BLOCKING, base::MayBlock()});
registry_.AddInterface(base::BindRepeating(&DWriteFontProxyImpl::Create),
dwrite_font_proxy_task_runner);
if (base::FeatureList::IsEnabled(features::kFontSrcLocalMatching)) {
content::DWriteFontLookupTableBuilder::GetInstance()
->SetCallbackTaskRunner(dwrite_font_proxy_task_runner);
content::DWriteFontLookupTableBuilder::GetInstance()
->SchedulePrepareFontUniqueNameTableIfNeeded();
}
{base::TaskPriority::USER_BLOCKING, base::MayBlock()}));
#elif defined(OS_MACOSX)
registry_.AddInterface(
base::BindRepeating(&SandboxSupportMacImpl::BindRequest,
......
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