Commit 77ad239d authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

Replace TaskType::kUnspecedTimer with kInternalAnimation where animation is related

We plan to eliminate kUnthrottled, kUnspecedTimer and kUnspecedLoading
and replace them with appropriate kInternal* task types.

This CL also introduced a new type kInternalAnimation.

Bug: 830489
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ia8be580c1f313c89c6928dbb201c0cb2ac435ed8
Reviewed-on: https://chromium-review.googlesource.com/1009448Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550140}
parent d832cbe6
......@@ -170,7 +170,10 @@ enum class TaskType : unsigned {
// Tasks related to the inspector.
kInternalInspector = 33,
kCount = 34,
// Tasks related to animation like blinking caret or CSS animation.
kInternalAnimation = 34,
kCount = 35,
};
} // namespace blink
......
......@@ -154,10 +154,10 @@ class CORE_EXPORT DocumentTimeline : public AnimationTimeline {
public:
DocumentTimelineTiming(DocumentTimeline* timeline)
: timeline_(timeline),
timer_(
timeline->GetDocument()->GetTaskRunner(TaskType::kUnspecedTimer),
this,
&DocumentTimelineTiming::TimerFired) {
timer_(timeline->GetDocument()->GetTaskRunner(
TaskType::kInternalAnimation),
this,
&DocumentTimelineTiming::TimerFired) {
DCHECK(timeline_);
}
......
......@@ -51,7 +51,7 @@ FrameCaret::FrameCaret(LocalFrame& frame,
display_item_client_(new CaretDisplayItemClient()),
caret_visibility_(CaretVisibility::kHidden),
caret_blink_timer_(new TaskRunnerTimer<FrameCaret>(
frame.GetTaskRunner(TaskType::kUnspecedTimer),
frame.GetTaskRunner(TaskType::kInternalAnimation),
this,
&FrameCaret::CaretBlinkTimerFired)),
should_paint_caret_(true),
......
......@@ -50,7 +50,7 @@ inline SpinButtonElement::SpinButtonElement(Document& document,
capturing_(false),
up_down_state_(kIndeterminate),
press_starting_state_(kIndeterminate),
repeating_timer_(document.GetTaskRunner(TaskType::kUnspecedTimer),
repeating_timer_(document.GetTaskRunner(TaskType::kInternalAnimation),
this,
&SpinButtonElement::RepeatingTimerFired) {}
......
......@@ -36,7 +36,7 @@ LayoutProgress::LayoutProgress(HTMLProgressElement* element)
animation_duration_(0),
animating_(false),
animation_timer_(
element->GetDocument().GetTaskRunner(TaskType::kUnspecedTimer),
element->GetDocument().GetTaskRunner(TaskType::kInternalAnimation),
this,
&LayoutProgress::AnimationTimerFired) {}
......
......@@ -48,11 +48,12 @@ SMILTimeContainer::SMILTimeContainer(SVGSVGElement& owner)
started_(false),
paused_(false),
document_order_indexes_dirty_(false),
wakeup_timer_(owner.GetDocument().GetTaskRunner(TaskType::kUnspecedTimer),
this,
&SMILTimeContainer::WakeupTimerFired),
wakeup_timer_(
owner.GetDocument().GetTaskRunner(TaskType::kInternalAnimation),
this,
&SMILTimeContainer::WakeupTimerFired),
animation_policy_once_timer_(
owner.GetDocument().GetTaskRunner(TaskType::kUnspecedTimer),
owner.GetDocument().GetTaskRunner(TaskType::kInternalAnimation),
this,
&SMILTimeContainer::AnimationPolicyTimerFired),
owner_svg_element_(&owner) {}
......
......@@ -70,6 +70,7 @@ WorkerGlobalScopeScheduler::GetTaskRunner(TaskType type) const {
case TaskType::kInternalIPC:
case TaskType::kInternalUserInteraction:
case TaskType::kInternalInspector:
case TaskType::kInternalAnimation:
// UnthrottledTaskRunner is generally discouraged in future.
// TODO(nhiroki): Identify which tasks can be throttled / suspendable and
// move them into other task runners. See also comments in
......
......@@ -300,6 +300,7 @@ scoped_refptr<base::SingleThreadTaskRunner> FrameSchedulerImpl::GetTaskRunner(
case TaskType::kInternalMedia:
case TaskType::kInternalMediaRealTime:
case TaskType::kInternalUserInteraction:
case TaskType::kInternalAnimation:
return TaskRunnerImpl::Create(PausableTaskQueue(), type);
case TaskType::kUnthrottled:
case TaskType::kInternalTest:
......
......@@ -181,6 +181,8 @@ const char* TaskTypeToString(TaskType task_type) {
return "InternalUserInteraction";
case TaskType::kInternalInspector:
return "InternalInspector";
case TaskType::kInternalAnimation:
return "InternalAnimation";
case TaskType::kCount:
return "Count";
}
......
......@@ -38372,6 +38372,7 @@ Called by update_net_trust_anchors.py.-->
<int value="31" label="InternalIPC"/>
<int value="32" label="InternalUserInteraction"/>
<int value="33" label="InternalInspector"/>
<int value="34" label="InternalAnimation"/>
</enum>
<enum name="RendererSchedulerTaskUseCase">
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