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

Unified Diff: third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp

Issue 1909813002: Enable per thread heap for database thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/SQLTransaction.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp b/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp
index c1f8ed778c0256ec6a2f04805299c2274ecc790b..d258e51c4370df5bdfe43fc0223050382a12b0ee 100644
--- a/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp
@@ -35,6 +35,7 @@
#include "modules/webdatabase/Database.h"
#include "modules/webdatabase/DatabaseAuthorizer.h"
#include "modules/webdatabase/DatabaseContext.h"
+#include "modules/webdatabase/DatabaseThread.h"
#include "modules/webdatabase/SQLError.h"
#include "modules/webdatabase/SQLStatementCallback.h"
#include "modules/webdatabase/SQLStatementErrorCallback.h"
@@ -64,6 +65,7 @@ SQLTransaction::SQLTransaction(Database* db, SQLTransactionCallback* callback,
, m_executeSqlAllowed(false)
, m_readOnly(readOnly)
{
+ DCHECK(isMainThread());
ASSERT(m_database);
InspectorInstrumentation::asyncTaskScheduled(db->getExecutionContext(), "SQLTransaction", this, true);
}
@@ -200,6 +202,7 @@ SQLTransactionState SQLTransaction::deliverTransactionErrorCallback()
SQLTransactionState SQLTransaction::deliverStatementCallback()
{
+ DCHECK(isMainThread());
// Spec 4.3.2.6.6 and 4.3.2.6.3: If the statement callback went wrong, jump to the transaction error callback
// Otherwise, continue to loop through the statement queue
m_executeSqlAllowed = true;
@@ -221,6 +224,7 @@ SQLTransactionState SQLTransaction::deliverStatementCallback()
SQLTransactionState SQLTransaction::deliverQuotaIncreaseCallback()
{
+ DCHECK(isMainThread());
ASSERT(m_backend->currentStatement());
bool shouldRetryCurrentStatement = m_database->transactionClient()->didExceedQuota(database());
@@ -231,6 +235,7 @@ SQLTransactionState SQLTransaction::deliverQuotaIncreaseCallback()
SQLTransactionState SQLTransaction::deliverSuccessCallback()
{
+ DCHECK(isMainThread());
InspectorInstrumentation::AsyncTask asyncTask(m_database->getExecutionContext(), this);
InspectorInstrumentation::asyncTaskCanceled(m_database->getExecutionContext(), this);
@@ -263,12 +268,14 @@ SQLTransactionState SQLTransaction::sendToBackendState()
void SQLTransaction::performPendingCallback()
{
+ DCHECK(isMainThread());
computeNextStateAndCleanupIfNeeded();
runStateMachine();
}
void SQLTransaction::executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments, SQLStatementCallback* callback, SQLStatementErrorCallback* callbackError, ExceptionState& exceptionState)
{
+ DCHECK(isMainThread());
if (!m_executeSqlAllowed) {
exceptionState.throwDOMException(InvalidStateError, "SQL execution is disallowed.");
return;

Powered by Google App Engine
This is Rietveld 408576698