Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1195)

Unified Diff: content/renderer/scheduler/renderer_scheduler_impl.cc

Issue 847883002: Reland "Throttle resource message requests during user interaction" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/scheduler/renderer_scheduler_impl.cc
diff --git a/content/renderer/scheduler/renderer_scheduler_impl.cc b/content/renderer/scheduler/renderer_scheduler_impl.cc
index 7f006144fda6759d20b349cf7ce9c70627c0ace2..00f39c2ebd5850bebf4c16bef3a93ef6dbac3ee5 100644
--- a/content/renderer/scheduler/renderer_scheduler_impl.cc
+++ b/content/renderer/scheduler/renderer_scheduler_impl.cc
@@ -145,6 +145,15 @@ void RendererSchedulerImpl::UpdateForInputEvent() {
last_input_time_ = Now();
}
+bool RendererSchedulerImpl::IsHighPriorityWorkAnticipated() {
+ main_thread_checker_.CalledOnValidThread();
davidben 2015/02/03 19:46:47 DCHECK(....); Ditto for all the other instances o
jdduke (slow) 2015/02/04 01:39:50 Hah, good catch.
+ if (!task_queue_manager_)
+ return false;
+
+ MaybeUpdatePolicy();
+ return SchedulerPolicy() == COMPOSITOR_PRIORITY_POLICY;
+}
+
bool RendererSchedulerImpl::ShouldYieldForHighPriorityWork() {
main_thread_checker_.CalledOnValidThread();
if (!task_queue_manager_)
@@ -155,6 +164,8 @@ bool RendererSchedulerImpl::ShouldYieldForHighPriorityWork() {
// work outstanding. Note: even though the control queue is higher priority
// we don't yield for it since these tasks are not user-provided work and they
// are only intended to run before the next task, not interrupt the tasks.
+ // Note: This function could conceivable be implemented in terms of
davidben 2015/02/03 19:46:47 Nit: conceivable -> conceivably
jdduke (slow) 2015/02/04 01:39:50 Done.
+ // |IsHighPriorityWorkAnticipated|, but for clarity is not.
return SchedulerPolicy() == COMPOSITOR_PRIORITY_POLICY &&
!task_queue_manager_->IsQueueEmpty(COMPOSITOR_TASK_QUEUE);
}

Powered by Google App Engine
This is Rietveld 408576698