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

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp

Issue 2229213002: Web SQL: Replace WTF_LOG() with STORAGE_DVLOG() or SQL_DVLOG(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using LAZY_STREAM Created 4 years, 4 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) 2007, 2008, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2013 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 25 matching lines...) Expand all
36 #include "modules/webdatabase/DatabaseAuthorizer.h" 36 #include "modules/webdatabase/DatabaseAuthorizer.h"
37 #include "modules/webdatabase/DatabaseContext.h" 37 #include "modules/webdatabase/DatabaseContext.h"
38 #include "modules/webdatabase/DatabaseThread.h" 38 #include "modules/webdatabase/DatabaseThread.h"
39 #include "modules/webdatabase/SQLError.h" 39 #include "modules/webdatabase/SQLError.h"
40 #include "modules/webdatabase/SQLStatementCallback.h" 40 #include "modules/webdatabase/SQLStatementCallback.h"
41 #include "modules/webdatabase/SQLStatementErrorCallback.h" 41 #include "modules/webdatabase/SQLStatementErrorCallback.h"
42 #include "modules/webdatabase/SQLTransactionBackend.h" 42 #include "modules/webdatabase/SQLTransactionBackend.h"
43 #include "modules/webdatabase/SQLTransactionCallback.h" 43 #include "modules/webdatabase/SQLTransactionCallback.h"
44 #include "modules/webdatabase/SQLTransactionClient.h" // FIXME: Should be used i n the backend only. 44 #include "modules/webdatabase/SQLTransactionClient.h" // FIXME: Should be used i n the backend only.
45 #include "modules/webdatabase/SQLTransactionErrorCallback.h" 45 #include "modules/webdatabase/SQLTransactionErrorCallback.h"
46 #include "platform/Logging.h" 46 #include "modules/webdatabase/StorageLog.h"
47 #include "wtf/StdLibExtras.h" 47 #include "wtf/StdLibExtras.h"
48 #include "wtf/Vector.h" 48 #include "wtf/Vector.h"
49 49
50 namespace blink { 50 namespace blink {
51 51
52 SQLTransaction* SQLTransaction::create(Database* db, SQLTransactionCallback* cal lback, 52 SQLTransaction* SQLTransaction::create(Database* db, SQLTransactionCallback* cal lback,
53 VoidCallback* successCallback, SQLTransactionErrorCallback* errorCallback, b ool readOnly) 53 VoidCallback* successCallback, SQLTransactionErrorCallback* errorCallback, b ool readOnly)
54 { 54 {
55 return new SQLTransaction(db, callback, successCallback, errorCallback, read Only); 55 return new SQLTransaction(db, callback, successCallback, errorCallback, read Only);
56 } 56 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 ASSERT(state < SQLTransactionState::NumberOfStates); 126 ASSERT(state < SQLTransactionState::NumberOfStates);
127 127
128 return stateFunctions[static_cast<int>(state)]; 128 return stateFunctions[static_cast<int>(state)];
129 } 129 }
130 130
131 // requestTransitToState() can be called from the backend. Hence, it should 131 // requestTransitToState() can be called from the backend. Hence, it should
132 // NOT be modifying SQLTransactionBackend in general. The only safe field to 132 // NOT be modifying SQLTransactionBackend in general. The only safe field to
133 // modify is m_requestedState which is meant for this purpose. 133 // modify is m_requestedState which is meant for this purpose.
134 void SQLTransaction::requestTransitToState(SQLTransactionState nextState) 134 void SQLTransaction::requestTransitToState(SQLTransactionState nextState)
135 { 135 {
136 WTF_LOG(StorageAPI, "Scheduling %s for transaction %p\n", nameForSQLTransact ionState(nextState), this); 136 #if DCHECK_IS_ON()
137 STORAGE_DVLOG(1) << "Scheduling " << nameForSQLTransactionState(nextState) < < " for transaction " << this;
138 #endif
137 m_requestedState = nextState; 139 m_requestedState = nextState;
138 m_database->scheduleTransactionCallback(this); 140 m_database->scheduleTransactionCallback(this);
139 } 141 }
140 142
141 SQLTransactionState SQLTransaction::nextStateForTransactionError() 143 SQLTransactionState SQLTransaction::nextStateForTransactionError()
142 { 144 {
143 ASSERT(m_transactionError); 145 ASSERT(m_transactionError);
144 if (hasErrorCallback()) 146 if (hasErrorCallback())
145 return SQLTransactionState::DeliverTransactionErrorCallback; 147 return SQLTransactionState::DeliverTransactionErrorCallback;
146 148
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 // Only honor the requested state transition if we're not supposed to be 316 // Only honor the requested state transition if we're not supposed to be
315 // cleaning up and shutting down: 317 // cleaning up and shutting down:
316 if (m_database->opened()) { 318 if (m_database->opened()) {
317 setStateToRequestedState(); 319 setStateToRequestedState();
318 ASSERT(m_nextState == SQLTransactionState::End 320 ASSERT(m_nextState == SQLTransactionState::End
319 || m_nextState == SQLTransactionState::DeliverTransactionCallback 321 || m_nextState == SQLTransactionState::DeliverTransactionCallback
320 || m_nextState == SQLTransactionState::DeliverTransactionErrorCallba ck 322 || m_nextState == SQLTransactionState::DeliverTransactionErrorCallba ck
321 || m_nextState == SQLTransactionState::DeliverStatementCallback 323 || m_nextState == SQLTransactionState::DeliverStatementCallback
322 || m_nextState == SQLTransactionState::DeliverQuotaIncreaseCallback 324 || m_nextState == SQLTransactionState::DeliverQuotaIncreaseCallback
323 || m_nextState == SQLTransactionState::DeliverSuccessCallback); 325 || m_nextState == SQLTransactionState::DeliverSuccessCallback);
324 326 #if DCHECK_IS_ON()
325 WTF_LOG(StorageAPI, "Callback %s\n", nameForSQLTransactionState(m_nextSt ate)); 327 STORAGE_DVLOG(1) << "Callback " << nameForSQLTransactionState(m_nextStat e);
328 #endif
326 return false; 329 return false;
327 } 330 }
328 331
329 clearCallbacks(); 332 clearCallbacks();
330 m_nextState = SQLTransactionState::CleanupAndTerminate; 333 m_nextState = SQLTransactionState::CleanupAndTerminate;
331 334
332 return true; 335 return true;
333 } 336 }
334 337
335 void SQLTransaction::clearCallbacks() 338 void SQLTransaction::clearCallbacks()
336 { 339 {
337 m_callback.clear(); 340 m_callback.clear();
338 m_successCallback.clear(); 341 m_successCallback.clear();
339 m_errorCallback.clear(); 342 m_errorCallback.clear();
340 } 343 }
341 344
342 SQLTransactionErrorCallback* SQLTransaction::releaseErrorCallback() 345 SQLTransactionErrorCallback* SQLTransaction::releaseErrorCallback()
343 { 346 {
344 return m_errorCallback.release(); 347 return m_errorCallback.release();
345 } 348 }
346 349
347 } // namespace blink 350 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698