Commit 987d1665 authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

scheduler: Replace kInternalAccessibility with kInternalDefault and deprectate...

scheduler: Replace kInternalAccessibility with kInternalDefault and deprectate kInternalAccessibility

Following the guideline https://bit.ly/2vMAsQ4, we determined to use
kInternalDefault as long as the tasks can run in the default way, that
might be throttled or paused. This CL deprecates kInternalAccessibility
whose task runner is a default task runner.

Bug: 836410
Change-Id: Icaa3532e3ef2563b8baa6436566cc5f1ac036b86
Reviewed-on: https://chromium-review.googlesource.com/1032318
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557109}
parent 1ab2ed9f
...@@ -334,7 +334,7 @@ void RenderAccessibilityImpl::HandleAXEvent(const blink::WebAXObject& obj, ...@@ -334,7 +334,7 @@ void RenderAccessibilityImpl::HandleAXEvent(const blink::WebAXObject& obj,
// When no accessibility events are in-flight post a task to send // When no accessibility events are in-flight post a task to send
// the events to the browser. We use PostTask so that we can queue // the events to the browser. We use PostTask so that we can queue
// up additional events. // up additional events.
render_frame_->GetTaskRunner(blink::TaskType::kInternalAccessibility) render_frame_->GetTaskRunner(blink::TaskType::kInternalDefault)
->PostTask(FROM_HERE, ->PostTask(FROM_HERE,
base::BindOnce( base::BindOnce(
&RenderAccessibilityImpl::SendPendingAccessibilityEvents, &RenderAccessibilityImpl::SendPendingAccessibilityEvents,
......
...@@ -11,6 +11,8 @@ namespace blink { ...@@ -11,6 +11,8 @@ namespace blink {
// This enum is used for a histogram and it should not be re-numbered. // This enum is used for a histogram and it should not be re-numbered.
// //
// For the task type usage guideline, see https://bit.ly/2vMAsQ4 // For the task type usage guideline, see https://bit.ly/2vMAsQ4
//
// When a new task type is created, use kCount value as a new value.
enum class TaskType : unsigned { enum class TaskType : unsigned {
/////////////////////////////////////// ///////////////////////////////////////
// Speced tasks should use one of the following task types // Speced tasks should use one of the following task types
...@@ -163,11 +165,6 @@ enum class TaskType : unsigned { ...@@ -163,11 +165,6 @@ enum class TaskType : unsigned {
// Tasks related to animation like blinking caret or CSS animation. // Tasks related to animation like blinking caret or CSS animation.
kInternalAnimation = 34, kInternalAnimation = 34,
// Tasks related to accessbility. Tasks with this type are mainly posted by:
// * //content/renderer/accessibility
// * //third_party/blink/renderer/modules/accessibility
kInternalAccessibility = 35,
/////////////////////////////////////// ///////////////////////////////////////
// The following task types are DEPRECATED! Use kInternal* instead. // The following task types are DEPRECATED! Use kInternal* instead.
/////////////////////////////////////// ///////////////////////////////////////
......
...@@ -108,7 +108,7 @@ AXObjectCacheImpl::AXObjectCacheImpl(Document& document) ...@@ -108,7 +108,7 @@ AXObjectCacheImpl::AXObjectCacheImpl(Document& document)
modification_count_(0), modification_count_(0),
relation_cache_(new AXRelationCache(this)), relation_cache_(new AXRelationCache(this)),
notification_post_timer_( notification_post_timer_(
document.GetTaskRunner(TaskType::kInternalAccessibility), document.GetTaskRunner(TaskType::kInternalDefault),
this, this,
&AXObjectCacheImpl::NotificationPostTimerFired), &AXObjectCacheImpl::NotificationPostTimerFired),
accessibility_event_permission_(mojom::PermissionStatus::ASK), accessibility_event_permission_(mojom::PermissionStatus::ASK),
......
...@@ -71,7 +71,6 @@ scoped_refptr<base::SingleThreadTaskRunner> WorkerScheduler::GetTaskRunner( ...@@ -71,7 +71,6 @@ scoped_refptr<base::SingleThreadTaskRunner> WorkerScheduler::GetTaskRunner(
case TaskType::kInternalUserInteraction: case TaskType::kInternalUserInteraction:
case TaskType::kInternalInspector: case TaskType::kInternalInspector:
case TaskType::kInternalAnimation: case TaskType::kInternalAnimation:
case TaskType::kInternalAccessibility:
// UnthrottledTaskRunner is generally discouraged in future. // UnthrottledTaskRunner is generally discouraged in future.
// TODO(nhiroki): Identify which tasks can be throttled / suspendable and // TODO(nhiroki): Identify which tasks can be throttled / suspendable and
// move them into other task runners. See also comments in // move them into other task runners. See also comments in
......
...@@ -286,7 +286,6 @@ scoped_refptr<base::SingleThreadTaskRunner> FrameSchedulerImpl::GetTaskRunner( ...@@ -286,7 +286,6 @@ scoped_refptr<base::SingleThreadTaskRunner> FrameSchedulerImpl::GetTaskRunner(
case TaskType::kIdleTask: case TaskType::kIdleTask:
case TaskType::kInternalDefault: case TaskType::kInternalDefault:
case TaskType::kMiscPlatformAPI: case TaskType::kMiscPlatformAPI:
case TaskType::kInternalAccessibility:
// TODO(altimin): Move appropriate tasks to throttleable task queue. // TODO(altimin): Move appropriate tasks to throttleable task queue.
return TaskRunnerImpl::Create(DeferrableTaskQueue(), type); return TaskRunnerImpl::Create(DeferrableTaskQueue(), type);
// PostedMessage can be used for navigation, so we shouldn't defer it // PostedMessage can be used for navigation, so we shouldn't defer it
......
...@@ -180,8 +180,6 @@ const char* TaskTypeToString(TaskType task_type) { ...@@ -180,8 +180,6 @@ const char* TaskTypeToString(TaskType task_type) {
return "InternalInspector"; return "InternalInspector";
case TaskType::kInternalAnimation: case TaskType::kInternalAnimation:
return "InternalAnimation"; return "InternalAnimation";
case TaskType::kInternalAccessibility:
return "InternalAccessibility";
case TaskType::kCount: case TaskType::kCount:
return "Count"; return "Count";
} }
......
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