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

Side by Side Diff: third_party/WebKit/Source/platform/Timer.cpp

Issue 1826733002: Remove ASSERT_WITH_MESSAGE family. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 } 111 }
112 112
113 NO_LAZY_SWEEP_SANITIZE_ADDRESS 113 NO_LAZY_SWEEP_SANITIZE_ADDRESS
114 void TimerBase::runInternal() 114 void TimerBase::runInternal()
115 { 115 {
116 if (!canFire()) 116 if (!canFire())
117 return; 117 return;
118 118
119 TRACE_EVENT0("blink", "TimerBase::run"); 119 TRACE_EVENT0("blink", "TimerBase::run");
120 ASSERT_WITH_MESSAGE(m_thread == currentThread(), "Timer posted by %s %s was run on a different thread", m_location.functionName(), m_location.fileName()); 120 #if DCHECK_IS_ON()
121 DCHECK_EQ(m_thread, currentThread()) << "Timer posted by " << m_location.fun ctionName() << " " << m_location.fileName() << " was run on a different thread";
122 #endif
121 TRACE_EVENT_SET_SAMPLING_STATE("blink", "BlinkInternal"); 123 TRACE_EVENT_SET_SAMPLING_STATE("blink", "BlinkInternal");
122 124
123 if (m_repeatInterval) { 125 if (m_repeatInterval) {
124 double now = timerMonotonicallyIncreasingTime(); 126 double now = timerMonotonicallyIncreasingTime();
125 // This computation should be drift free, and it will cope if we miss a beat, 127 // This computation should be drift free, and it will cope if we miss a beat,
126 // which can easily happen if the thread is busy. It will also cope if we get 128 // which can easily happen if the thread is busy. It will also cope if we get
127 // called slightly before m_unalignedNextFireTime, which can happen due to lack 129 // called slightly before m_unalignedNextFireTime, which can happen due to lack
128 // of timer precision. 130 // of timer precision.
129 double intervalToNextFireTime = m_repeatInterval - fmod(now - m_nextFire Time, m_repeatInterval); 131 double intervalToNextFireTime = m_repeatInterval - fmod(now - m_nextFire Time, m_repeatInterval);
130 setNextFireTime(timerMonotonicallyIncreasingTime(), intervalToNextFireTi me); 132 setNextFireTime(timerMonotonicallyIncreasingTime(), intervalToNextFireTi me);
(...skipping 14 matching lines...) Expand all
145 { 147 {
146 return Platform::current()->currentThread()->getWebTaskRunner(); 148 return Platform::current()->currentThread()->getWebTaskRunner();
147 } 149 }
148 150
149 double TimerBase::timerMonotonicallyIncreasingTime() const 151 double TimerBase::timerMonotonicallyIncreasingTime() const
150 { 152 {
151 return timerTaskRunner()->monotonicallyIncreasingVirtualTimeSeconds(); 153 return timerTaskRunner()->monotonicallyIncreasingVirtualTimeSeconds();
152 } 154 }
153 155
154 } // namespace blink 156 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698