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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc

Issue 2954283003: DCHECK that scheduler tasks have positive duration. (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | 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 "platform/scheduler/renderer/renderer_scheduler_impl.h" 5 #include "platform/scheduler/renderer/renderer_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/stack_trace.h" 8 #include "base/debug/stack_trace.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1903 MonotonicTimeInSecondsToTimeTicks(start_time); 1903 MonotonicTimeInSecondsToTimeTicks(start_time);
1904 GetMainThreadOnly().current_task_start_time = start_time_ticks; 1904 GetMainThreadOnly().current_task_start_time = start_time_ticks;
1905 seqlock_queueing_time_estimator_.seqlock.WriteBegin(); 1905 seqlock_queueing_time_estimator_.seqlock.WriteBegin();
1906 seqlock_queueing_time_estimator_.data.OnTopLevelTaskStarted(start_time_ticks); 1906 seqlock_queueing_time_estimator_.data.OnTopLevelTaskStarted(start_time_ticks);
1907 seqlock_queueing_time_estimator_.seqlock.WriteEnd(); 1907 seqlock_queueing_time_estimator_.seqlock.WriteEnd();
1908 } 1908 }
1909 1909
1910 void RendererSchedulerImpl::DidProcessTask(TaskQueue* task_queue, 1910 void RendererSchedulerImpl::DidProcessTask(TaskQueue* task_queue,
1911 double start_time, 1911 double start_time,
1912 double end_time) { 1912 double end_time) {
1913 DCHECK(start_time <= end_time);
Sami 2017/06/28 17:42:48 nit: Consider using DCHECK_LE to get a nicer error
tdresser 2017/06/28 17:55:02 Done.
1913 // TODO(scheduler-dev): Remove conversions when Blink starts using 1914 // TODO(scheduler-dev): Remove conversions when Blink starts using
1914 // base::TimeTicks instead of doubles for time. 1915 // base::TimeTicks instead of doubles for time.
1915 base::TimeTicks start_time_ticks = 1916 base::TimeTicks start_time_ticks =
1916 MonotonicTimeInSecondsToTimeTicks(start_time); 1917 MonotonicTimeInSecondsToTimeTicks(start_time);
1917 base::TimeTicks end_time_ticks = MonotonicTimeInSecondsToTimeTicks(end_time); 1918 base::TimeTicks end_time_ticks = MonotonicTimeInSecondsToTimeTicks(end_time);
1918 1919
1919 seqlock_queueing_time_estimator_.seqlock.WriteBegin(); 1920 seqlock_queueing_time_estimator_.seqlock.WriteBegin();
1920 seqlock_queueing_time_estimator_.data.OnTopLevelTaskCompleted(end_time_ticks); 1921 seqlock_queueing_time_estimator_.data.OnTopLevelTaskCompleted(end_time_ticks);
1921 seqlock_queueing_time_estimator_.seqlock.WriteEnd(); 1922 seqlock_queueing_time_estimator_.seqlock.WriteEnd();
1922 1923
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2192 case TimeDomainType::VIRTUAL: 2193 case TimeDomainType::VIRTUAL:
2193 return "virtual"; 2194 return "virtual";
2194 default: 2195 default:
2195 NOTREACHED(); 2196 NOTREACHED();
2196 return nullptr; 2197 return nullptr;
2197 } 2198 }
2198 } 2199 }
2199 2200
2200 } // namespace scheduler 2201 } // namespace scheduler
2201 } // namespace blink 2202 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698