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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentLifecycle.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 || m_state == LayoutClean 259 || m_state == LayoutClean
260 || m_state == CompositingClean 260 || m_state == CompositingClean
261 || m_state == PaintInvalidationClean 261 || m_state == PaintInvalidationClean
262 || m_state == PaintClean; 262 || m_state == PaintClean;
263 } 263 }
264 264
265 #endif 265 #endif
266 266
267 void DocumentLifecycle::advanceTo(LifecycleState nextState) 267 void DocumentLifecycle::advanceTo(LifecycleState nextState)
268 { 268 {
269 ASSERT_WITH_MESSAGE(canAdvanceTo(nextState), 269 #if DCHECK_IS_ON()
haraken 2016/03/23 02:10:01 I'm just curious but do you know why DCHECK is not
tkent 2016/03/23 02:20:51 DCHECK is no-op and I think compilers generate no
270 "Cannot advance document lifecycle from %s to %s.", stateAsDebugString(m _state), stateAsDebugString(nextState)); 270 DCHECK(canAdvanceTo(nextState))
271 << "Cannot advance document lifecycle from " << stateAsDebugString(m_sta te)
272 << " to " << stateAsDebugString(nextState) << ".";
273 #endif
271 m_state = nextState; 274 m_state = nextState;
272 } 275 }
273 276
274 void DocumentLifecycle::ensureStateAtMost(LifecycleState state) 277 void DocumentLifecycle::ensureStateAtMost(LifecycleState state)
275 { 278 {
276 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou tClean); 279 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou tClean);
277 if (m_state <= state) 280 if (m_state <= state)
278 return; 281 return;
279 ASSERT_WITH_MESSAGE(canRewindTo(state), 282 #if DCHECK_IS_ON()
280 "Cannot rewind document lifecycle from %s to %s.", stateAsDebugString(m_ state), stateAsDebugString(state)); 283 DCHECK(canRewindTo(state))
284 << "Cannot rewind document lifecycle from " << stateAsDebugString(m_stat e)
285 << " to " <<stateAsDebugString(state) << ".";
286 #endif
281 m_state = state; 287 m_state = state;
282 } 288 }
283 289
284 bool DocumentLifecycle::throttlingAllowed() const 290 bool DocumentLifecycle::throttlingAllowed() const
285 { 291 {
286 return s_allowThrottlingCount; 292 return s_allowThrottlingCount;
287 } 293 }
288 294
289 #if ENABLE(ASSERT) 295 #if ENABLE(ASSERT)
290 #define DEBUG_STRING_CASE(StateName) \ 296 #define DEBUG_STRING_CASE(StateName) \
(...skipping 25 matching lines...) Expand all
316 DEBUG_STRING_CASE(Stopped); 322 DEBUG_STRING_CASE(Stopped);
317 DEBUG_STRING_CASE(Disposed); 323 DEBUG_STRING_CASE(Disposed);
318 } 324 }
319 325
320 ASSERT_NOT_REACHED(); 326 ASSERT_NOT_REACHED();
321 return "Unknown"; 327 return "Unknown";
322 } 328 }
323 #endif 329 #endif
324 330
325 } // namespace blink 331 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698