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

Unified Diff: third_party/WebKit/Source/modules/webdatabase/SQLTransactionStateMachine.h

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: m_domTreeVersion initialization Created 3 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: third_party/WebKit/Source/modules/webdatabase/SQLTransactionStateMachine.h
diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionStateMachine.h b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionStateMachine.h
index 77f2cfd823bd36f4a6321cc7679bea453a16bff6..e383739f49bc62e6085f347c370ad2fcad045e9a 100644
--- a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionStateMachine.h
+++ b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionStateMachine.h
@@ -48,13 +48,13 @@ class SQLTransactionStateMachine {
SQLTransactionState m_nextState;
SQLTransactionState m_requestedState;
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
// The state audit trail (i.e. bread crumbs) keeps track of up to the last
// s_sizeOfStateAuditTrail states that the state machine enters. The audit
// trail is updated before entering each state. This is for debugging use
// only.
static const int s_sizeOfStateAuditTrail = 20;
- int m_nextStateAuditEntry;
+ int m_nextStateAuditEntry = 0;
SQLTransactionState m_stateAuditTrail[s_sizeOfStateAuditTrail];
#endif
};
@@ -67,12 +67,8 @@ template <typename T>
SQLTransactionStateMachine<T>::SQLTransactionStateMachine()
: m_nextState(SQLTransactionState::Idle),
m_requestedState(SQLTransactionState::Idle)
-#if ENABLE(ASSERT)
- ,
- m_nextStateAuditEntry(0)
-#endif
{
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
for (int i = 0; i < s_sizeOfStateAuditTrail; i++)
m_stateAuditTrail[i] = SQLTransactionState::NumberOfStates;
#endif
@@ -94,7 +90,7 @@ void SQLTransactionStateMachine<T>::runStateMachine() {
StateFunction stateFunction = stateFunctionFor(m_nextState);
ASSERT(stateFunction);
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
m_stateAuditTrail[m_nextStateAuditEntry] = m_nextState;
m_nextStateAuditEntry =
(m_nextStateAuditEntry + 1) % s_sizeOfStateAuditTrail;

Powered by Google App Engine
This is Rietveld 408576698