Chromium Code Reviews| Index: Source/modules/webdatabase/SQLTransactionBackendSync.cpp |
| diff --git a/Source/modules/webdatabase/SQLTransactionBackendSync.cpp b/Source/modules/webdatabase/SQLTransactionBackendSync.cpp |
| index b1e298be8ddb8194391ae1e64617d2c66d9ec234..ffe0f4038e160e543a8d35bee1b27a667405b100 100644 |
| --- a/Source/modules/webdatabase/SQLTransactionBackendSync.cpp |
| +++ b/Source/modules/webdatabase/SQLTransactionBackendSync.cpp |
| @@ -62,13 +62,27 @@ SQLTransactionBackendSync::SQLTransactionBackendSync(DatabaseSync* db, PassOwnPt |
| ASSERT(m_database->executionContext()->isContextThread()); |
| } |
| -SQLTransactionBackendSync::~SQLTransactionBackendSync() |
| +void SQLTransactionBackendSync::rollbackIfInProgress() |
| { |
| - ASSERT(m_database->executionContext()->isContextThread()); |
| + ASSERT(!m_database->executionContext() || m_database->executionContext()->isContextThread()); |
| if (m_sqliteTransaction && m_sqliteTransaction->inProgress()) |
| rollback(); |
| } |
| +SQLTransactionBackendSync::~SQLTransactionBackendSync() |
| +{ |
| +#if ENABLE(OILPAN) |
| + ASSERT(!m_sqliteTransaction || !m_sqliteTransaction->inProgress()); |
| +#else |
| + rollbackIfInProgress(); |
| +#endif |
| +} |
| + |
| +void SQLTransactionBackendSync::trace(Visitor* visitor) |
| +{ |
| + visitor->trace(m_database); |
| +} |
| + |
| PassRefPtr<SQLResultSet> SQLTransactionBackendSync::executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments, ExceptionState& exceptionState) |
| { |
| ASSERT(m_database->executionContext()->isContextThread()); |
| @@ -229,9 +243,10 @@ void SQLTransactionBackendSync::commit(ExceptionState& exceptionState) |
| m_database->reportCommitTransactionResult(0, -1, 0); // OK |
| } |
| +// This can be called during GC. Do not allocate new on-heap objects. |
|
Vyacheslav Egorov (Google)
2014/03/18 07:54:55
I don't think comments like this scale as long you
|
| void SQLTransactionBackendSync::rollback() |
| { |
| - ASSERT(m_database->executionContext()->isContextThread()); |
| + ASSERT(!m_database->executionContext() || m_database->executionContext()->isContextThread()); |
| m_database->disableAuthorizer(); |
| if (m_sqliteTransaction) { |
|
Vyacheslav Egorov (Google)
2014/03/18 07:54:55
from my reading of the code this whole if can be j
|
| m_sqliteTransaction->rollback(); |