| Index: content/browser/accessibility/browser_accessibility_state_impl.cc
|
| diff --git a/content/browser/accessibility/browser_accessibility_state_impl.cc b/content/browser/accessibility/browser_accessibility_state_impl.cc
|
| index 32e17d9f019a2ab8aafb82e47e40f780fda66148..faf6a7bd412ba3745d4e9a7a84d8965df4ccbb61 100644
|
| --- a/content/browser/accessibility/browser_accessibility_state_impl.cc
|
| +++ b/content/browser/accessibility/browser_accessibility_state_impl.cc
|
| @@ -8,7 +8,6 @@
|
|
|
| #include "base/command_line.h"
|
| #include "base/metrics/histogram_macros.h"
|
| -#include "base/task_scheduler/post_task.h"
|
| #include "build/build_config.h"
|
| #include "content/browser/renderer_host/render_widget_host_impl.h"
|
| #include "content/browser/web_contents/web_contents_impl.h"
|
| @@ -58,15 +57,22 @@
|
| : BrowserAccessibilityState(),
|
| disable_hot_tracking_(false) {
|
| ResetAccessibilityModeValue();
|
| +#if defined(OS_WIN)
|
| + // On Windows, UpdateHistograms calls some system functions with unknown
|
| + // runtime, so call it on the file thread to ensure there's no jank.
|
| + // Everything in that method must be safe to call on another thread.
|
| + BrowserThread::ID update_histogram_thread = BrowserThread::FILE;
|
| +#else
|
| + // On all other platforms, UpdateHistograms should be called on the main
|
| + // thread.
|
| + BrowserThread::ID update_histogram_thread = BrowserThread::UI;
|
| +#endif
|
|
|
| // We need to AddRef() the leaky singleton so that Bind doesn't
|
| // delete it prematurely.
|
| AddRef();
|
| - // The delay is necessary because assistive technology sometimes isn't
|
| - // detected until after the user interacts in some way, so a reasonable delay
|
| - // gives us better numbers.
|
| - base::PostDelayedTaskWithTraits(
|
| - FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
|
| + BrowserThread::PostDelayedTask(
|
| + update_histogram_thread, FROM_HERE,
|
| base::Bind(&BrowserAccessibilityStateImpl::UpdateHistograms, this),
|
| base::TimeDelta::FromSeconds(ACCESSIBILITY_HISTOGRAM_DELAY_SECS));
|
| }
|
|
|