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

Side by Side Diff: content/renderer/scheduler/renderer_scheduler_impl.cc

Issue 908473002: Add DeadlineOverrun step to the RendererSchedulerIdlePeriod trace event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid adding '0ms' timestamp Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/trace_event.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/scheduler/renderer_scheduler_impl.h" 5 #include "content/renderer/scheduler/renderer_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 void RendererSchedulerImpl::StartIdlePeriod() { 286 void RendererSchedulerImpl::StartIdlePeriod() {
287 TRACE_EVENT_ASYNC_BEGIN0("renderer.scheduler", 287 TRACE_EVENT_ASYNC_BEGIN0("renderer.scheduler",
288 "RendererSchedulerIdlePeriod", this); 288 "RendererSchedulerIdlePeriod", this);
289 DCHECK(main_thread_checker_.CalledOnValidThread()); 289 DCHECK(main_thread_checker_.CalledOnValidThread());
290 renderer_task_queue_selector_->EnableQueue( 290 renderer_task_queue_selector_->EnableQueue(
291 IDLE_TASK_QUEUE, RendererTaskQueueSelector::BEST_EFFORT_PRIORITY); 291 IDLE_TASK_QUEUE, RendererTaskQueueSelector::BEST_EFFORT_PRIORITY);
292 task_queue_manager_->PumpQueue(IDLE_TASK_QUEUE); 292 task_queue_manager_->PumpQueue(IDLE_TASK_QUEUE);
293 } 293 }
294 294
295 void RendererSchedulerImpl::EndIdlePeriod() { 295 void RendererSchedulerImpl::EndIdlePeriod() {
296 bool is_tracing;
297 TRACE_EVENT_CATEGORY_GROUP_ENABLED("renderer.scheduler", &is_tracing);
298 if (is_tracing && !estimated_next_frame_begin_.is_null() &&
299 base::TimeTicks::Now() > estimated_next_frame_begin_) {
300 TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0(
301 "renderer.scheduler",
302 "RendererSchedulerIdlePeriod",
303 this,
304 "DeadlineOverrun",
305 estimated_next_frame_begin_.ToInternalValue());
306 }
296 TRACE_EVENT_ASYNC_END0("renderer.scheduler", 307 TRACE_EVENT_ASYNC_END0("renderer.scheduler",
297 "RendererSchedulerIdlePeriod", this); 308 "RendererSchedulerIdlePeriod", this);
298 DCHECK(main_thread_checker_.CalledOnValidThread()); 309 DCHECK(main_thread_checker_.CalledOnValidThread());
299 end_idle_period_closure_.Cancel(); 310 end_idle_period_closure_.Cancel();
300 renderer_task_queue_selector_->DisableQueue(IDLE_TASK_QUEUE); 311 renderer_task_queue_selector_->DisableQueue(IDLE_TASK_QUEUE);
301 } 312 }
302 313
303 void RendererSchedulerImpl::SetTimeSourceForTesting( 314 void RendererSchedulerImpl::SetTimeSourceForTesting(
304 scoped_refptr<cc::TestNowSource> time_source) { 315 scoped_refptr<cc::TestNowSource> time_source) {
305 DCHECK(main_thread_checker_.CalledOnValidThread()); 316 DCHECK(main_thread_checker_.CalledOnValidThread());
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 // meaningful touchstart response and should not impact task priority. 440 // meaningful touchstart response and should not impact task priority.
430 return current_state; 441 return current_state;
431 442
432 default: 443 default:
433 break; 444 break;
434 } 445 }
435 return INPUT_ACTIVE; 446 return INPUT_ACTIVE;
436 } 447 }
437 448
438 } // namespace content 449 } // namespace content
OLDNEW
« no previous file with comments | « base/trace_event/trace_event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698