Commit 4c535159 authored by sebmarchand's avatar sebmarchand Committed by Commit bot

Revert of Switch BrowserAccessibilityStateImpl to the TaskScheduler API....

Revert of Switch BrowserAccessibilityStateImpl to the TaskScheduler API. (patchset #3 id:40001 of https://codereview.chromium.org/2888773002/ )

Reason for revert:
This is causing some issues on ChromeOS.

See crbug.com/725247

Original issue's description:
> Switch BrowserAccessibilityStateImpl to the TaskScheduler API.
>
> It doesn't look like the #if defined(OS_WIN) block is necessary here, everything could be handled by the task scheduler directly.
>
> BUG=689520
>
> Review-Url: https://codereview.chromium.org/2888773002
> Cr-Commit-Position: refs/heads/master@{#473281}
> Committed: https://chromium.googlesource.com/chromium/src/+/1e0346d1ef0851ad07bf00fafefdd747bf30baed

TBR=dmazzoni@chromium.org,fdoray@chromium.org,aboxhall@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=689520

Review-Url: https://codereview.chromium.org/2899623003
Cr-Commit-Position: refs/heads/master@{#473777}
parent 6b53c676
......@@ -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 @@ BrowserAccessibilityStateImpl::BrowserAccessibilityStateImpl()
: 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));
}
......
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