Changeset 247219 in webkit


Ignore:
Timestamp:
Jul 8, 2019 11:38:32 AM (5 years ago)
Author:
Chris Dumez
Message:

Fix thread safety issue in Database::scheduleTransactionCallback()
https://bugs.webkit.org/show_bug.cgi?id=199557

Reviewed by Alex Christensen.

I am working on adding threading assertions to WeakPtr and found a potentially
unsafe call to makeWeakPtr() on a Document from Database::scheduleTransactionCallback()
via Document::postTask(), on a background database thread. Document is a main thread
object and we should therefore not be interacting with it from a background thread.

For clarity, this patch also switches the webdatabase code to use Document instead
of ScriptExecution as type since it is only exposed to Window contexts, not workers.

  • Modules/webdatabase/Database.cpp:

(WebCore::Database::Database):
(WebCore::Database::~Database):
(WebCore::Database::runTransaction):
(WebCore::Database::scheduleTransactionCallback):
(WebCore::Database::logErrorMessage):
(WebCore::Database::securityOrigin):
(WebCore::Database::didExceedQuota):

  • Modules/webdatabase/Database.h:

(WebCore::Database::document):

  • Modules/webdatabase/DatabaseContext.cpp:

(WebCore::DatabaseContext::DatabaseContext):

  • Modules/webdatabase/DatabaseContext.h:
  • Modules/webdatabase/DatabaseManager.cpp:

(WebCore::DatabaseManager::databaseContext):
(WebCore::logOpenDatabaseError):
(WebCore::DatabaseManager::openDatabaseBackend):
(WebCore::DatabaseManager::tryToOpenDatabaseBackend):
(WebCore::DatabaseManager::openDatabase):
(WebCore::DatabaseManager::hasOpenDatabases):
(WebCore::DatabaseManager::stopDatabases):
(WebCore::DatabaseManager::logErrorMessage):

  • Modules/webdatabase/DatabaseManager.h:
  • Modules/webdatabase/SQLStatement.cpp:

(WebCore::SQLStatement::SQLStatement):

  • Modules/webdatabase/SQLTransaction.cpp:

(WebCore::SQLTransaction::SQLTransaction):

  • inspector/InspectorInstrumentation.h:

(WebCore::InspectorInstrumentation::didOpenDatabase):

  • inspector/agents/InspectorDatabaseAgent.cpp:

(WebCore::InspectorDatabaseAgent::executeSQL):

Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247218 r247219  
     12019-07-08  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix thread safety issue in Database::scheduleTransactionCallback()
     4        https://bugs.webkit.org/show_bug.cgi?id=199557
     5
     6        Reviewed by Alex Christensen.
     7
     8        I am working on adding threading assertions to WeakPtr and found a potentially
     9        unsafe call to makeWeakPtr() on a Document from Database::scheduleTransactionCallback()
     10        via Document::postTask(), on a background database thread. Document is a main thread
     11        object and we should therefore not be interacting with it from a background thread.
     12
     13        For clarity, this patch also switches the webdatabase code to use Document instead
     14        of ScriptExecution as type since it is only exposed to Window contexts, not workers.
     15
     16        * Modules/webdatabase/Database.cpp:
     17        (WebCore::Database::Database):
     18        (WebCore::Database::~Database):
     19        (WebCore::Database::runTransaction):
     20        (WebCore::Database::scheduleTransactionCallback):
     21        (WebCore::Database::logErrorMessage):
     22        (WebCore::Database::securityOrigin):
     23        (WebCore::Database::didExceedQuota):
     24        * Modules/webdatabase/Database.h:
     25        (WebCore::Database::document):
     26        * Modules/webdatabase/DatabaseContext.cpp:
     27        (WebCore::DatabaseContext::DatabaseContext):
     28        * Modules/webdatabase/DatabaseContext.h:
     29        * Modules/webdatabase/DatabaseManager.cpp:
     30        (WebCore::DatabaseManager::databaseContext):
     31        (WebCore::logOpenDatabaseError):
     32        (WebCore::DatabaseManager::openDatabaseBackend):
     33        (WebCore::DatabaseManager::tryToOpenDatabaseBackend):
     34        (WebCore::DatabaseManager::openDatabase):
     35        (WebCore::DatabaseManager::hasOpenDatabases):
     36        (WebCore::DatabaseManager::stopDatabases):
     37        (WebCore::DatabaseManager::logErrorMessage):
     38        * Modules/webdatabase/DatabaseManager.h:
     39        * Modules/webdatabase/SQLStatement.cpp:
     40        (WebCore::SQLStatement::SQLStatement):
     41        * Modules/webdatabase/SQLTransaction.cpp:
     42        (WebCore::SQLTransaction::SQLTransaction):
     43        * inspector/InspectorInstrumentation.h:
     44        (WebCore::InspectorInstrumentation::didOpenDatabase):
     45        * inspector/agents/InspectorDatabaseAgent.cpp:
     46        (WebCore::InspectorDatabaseAgent::executeSQL):
     47
    1482019-07-08  Chris Dumez  <cdumez@apple.com>
    249
  • trunk/Source/WebCore/Modules/webdatabase/Database.cpp

    r243219 r247219  
    194194
    195195Database::Database(DatabaseContext& context, const String& name, const String& expectedVersion, const String& displayName, unsigned long long estimatedSize)
    196     : m_scriptExecutionContext(*context.scriptExecutionContext())
    197     , m_contextThreadSecurityOrigin(m_scriptExecutionContext->securityOrigin()->isolatedCopy())
    198     , m_databaseThreadSecurityOrigin(m_scriptExecutionContext->securityOrigin()->isolatedCopy())
     196    : m_document(*context.document())
     197    , m_contextThreadSecurityOrigin(m_document->securityOrigin().isolatedCopy())
     198    , m_databaseThreadSecurityOrigin(m_document->securityOrigin().isolatedCopy())
    199199    , m_databaseContext(context)
    200200    , m_name((name.isNull() ? emptyString() : name).isolatedCopy())
     
    202202    , m_displayName(displayName.isolatedCopy())
    203203    , m_estimatedSize(estimatedSize)
    204     , m_filename(DatabaseManager::singleton().fullPathForDatabase(*m_scriptExecutionContext->securityOrigin(), m_name))
     204    , m_filename(DatabaseManager::singleton().fullPathForDatabase(m_document->securityOrigin(), m_name))
    205205    , m_databaseAuthorizer(DatabaseAuthorizer::create(unqualifiedInfoTableName))
    206206{
     
    227227Database::~Database()
    228228{
    229     // The reference to the ScriptExecutionContext needs to be cleared on the JavaScript thread.  If we're on that thread already, we can just let the RefPtr's destruction do the dereffing.
    230     if (!m_scriptExecutionContext->isContextThread()) {
    231         auto passedContext = WTFMove(m_scriptExecutionContext);
    232         auto& contextRef = passedContext.get();
    233         contextRef.postTask({ScriptExecutionContext::Task::CleanupTask, [passedContext = WTFMove(passedContext), databaseContext = WTFMove(m_databaseContext)] (ScriptExecutionContext& context) {
    234             ASSERT_UNUSED(context, &context == passedContext.ptr());
    235         }});
    236     }
     229    // The reference to the Document needs to be cleared on the JavaScript thread. If we're on that thread already, we can just let the RefPtr's destruction do the dereffing.
     230    if (!isMainThread())
     231        callOnMainThread([document = WTFMove(m_document), databaseContext = WTFMove(m_databaseContext)] { });
    237232
    238233    // SQLite is "multi-thread safe", but each database handle can only be used
     
    693688    if (!m_isTransactionQueueEnabled) {
    694689        if (errorCallback) {
    695             RefPtr<SQLTransactionErrorCallback> errorCallbackProtector = WTFMove(errorCallback);
    696             m_scriptExecutionContext->postTask([errorCallbackProtector](ScriptExecutionContext&) {
    697                 errorCallbackProtector->handleEvent(SQLError::create(SQLError::UNKNOWN_ERR, "database has been closed"));
     690            callOnMainThread([errorCallback = makeRef(*errorCallback)]() {
     691                errorCallback->handleEvent(SQLError::create(SQLError::UNKNOWN_ERR, "database has been closed"));
    698692            });
    699693        }
     
    708702void Database::scheduleTransactionCallback(SQLTransaction* transaction)
    709703{
    710     RefPtr<SQLTransaction> transactionProtector(transaction);
    711     m_scriptExecutionContext->postTask([transactionProtector] (ScriptExecutionContext&) {
    712         transactionProtector->performPendingCallback();
     704    callOnMainThread([transaction = makeRefPtr(transaction)] {
     705        transaction->performPendingCallback();
    713706    });
    714707}
     
    758751void Database::logErrorMessage(const String& message)
    759752{
    760     m_scriptExecutionContext->addConsoleMessage(MessageSource::Storage, MessageLevel::Error, message);
     753    m_document->addConsoleMessage(MessageSource::Storage, MessageLevel::Error, message);
    761754}
    762755
     
    780773SecurityOriginData Database::securityOrigin()
    781774{
    782     if (m_scriptExecutionContext->isContextThread())
     775    if (isMainThread())
    783776        return m_contextThreadSecurityOrigin->data();
    784777    if (databaseThread().getThread() == &Thread::current())
     
    799792bool Database::didExceedQuota()
    800793{
    801     ASSERT(databaseContext().scriptExecutionContext()->isContextThread());
     794    ASSERT(isMainThread());
    802795    auto& tracker = DatabaseTracker::singleton();
    803796    auto oldQuota = tracker.quota(securityOrigin());
  • trunk/Source/WebCore/Modules/webdatabase/Database.h

    r243219 r247219  
    4040class DatabaseDetails;
    4141class DatabaseThread;
    42 class ScriptExecutionContext;
     42class Document;
    4343class SecurityOrigin;
    4444class SQLTransaction;
     
    106106    DatabaseContext& databaseContext() { return m_databaseContext; }
    107107    DatabaseThread& databaseThread();
    108     ScriptExecutionContext& scriptExecutionContext() { return m_scriptExecutionContext; }
     108    Document& document() { return m_document; }
    109109    void logErrorMessage(const String& message);
    110110
     
    148148#endif
    149149
    150     Ref<ScriptExecutionContext> m_scriptExecutionContext;
     150    Ref<Document> m_document;
    151151    Ref<SecurityOrigin> m_contextThreadSecurityOrigin;
    152152    Ref<SecurityOrigin> m_databaseThreadSecurityOrigin;
  • trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp

    r229979 r247219  
    9595
    9696
    97 DatabaseContext::DatabaseContext(ScriptExecutionContext& context)
    98     : ActiveDOMObject(&context)
     97DatabaseContext::DatabaseContext(Document& document)
     98    : ActiveDOMObject(document)
    9999{
    100100    // ActiveDOMObject expects this to be called to set internal flags.
    101101    suspendIfNeeded();
    102102
    103     ASSERT(!context.databaseContext());
    104     context.setDatabaseContext(this);
     103    ASSERT(!document.databaseContext());
     104    document.setDatabaseContext(this);
    105105}
    106106
  • trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.h

    r237266 r247219  
    6161    void databaseExceededQuota(const String& name, DatabaseDetails);
    6262
    63     using ActiveDOMObject::scriptExecutionContext;
     63    Document* document() const { return downcast<Document>(ActiveDOMObject::scriptExecutionContext()); }
    6464    const SecurityOriginData& securityOrigin() const;
    6565
     
    6767
    6868private:
    69     explicit DatabaseContext(ScriptExecutionContext&);
     69    explicit DatabaseContext(Document&);
    7070
    7171    void stopDatabases() { stopDatabases(nullptr); }
  • trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp

    r243219 r247219  
    3232#include "DatabaseTask.h"
    3333#include "DatabaseTracker.h"
     34#include "Document.h"
    3435#include "InspectorInstrumentation.h"
    3536#include "Logging.h"
    3637#include "PlatformStrategies.h"
    3738#include "ScriptController.h"
    38 #include "ScriptExecutionContext.h"
    3939#include "SecurityOrigin.h"
    4040#include "SecurityOriginData.h"
     
    9898}
    9999
    100 Ref<DatabaseContext> DatabaseManager::databaseContext(ScriptExecutionContext& context)
    101 {
    102     if (auto databaseContext = context.databaseContext())
     100Ref<DatabaseContext> DatabaseManager::databaseContext(Document& document)
     101{
     102    if (auto databaseContext = document.databaseContext())
    103103        return *databaseContext;
    104     return adoptRef(*new DatabaseContext(context));
     104    return adoptRef(*new DatabaseContext(document));
    105105}
    106106
    107107#if LOG_DISABLED
    108108
    109 static inline void logOpenDatabaseError(ScriptExecutionContext&, const String&)
     109static inline void logOpenDatabaseError(Document&, const String&)
    110110{
    111111}
     
    113113#else
    114114
    115 static void logOpenDatabaseError(ScriptExecutionContext& context, const String& name)
    116 {
    117     LOG(StorageAPI, "Database %s for origin %s not allowed to be established", name.utf8().data(), context.securityOrigin()->toString().utf8().data());
     115static void logOpenDatabaseError(Document& document, const String& name)
     116{
     117    LOG(StorageAPI, "Database %s for origin %s not allowed to be established", name.utf8().data(), document.securityOrigin().toString().utf8().data());
    118118}
    119119
    120120#endif
    121121
    122 ExceptionOr<Ref<Database>> DatabaseManager::openDatabaseBackend(ScriptExecutionContext& context, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, bool setVersionInNewDatabase)
    123 {
    124     auto backend = tryToOpenDatabaseBackend(context, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, FirstTryToOpenDatabase);
     122ExceptionOr<Ref<Database>> DatabaseManager::openDatabaseBackend(Document& document, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, bool setVersionInNewDatabase)
     123{
     124    auto backend = tryToOpenDatabaseBackend(document, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, FirstTryToOpenDatabase);
    125125
    126126    if (backend.hasException()) {
     
    130130            // one more try after if that is the case.
    131131            {
    132                 // FIXME: What guarantees context.securityOrigin() is non-null?
    133                 ProposedDatabase proposedDatabase { *this, *context.securityOrigin(), name, displayName, estimatedSize };
    134                 this->databaseContext(context)->databaseExceededQuota(name, proposedDatabase.details());
     132                ProposedDatabase proposedDatabase { *this, document.securityOrigin(), name, displayName, estimatedSize };
     133                this->databaseContext(document)->databaseExceededQuota(name, proposedDatabase.details());
    135134            }
    136             backend = tryToOpenDatabaseBackend(context, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, RetryOpenDatabase);
     135            backend = tryToOpenDatabaseBackend(document, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, RetryOpenDatabase);
    137136        }
    138137    }
     
    140139    if (backend.hasException()) {
    141140        if (backend.exception().code() == InvalidStateError)
    142             logErrorMessage(context, backend.exception().message());
     141            logErrorMessage(document, backend.exception().message());
    143142        else
    144             logOpenDatabaseError(context, name);
     143            logOpenDatabaseError(document, name);
    145144    }
    146145
     
    148147}
    149148
    150 ExceptionOr<Ref<Database>> DatabaseManager::tryToOpenDatabaseBackend(ScriptExecutionContext& scriptContext, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, bool setVersionInNewDatabase,
     149ExceptionOr<Ref<Database>> DatabaseManager::tryToOpenDatabaseBackend(Document& document, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, bool setVersionInNewDatabase,
    151150    OpenAttempt attempt)
    152151{
    153     if (is<Document>(&scriptContext)) {
    154         auto* page = downcast<Document>(scriptContext).page();
    155         if (!page || page->usesEphemeralSession())
    156             return Exception { SecurityError };
    157     }
    158 
    159     if (scriptContext.isWorkerGlobalScope()) {
    160         ASSERT_NOT_REACHED();
     152    auto* page = document.page();
     153    if (!page || page->usesEphemeralSession())
    161154        return Exception { SecurityError };
    162     }
    163 
    164     auto backendContext = this->databaseContext(scriptContext);
     155
     156    auto backendContext = this->databaseContext(document);
    165157
    166158    ExceptionOr<void> preflightResult;
     
    199191}
    200192
    201 ExceptionOr<Ref<Database>> DatabaseManager::openDatabase(ScriptExecutionContext& context, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, RefPtr<DatabaseCallback>&& creationCallback)
     193ExceptionOr<Ref<Database>> DatabaseManager::openDatabase(Document& document, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, RefPtr<DatabaseCallback>&& creationCallback)
    202194{
    203195    ScriptController::initializeThreading();
    204196
    205197    bool setVersionInNewDatabase = !creationCallback;
    206     auto openResult = openDatabaseBackend(context, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase);
     198    auto openResult = openDatabaseBackend(document, name, expectedVersion, displayName, estimatedSize, setVersionInNewDatabase);
    207199    if (openResult.hasException())
    208200        return openResult.releaseException();
     
    210202    RefPtr<Database> database = openResult.releaseReturnValue();
    211203
    212     auto databaseContext = this->databaseContext(context);
     204    auto databaseContext = this->databaseContext(document);
    213205    databaseContext->setHasOpenDatabases();
    214206    InspectorInstrumentation::didOpenDatabase(*database);
     
    217209        LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database.get());
    218210        database->setHasPendingCreationEvent(true);
    219         database->m_scriptExecutionContext->postTask([creationCallback, database] (ScriptExecutionContext&) {
     211        database->m_document->postTask([creationCallback, database] (ScriptExecutionContext&) {
    220212            creationCallback->handleEvent(*database);
    221213            database->setHasPendingCreationEvent(false);
     
    226218}
    227219
    228 bool DatabaseManager::hasOpenDatabases(ScriptExecutionContext& context)
    229 {
    230     auto databaseContext = context.databaseContext();
     220bool DatabaseManager::hasOpenDatabases(Document& document)
     221{
     222    auto databaseContext = document.databaseContext();
    231223    return databaseContext && databaseContext->hasOpenDatabases();
    232224}
    233225
    234 void DatabaseManager::stopDatabases(ScriptExecutionContext& context, DatabaseTaskSynchronizer* synchronizer)
    235 {
    236     auto databaseContext = context.databaseContext();
     226void DatabaseManager::stopDatabases(Document& document, DatabaseTaskSynchronizer* synchronizer)
     227{
     228    auto databaseContext = document.databaseContext();
    237229    if (!databaseContext || !databaseContext->stopDatabases(synchronizer)) {
    238230        if (synchronizer)
     
    268260}
    269261
    270 void DatabaseManager::logErrorMessage(ScriptExecutionContext& context, const String& message)
    271 {
    272     context.addConsoleMessage(MessageSource::Storage, MessageLevel::Error, message);
     262void DatabaseManager::logErrorMessage(Document& document, const String& message)
     263{
     264    document.addConsoleMessage(MessageSource::Storage, MessageLevel::Error, message);
    273265}
    274266
  • trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.h

    r233487 r247219  
    3939class DatabaseManagerClient;
    4040class DatabaseTaskSynchronizer;
     41class Document;
    4142class Exception;
    4243class SecurityOrigin;
    43 class ScriptExecutionContext;
    4444struct SecurityOriginData;
    4545
     
    5656    WEBCORE_EXPORT void setIsAvailable(bool);
    5757
    58     // This gets a DatabaseContext for the specified ScriptExecutionContext.
     58    // This gets a DatabaseContext for the specified Document.
    5959    // If one doesn't already exist, it will create a new one.
    60     Ref<DatabaseContext> databaseContext(ScriptExecutionContext&);
     60    Ref<DatabaseContext> databaseContext(Document&);
    6161
    62     ExceptionOr<Ref<Database>> openDatabase(ScriptExecutionContext&, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, RefPtr<DatabaseCallback>&&);
     62    ExceptionOr<Ref<Database>> openDatabase(Document&, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, RefPtr<DatabaseCallback>&&);
    6363
    64     WEBCORE_EXPORT bool hasOpenDatabases(ScriptExecutionContext&);
    65     void stopDatabases(ScriptExecutionContext&, DatabaseTaskSynchronizer*);
     64    WEBCORE_EXPORT bool hasOpenDatabases(Document&);
     65    void stopDatabases(Document&, DatabaseTaskSynchronizer*);
    6666
    6767    WEBCORE_EXPORT String fullPathForDatabase(SecurityOrigin&, const String& name, bool createIfDoesNotExist = true);
     
    7676
    7777    enum OpenAttempt { FirstTryToOpenDatabase, RetryOpenDatabase };
    78     ExceptionOr<Ref<Database>> openDatabaseBackend(ScriptExecutionContext&, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, bool setVersionInNewDatabase);
    79     ExceptionOr<Ref<Database>> tryToOpenDatabaseBackend(ScriptExecutionContext&, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, bool setVersionInNewDatabase, OpenAttempt);
     78    ExceptionOr<Ref<Database>> openDatabaseBackend(Document&, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, bool setVersionInNewDatabase);
     79    ExceptionOr<Ref<Database>> tryToOpenDatabaseBackend(Document&, const String& name, const String& expectedVersion, const String& displayName, unsigned estimatedSize, bool setVersionInNewDatabase, OpenAttempt);
    8080
    8181    class ProposedDatabase;
     
    8383    void removeProposedDatabase(ProposedDatabase&);
    8484
    85     static void logErrorMessage(ScriptExecutionContext&, const String& message);
     85    static void logErrorMessage(Document&, const String& message);
    8686
    8787    DatabaseManagerClient* m_client { nullptr };
  • trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp

    r239535 r247219  
    3030
    3131#include "Database.h"
     32#include "Document.h"
    3233#include "Logging.h"
    3334#include "SQLError.h"
     
    7879    : m_statement(statement.isolatedCopy())
    7980    , m_arguments(WTFMove(arguments))
    80     , m_statementCallbackWrapper(WTFMove(callback), &database.scriptExecutionContext())
    81     , m_statementErrorCallbackWrapper(WTFMove(errorCallback), &database.scriptExecutionContext())
     81    , m_statementCallbackWrapper(WTFMove(callback), &database.document())
     82    , m_statementErrorCallbackWrapper(WTFMove(errorCallback), &database.document())
    8283    , m_permissions(permissions)
    8384{
  • trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp

    r242776 r247219  
    3535#include "DatabaseThread.h"
    3636#include "DatabaseTracker.h"
     37#include "Document.h"
    3738#include "Logging.h"
    3839#include "OriginLock.h"
     
    6061SQLTransaction::SQLTransaction(Ref<Database>&& database, RefPtr<SQLTransactionCallback>&& callback, RefPtr<VoidCallback>&& successCallback, RefPtr<SQLTransactionErrorCallback>&& errorCallback, RefPtr<SQLTransactionWrapper>&& wrapper, bool readOnly)
    6162    : m_database(WTFMove(database))
    62     , m_callbackWrapper(WTFMove(callback), &m_database->scriptExecutionContext())
    63     , m_successCallbackWrapper(WTFMove(successCallback), &m_database->scriptExecutionContext())
    64     , m_errorCallbackWrapper(WTFMove(errorCallback), &m_database->scriptExecutionContext())
     63    , m_callbackWrapper(WTFMove(callback), &m_database->document())
     64    , m_successCallbackWrapper(WTFMove(successCallback), &m_database->document())
     65    , m_errorCallbackWrapper(WTFMove(errorCallback), &m_database->document())
    6566    , m_wrapper(WTFMove(wrapper))
    6667    , m_nextStep(&SQLTransaction::acquireLock)
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r246876 r247219  
    12021202{
    12031203    FAST_RETURN_IF_NO_FRONTENDS(void());
    1204     if (auto* instrumentingAgents = instrumentingAgentsForContext(database.scriptExecutionContext()))
     1204    if (auto* instrumentingAgents = instrumentingAgentsForContext(database.document()))
    12051205        didOpenDatabaseImpl(*instrumentingAgents, database);
    12061206}
  • trunk/Source/WebCore/inspector/agents/InspectorDatabaseAgent.cpp

    r243219 r247219  
    279279    }
    280280
    281     database->transaction(TransactionCallback::create(&database->scriptExecutionContext(), query, requestCallback.copyRef()),
    282         TransactionErrorCallback::create(&database->scriptExecutionContext(), requestCallback.copyRef()),
    283         TransactionSuccessCallback::create(&database->scriptExecutionContext()));
     281    database->transaction(TransactionCallback::create(&database->document(), query, requestCallback.copyRef()),
     282        TransactionErrorCallback::create(&database->document(), requestCallback.copyRef()),
     283        TransactionSuccessCallback::create(&database->document()));
    284284}
    285285
Note: See TracChangeset for help on using the changeset viewer.