diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/webdatabase')
33 files changed, 105 insertions, 86 deletions
diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/DEPS b/chromium/third_party/blink/renderer/modules/webdatabase/DEPS index 4d65cedbcd8..0d01ddacadd 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/DEPS +++ b/chromium/third_party/blink/renderer/modules/webdatabase/DEPS @@ -1,7 +1,6 @@ include_rules = [ "+base/files/file.h", "+base/task/task_traits.h", - "+mojo/public/cpp/bindings/strong_binding.h", "-third_party/blink/renderer/modules", "+third_party/blink/renderer/modules/modules_export.h", "+third_party/blink/renderer/modules/webdatabase", diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database.cc b/chromium/third_party/blink/renderer/modules/webdatabase/database.cc index a7c8d8a1018..2f617dd4aa6 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database.cc @@ -51,6 +51,7 @@ #include "third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_transaction.h" #include "third_party/blink/renderer/modules/webdatabase/storage_log.h" #include "third_party/blink/renderer/modules/webdatabase/web_database_host.h" +#include "third_party/blink/renderer/platform/heap/heap.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" @@ -269,7 +270,7 @@ Database::~Database() { DCHECK(!Opened()); } -void Database::Trace(blink::Visitor* visitor) { +void Database::Trace(Visitor* visitor) { visitor->Trace(database_context_); ScriptWrappable::Trace(visitor); } @@ -746,9 +747,9 @@ void Database::ReportSqliteError(int sqlite_error_code) { } void Database::LogErrorMessage(const String& message) { - GetExecutionContext()->AddConsoleMessage( - ConsoleMessage::Create(mojom::ConsoleMessageSource::kStorage, - mojom::ConsoleMessageLevel::kError, message)); + GetExecutionContext()->AddConsoleMessage(MakeGarbageCollected<ConsoleMessage>( + mojom::ConsoleMessageSource::kStorage, mojom::ConsoleMessageLevel::kError, + message)); } ExecutionContext* Database::GetExecutionContext() const { diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database.h b/chromium/third_party/blink/renderer/modules/webdatabase/database.h index d9563c6ca28..4c51c655b2a 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database.h @@ -59,7 +59,7 @@ class Database final : public ScriptWrappable { const String& display_name, uint32_t estimated_size); ~Database() override; - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; bool OpenAndVerifyVersion(bool set_version_in_new_database, DatabaseError&, diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database.idl b/chromium/third_party/blink/renderer/modules/webdatabase/database.idl index 7b03a4cf639..b9a96a6ccbc 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database.idl +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database.idl @@ -33,11 +33,11 @@ readonly attribute DOMString version; // TODO(crbug.com/841185): |callback|, |errorCallback|, and // |successCallback| are not nullable in the spec. - [Measure] void changeVersion(DOMString oldVersion, DOMString newVersion, optional SQLTransactionCallback? callback, optional SQLTransactionErrorCallback? errorCallback, optional VoidCallback? successCallback); + [Measure] void changeVersion(DOMString oldVersion, DOMString newVersion, optional SQLTransactionCallback? callback = null, optional SQLTransactionErrorCallback? errorCallback = null, optional VoidCallback? successCallback = null); // TODO(crbug.com/841185): |errorCallback| and |successCallback| are not // nullable in the spec. - [Measure] void transaction(SQLTransactionCallback callback, optional SQLTransactionErrorCallback? errorCallback, optional VoidCallback? successCallback); + [Measure] void transaction(SQLTransactionCallback callback, optional SQLTransactionErrorCallback? errorCallback = null, optional VoidCallback? successCallback = null); // TODO(crbug.com/841185): |errorCallback| and |successCallback| are not // nullable in the spec. - [Measure] void readTransaction(SQLTransactionCallback callback, optional SQLTransactionErrorCallback? errorCallback, optional VoidCallback? successCallback); + [Measure] void readTransaction(SQLTransactionCallback callback, optional SQLTransactionErrorCallback? errorCallback = null, optional VoidCallback? successCallback = null); }; diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database_authorizer.cc b/chromium/third_party/blink/renderer/modules/webdatabase/database_authorizer.cc index 21c8f66d0fe..ad57dc43fdd 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database_authorizer.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database_authorizer.cc @@ -339,13 +339,13 @@ int DatabaseAuthorizer::DenyBasedOnTableName(const String& table_name) const { // Sadly, normal creates and drops end up affecting sqlite_master in an // authorizer callback, so it will be tough to enforce all of the following // policies: - // if (equalIgnoringCase(tableName, "sqlite_master") || - // equalIgnoringCase(tableName, "sqlite_temp_master") || - // equalIgnoringCase(tableName, "sqlite_sequence") || - // equalIgnoringCase(tableName, Database::databaseInfoTableName())) + // if (EqualIgnoringASCIICase(table_name, "sqlite_master") || + // EqualIgnoringASCIICase(table_name, "sqlite_temp_master") || + // EqualIgnoringASCIICase(table_name, "sqlite_sequence") || + // EqualIgnoringASCIICase(table_name, database_info_table_name_)) // return SQLAuthDeny; - if (DeprecatedEqualIgnoringCase(table_name, database_info_table_name_)) + if (EqualIgnoringASCIICase(table_name, database_info_table_name_)) return kSQLAuthDeny; return kSQLAuthAllow; diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database_client.cc b/chromium/third_party/blink/renderer/modules/webdatabase/database_client.cc index 5b0a433b932..d3cd7b99bc9 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database_client.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database_client.cc @@ -41,7 +41,7 @@ namespace blink { DatabaseClient::DatabaseClient() : inspector_agent_(nullptr) {} -void DatabaseClient::Trace(blink::Visitor* visitor) { +void DatabaseClient::Trace(Visitor* visitor) { visitor->Trace(inspector_agent_); Supplement<Page>::Trace(visitor); } @@ -51,14 +51,14 @@ DatabaseClient* DatabaseClient::FromPage(Page* page) { } DatabaseClient* DatabaseClient::From(ExecutionContext* context) { - return DatabaseClient::FromPage(To<Document>(context)->GetPage()); + return DatabaseClient::FromPage(Document::From(context)->GetPage()); } const char DatabaseClient::kSupplementName[] = "DatabaseClient"; bool DatabaseClient::AllowDatabase(ExecutionContext* context) { DCHECK(context->IsContextThread()); - Document* document = To<Document>(context); + Document* document = Document::From(context); if (auto* client = document->GetFrame()->GetContentSettingsClient()) return client->AllowDatabase(); return true; diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database_client.h b/chromium/third_party/blink/renderer/modules/webdatabase/database_client.h index 583f4f529c0..a365f41fd4e 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database_client.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database_client.h @@ -54,7 +54,7 @@ class MODULES_EXPORT DatabaseClient : public GarbageCollected<DatabaseClient>, DatabaseClient(); - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; bool AllowDatabase(ExecutionContext*); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database_context.cc b/chromium/third_party/blink/renderer/modules/webdatabase/database_context.cc index a77f1304e75..a026b224bd7 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database_context.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database_context.cc @@ -69,8 +69,8 @@ namespace blink { // 1. "outlive" the ExecutionContext. // - This is needed because the DatabaseContext needs to remove itself from // the -// ExecutionContext's ContextLifecycleObserver list and -// ContextLifecycleObserver +// ExecutionContext's ExecutionContextLifecycleObserver list and +// ExecutionContextLifecycleObserver // list. This removal needs to be executed on the script's thread. Hence, // we // rely on the ExecutionContext's shutdown process to call @@ -99,7 +99,7 @@ DatabaseContext* DatabaseContext::Create(ExecutionContext* context) { } DatabaseContext::DatabaseContext(ExecutionContext* context) - : ContextLifecycleObserver(context), + : ExecutionContextLifecycleObserver(context), has_open_databases_(false), has_requested_termination_(false) { DCHECK(IsMainThread()); @@ -115,9 +115,9 @@ DatabaseContext::~DatabaseContext() { DatabaseManager::Manager().DidDestructDatabaseContext(); } -void DatabaseContext::Trace(blink::Visitor* visitor) { +void DatabaseContext::Trace(Visitor* visitor) { visitor->Trace(database_thread_); - ContextLifecycleObserver::Trace(visitor); + ExecutionContextLifecycleObserver::Trace(visitor); } // This is called if the associated ExecutionContext is destructing while @@ -125,7 +125,7 @@ void DatabaseContext::Trace(blink::Visitor* visitor) { // To do this, we stop the database and let everything shutdown naturally // because the database closing process may still make use of this context. // It is not safe to just delete the context here. -void DatabaseContext::ContextDestroyed(ExecutionContext*) { +void DatabaseContext::ContextDestroyed() { StopDatabases(); DatabaseManager::Manager().UnregisterDatabaseContext(this); } @@ -175,7 +175,7 @@ void DatabaseContext::StopDatabases() { } bool DatabaseContext::AllowDatabaseAccess() const { - return To<Document>(GetExecutionContext())->IsActive(); + return Document::From(GetExecutionContext())->IsActive(); } const SecurityOrigin* DatabaseContext::GetSecurityOrigin() const { diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database_context.h b/chromium/third_party/blink/renderer/modules/webdatabase/database_context.h index cb56a462f5d..ec86707519d 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database_context.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database_context.h @@ -28,7 +28,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBDATABASE_DATABASE_CONTEXT_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBDATABASE_DATABASE_CONTEXT_H_ -#include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h" +#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" #include "third_party/blink/renderer/platform/heap/handle.h" namespace blink { @@ -39,7 +39,7 @@ class ExecutionContext; class SecurityOrigin; class DatabaseContext final : public GarbageCollected<DatabaseContext>, - public ContextLifecycleObserver { + public ExecutionContextLifecycleObserver { USING_GARBAGE_COLLECTED_MIXIN(DatabaseContext); public: @@ -49,10 +49,11 @@ class DatabaseContext final : public GarbageCollected<DatabaseContext>, explicit DatabaseContext(ExecutionContext*); ~DatabaseContext(); - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; - // For life-cycle management (inherited from ContextLifecycleObserver): - void ContextDestroyed(ExecutionContext*) override; + // For life-cycle management (inherited from + // ExecutionContextLifecycleObserver): + void ContextDestroyed() override; DatabaseContext* Backend(); DatabaseThread* GetDatabaseThread(); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database_manager.cc b/chromium/third_party/blink/renderer/modules/webdatabase/database_manager.cc index 7c9b9ade610..af523812951 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database_manager.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database_manager.cc @@ -36,6 +36,7 @@ #include "third_party/blink/renderer/modules/webdatabase/database_tracker.h" #include "third_party/blink/renderer/modules/webdatabase/storage_log.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" +#include "third_party/blink/renderer/platform/heap/heap.h" #include "third_party/blink/renderer/platform/weborigin/security_origin.h" namespace blink { @@ -199,9 +200,9 @@ String DatabaseManager::FullPathForDatabase(const SecurityOrigin* origin, void DatabaseManager::LogErrorMessage(ExecutionContext* context, const String& message) { - context->AddConsoleMessage( - ConsoleMessage::Create(mojom::ConsoleMessageSource::kStorage, - mojom::ConsoleMessageLevel::kError, message)); + context->AddConsoleMessage(MakeGarbageCollected<ConsoleMessage>( + mojom::ConsoleMessageSource::kStorage, mojom::ConsoleMessageLevel::kError, + message)); } } // namespace blink diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database_thread.cc b/chromium/third_party/blink/renderer/modules/webdatabase/database_thread.cc index 1fb21e72feb..f2f35ff8091 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database_thread.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database_thread.cc @@ -53,7 +53,7 @@ DatabaseThread::~DatabaseThread() { DCHECK(!thread_); } -void DatabaseThread::Trace(blink::Visitor* visitor) {} +void DatabaseThread::Trace(Visitor* visitor) {} void DatabaseThread::Start() { DCHECK(IsMainThread()); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database_thread.h b/chromium/third_party/blink/renderer/modules/webdatabase/database_thread.h index 3f5faf80f52..5fc1d1919f2 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database_thread.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database_thread.h @@ -47,7 +47,7 @@ class DatabaseThread final : public GarbageCollected<DatabaseThread> { public: DatabaseThread(); ~DatabaseThread(); - void Trace(blink::Visitor*); + void Trace(Visitor*); // Callable only from the main thread. void Start(); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/database_tracker.cc b/chromium/third_party/blink/renderer/modules/webdatabase/database_tracker.cc index b19c0bd7a94..e9261a38ea6 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/database_tracker.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/database_tracker.cc @@ -203,7 +203,7 @@ void DatabaseTracker::ForEachOpenDatabaseInPage(Page* page, for (auto& name_database_set : *origin_map.value) { for (Database* database : *name_database_set.value) { ExecutionContext* context = database->GetExecutionContext(); - if (To<Document>(context)->GetPage() == page) + if (Document::From(context)->GetPage() == page) callback.Run(database); } } diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/dom_window_web_database.cc b/chromium/third_party/blink/renderer/modules/webdatabase/dom_window_web_database.cc index 125012edd3b..fdefa087ee4 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/dom_window_web_database.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/dom_window_web_database.cc @@ -69,9 +69,9 @@ Database* DOMWindowWebDatabase::openDatabase( UseCounter::Count(window.document(), WebFeature::kFileAccessedDatabase); String error_message; - database = db_manager.OpenDatabase(window.document(), name, version, - display_name, estimated_size, - creation_callback, error, error_message); + database = db_manager.OpenDatabase( + window.document()->ToExecutionContext(), name, version, display_name, + estimated_size, creation_callback, error, error_message); DCHECK(database || error != DatabaseError::kNone); if (error != DatabaseError::kNone) DatabaseManager::ThrowExceptionForDatabaseError(error, error_message, diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/idls.gni b/chromium/third_party/blink/renderer/modules/webdatabase/idls.gni new file mode 100644 index 00000000000..3877456b354 --- /dev/null +++ b/chromium/third_party/blink/renderer/modules/webdatabase/idls.gni @@ -0,0 +1,17 @@ +# Copyright 2020 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +modules_idl_files = [ + "database.idl", + "sql_error.idl", + "sql_result_set.idl", + "sql_result_set_row_list.idl", + "sql_statement_callback.idl", + "sql_statement_error_callback.idl", + "sql_transaction.idl", + "sql_transaction_callback.idl", + "sql_transaction_error_callback.idl", +] + +modules_dependency_idl_files = [ "window_web_database.idl" ] diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.cc b/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.cc index 01d716fe2e1..8f15d7530af 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.cc @@ -235,20 +235,20 @@ void InspectorDatabaseAgent::InnerEnable() { Response InspectorDatabaseAgent::enable() { if (enabled_.Get()) - return Response::OK(); + return Response::Success(); enabled_.Set(true); InnerEnable(); - return Response::OK(); + return Response::Success(); } Response InspectorDatabaseAgent::disable() { if (!enabled_.Get()) - return Response::OK(); + return Response::Success(); enabled_.Set(false); if (DatabaseClient* client = DatabaseClient::FromPage(page_)) client->SetInspectorAgent(nullptr); resources_.clear(); - return Response::OK(); + return Response::Success(); } void InspectorDatabaseAgent::Restore() { @@ -260,7 +260,7 @@ Response InspectorDatabaseAgent::getDatabaseTableNames( const String& database_id, std::unique_ptr<protocol::Array<String>>* names) { if (!enabled_.Get()) - return Response::Error("Database agent is not enabled"); + return Response::ServerError("Database agent is not enabled"); blink::Database* database = DatabaseForId(database_id); if (database) { @@ -270,7 +270,7 @@ Response InspectorDatabaseAgent::getDatabaseTableNames( } else { *names = std::make_unique<protocol::Array<String>>(); } - return Response::OK(); + return Response::Success(); } void InspectorDatabaseAgent::executeSQL( @@ -282,13 +282,13 @@ void InspectorDatabaseAgent::executeSQL( if (!enabled_.Get()) { request_callback->sendFailure( - Response::Error("Database agent is not enabled")); + Response::ServerError("Database agent is not enabled")); return; } blink::Database* database = DatabaseForId(database_id); if (!database) { - request_callback->sendFailure(Response::Error("Database not found")); + request_callback->sendFailure(Response::ServerError("Database not found")); return; } @@ -319,7 +319,7 @@ blink::Database* InspectorDatabaseAgent::DatabaseForId( return it->value->GetDatabase(); } -void InspectorDatabaseAgent::Trace(blink::Visitor* visitor) { +void InspectorDatabaseAgent::Trace(Visitor* visitor) { visitor->Trace(page_); visitor->Trace(resources_); InspectorBaseAgent::Trace(visitor); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.h b/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.h index 9b9e502bff4..ac8b61500ab 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_agent.h @@ -48,7 +48,7 @@ class MODULES_EXPORT InspectorDatabaseAgent final public: explicit InspectorDatabaseAgent(Page*); ~InspectorDatabaseAgent() override; - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; protocol::Response disable() override; void Restore() override; diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_resource.cc b/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_resource.cc index 8926d251f48..99adeecae35 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_resource.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_resource.cc @@ -46,7 +46,7 @@ InspectorDatabaseResource::InspectorDatabaseResource(Database* database, name_(name), version_(version) {} -void InspectorDatabaseResource::Trace(blink::Visitor* visitor) { +void InspectorDatabaseResource::Trace(Visitor* visitor) { visitor->Trace(database_); } diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_resource.h b/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_resource.h index 19490afaa05..942e78c55f9 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_resource.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/inspector_database_resource.h @@ -46,7 +46,7 @@ class InspectorDatabaseResource final const String& domain, const String& name, const String& version); - void Trace(blink::Visitor*); + void Trace(Visitor*); void Bind(protocol::Database::Frontend*); Database* GetDatabase() { return database_.Get(); } diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_result_set.cc b/chromium/third_party/blink/renderer/modules/webdatabase/sql_result_set.cc index b9741826656..4a5cc455390 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_result_set.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_result_set.cc @@ -42,7 +42,7 @@ SQLResultSet::SQLResultSet() DCHECK(IsMainThread()); } -void SQLResultSet::Trace(blink::Visitor* visitor) { +void SQLResultSet::Trace(Visitor* visitor) { visitor->Trace(rows_); ScriptWrappable::Trace(visitor); } diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_result_set.h b/chromium/third_party/blink/renderer/modules/webdatabase/sql_result_set.h index 5afa63aed05..12d6155180f 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_result_set.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_result_set.h @@ -43,7 +43,7 @@ class SQLResultSet final : public ScriptWrappable { public: SQLResultSet(); - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; SQLResultSetRowList* rows() const; diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement.cc b/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement.cc index c5a0fcec3e7..d0b2a1f4d71 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement.cc @@ -41,7 +41,7 @@ namespace blink { -void SQLStatement::OnSuccessV8Impl::Trace(blink::Visitor* visitor) { +void SQLStatement::OnSuccessV8Impl::Trace(Visitor* visitor) { visitor->Trace(callback_); OnSuccessCallback::Trace(visitor); } @@ -56,7 +56,7 @@ bool SQLStatement::OnSuccessV8Impl::OnSuccess(SQLTransaction* transaction, return callback_->handleEvent(nullptr, transaction, result_set).IsJust(); } -void SQLStatement::OnErrorV8Impl::Trace(blink::Visitor* visitor) { +void SQLStatement::OnErrorV8Impl::Trace(Visitor* visitor) { visitor->Trace(callback_); OnErrorCallback::Trace(visitor); } @@ -94,7 +94,7 @@ SQLStatement::SQLStatement(Database* database, } } -void SQLStatement::Trace(blink::Visitor* visitor) { +void SQLStatement::Trace(Visitor* visitor) { visitor->Trace(backend_); visitor->Trace(success_callback_); visitor->Trace(error_callback_); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement.h b/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement.h index dfe45739142..5bae74b432a 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement.h @@ -48,7 +48,7 @@ class SQLStatement final : public GarbageCollected<SQLStatement> { class OnSuccessCallback : public GarbageCollected<OnSuccessCallback> { public: virtual ~OnSuccessCallback() = default; - virtual void Trace(blink::Visitor*) {} + virtual void Trace(Visitor*) {} virtual bool OnSuccess(SQLTransaction*, SQLResultSet*) = 0; protected: @@ -65,7 +65,7 @@ class SQLStatement final : public GarbageCollected<SQLStatement> { explicit OnSuccessV8Impl(V8SQLStatementCallback* callback) : callback_(callback) {} - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; bool OnSuccess(SQLTransaction*, SQLResultSet*) override; private: @@ -75,7 +75,7 @@ class SQLStatement final : public GarbageCollected<SQLStatement> { class OnErrorCallback : public GarbageCollected<OnErrorCallback> { public: virtual ~OnErrorCallback() = default; - virtual void Trace(blink::Visitor*) {} + virtual void Trace(Visitor*) {} virtual bool OnError(SQLTransaction*, SQLError*) = 0; protected: @@ -91,7 +91,7 @@ class SQLStatement final : public GarbageCollected<SQLStatement> { explicit OnErrorV8Impl(V8SQLStatementErrorCallback* callback) : callback_(callback) {} - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; bool OnError(SQLTransaction*, SQLError*) override; private: @@ -102,7 +102,7 @@ class SQLStatement final : public GarbageCollected<SQLStatement> { SQLStatement(Database*, OnSuccessCallback*, OnErrorCallback*); - void Trace(blink::Visitor*); + void Trace(Visitor*); bool PerformCallback(SQLTransaction*); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement_backend.cc b/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement_backend.cc index 7110120b3e6..9dbfb876585 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement_backend.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement_backend.cc @@ -97,7 +97,7 @@ SQLStatementBackend::SQLStatementBackend(SQLStatement* frontend, frontend_->SetBackend(this); } -void SQLStatementBackend::Trace(blink::Visitor* visitor) { +void SQLStatementBackend::Trace(Visitor* visitor) { visitor->Trace(frontend_); visitor->Trace(result_set_); } diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement_backend.h b/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement_backend.h index 788633e4a14..96fe7ac6d2e 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement_backend.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_statement_backend.h @@ -49,7 +49,7 @@ class SQLStatementBackend final : public GarbageCollected<SQLStatementBackend> { const Vector<SQLValue>& arguments, int permissions); - void Trace(blink::Visitor*); + void Trace(Visitor*); bool Execute(Database*); bool LastExecutionFailedDueToQuota() const; diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.cc b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.cc index 776d50e2724..b1a68bc895d 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.cc @@ -44,7 +44,7 @@ namespace blink { -void SQLTransaction::OnProcessV8Impl::Trace(blink::Visitor* visitor) { +void SQLTransaction::OnProcessV8Impl::Trace(Visitor* visitor) { visitor->Trace(callback_); OnProcessCallback::Trace(visitor); } @@ -58,7 +58,7 @@ bool SQLTransaction::OnProcessV8Impl::OnProcess(SQLTransaction* transaction) { return callback_->handleEvent(nullptr, transaction).IsJust(); } -void SQLTransaction::OnSuccessV8Impl::Trace(blink::Visitor* visitor) { +void SQLTransaction::OnSuccessV8Impl::Trace(Visitor* visitor) { visitor->Trace(callback_); OnSuccessCallback::Trace(visitor); } @@ -67,7 +67,7 @@ void SQLTransaction::OnSuccessV8Impl::OnSuccess() { callback_->InvokeAndReportException(nullptr); } -void SQLTransaction::OnErrorV8Impl::Trace(blink::Visitor* visitor) { +void SQLTransaction::OnErrorV8Impl::Trace(Visitor* visitor) { visitor->Trace(callback_); OnErrorCallback::Trace(visitor); } @@ -109,7 +109,7 @@ SQLTransaction::SQLTransaction(Database* db, SQLTransaction::~SQLTransaction() = default; -void SQLTransaction::Trace(blink::Visitor* visitor) { +void SQLTransaction::Trace(Visitor* visitor) { visitor->Trace(database_); visitor->Trace(backend_); visitor->Trace(callback_); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.h b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.h index 74d99c733fe..3ee9e458216 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.h @@ -59,7 +59,7 @@ class SQLTransaction final : public ScriptWrappable, class OnProcessCallback : public GarbageCollected<OnProcessCallback> { public: virtual ~OnProcessCallback() = default; - virtual void Trace(blink::Visitor*) {} + virtual void Trace(Visitor*) {} virtual bool OnProcess(SQLTransaction*) = 0; protected: @@ -76,7 +76,7 @@ class SQLTransaction final : public ScriptWrappable, explicit OnProcessV8Impl(V8SQLTransactionCallback* callback) : callback_(callback) {} - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; bool OnProcess(SQLTransaction*) override; private: @@ -86,7 +86,7 @@ class SQLTransaction final : public ScriptWrappable, class OnSuccessCallback : public GarbageCollected<OnSuccessCallback> { public: virtual ~OnSuccessCallback() = default; - virtual void Trace(blink::Visitor*) {} + virtual void Trace(Visitor*) {} virtual void OnSuccess() = 0; protected: @@ -102,7 +102,7 @@ class SQLTransaction final : public ScriptWrappable, explicit OnSuccessV8Impl(V8VoidCallback* callback) : callback_(callback) {} - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; void OnSuccess() override; private: @@ -112,7 +112,7 @@ class SQLTransaction final : public ScriptWrappable, class OnErrorCallback : public GarbageCollected<OnErrorCallback> { public: virtual ~OnErrorCallback() = default; - virtual void Trace(blink::Visitor*) {} + virtual void Trace(Visitor*) {} virtual bool OnError(SQLError*) = 0; protected: @@ -128,7 +128,7 @@ class SQLTransaction final : public ScriptWrappable, explicit OnErrorV8Impl(V8SQLTransactionErrorCallback* callback) : callback_(callback) {} - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; bool OnError(SQLError*) override; private: @@ -147,7 +147,7 @@ class SQLTransaction final : public ScriptWrappable, OnErrorCallback*, bool read_only); ~SQLTransaction() override; - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; void PerformPendingCallback(); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.idl b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.idl index b116ce496c2..01ca792addd 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.idl +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction.idl @@ -39,6 +39,6 @@ typedef sequence<any> ObjectArray; // nullable in the spec. [Measure, RaisesException, CallWith=ScriptState] void executeSql(DOMString sqlStatement, optional ObjectArray? arguments, - optional SQLStatementCallback? callback, - optional SQLStatementErrorCallback? errorCallback); + optional SQLStatementCallback? callback = null, + optional SQLStatementErrorCallback? errorCallback = null); }; diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_backend.cc b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_backend.cc index b71b5f50c60..24dfe898d33 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_backend.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_backend.cc @@ -391,7 +391,7 @@ SQLTransactionBackend::~SQLTransactionBackend() { DCHECK(!sqlite_transaction_); } -void SQLTransactionBackend::Trace(blink::Visitor* visitor) { +void SQLTransactionBackend::Trace(Visitor* visitor) { visitor->Trace(wrapper_); } diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_backend.h b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_backend.h index 8c82b2eeb08..aa5b1fbd5b6 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_backend.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_backend.h @@ -50,7 +50,7 @@ class SQLValue; class SQLTransactionWrapper : public GarbageCollected<SQLTransactionWrapper> { public: virtual ~SQLTransactionWrapper() = default; - virtual void Trace(blink::Visitor* visitor) {} + virtual void Trace(Visitor* visitor) {} virtual bool PerformPreflight(SQLTransactionBackend*) = 0; virtual bool PerformPostflight(SQLTransactionBackend*) = 0; virtual SQLErrorData* SqlError() const = 0; @@ -66,7 +66,7 @@ class SQLTransactionBackend final SQLTransactionWrapper*, bool read_only); ~SQLTransactionBackend() override; - void Trace(blink::Visitor*); + void Trace(Visitor*); void LockAcquired(); void PerformNextStep(); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_coordinator.cc b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_coordinator.cc index 8298bddcbef..0be02921b2b 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_coordinator.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_coordinator.cc @@ -45,7 +45,7 @@ static String GetDatabaseIdentifier(SQLTransactionBackend* transaction) { SQLTransactionCoordinator::SQLTransactionCoordinator() : is_shutting_down_(false) {} -void SQLTransactionCoordinator::Trace(blink::Visitor* visitor) {} +void SQLTransactionCoordinator::Trace(Visitor* visitor) {} void SQLTransactionCoordinator::ProcessPendingTransactions( CoordinationInfo& info) { diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_coordinator.h b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_coordinator.h index 593bc5b3293..823da7e53bc 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_coordinator.h +++ b/chromium/third_party/blink/renderer/modules/webdatabase/sql_transaction_coordinator.h @@ -48,7 +48,7 @@ class SQLTransactionCoordinator final : public GarbageCollected<SQLTransactionCoordinator> { public: SQLTransactionCoordinator(); - void Trace(blink::Visitor*); + void Trace(Visitor*); void AcquireLock(SQLTransactionBackend*); void ReleaseLock(SQLTransactionBackend*); void Shutdown(); diff --git a/chromium/third_party/blink/renderer/modules/webdatabase/web_database_host.cc b/chromium/third_party/blink/renderer/modules/webdatabase/web_database_host.cc index 1d7c1ef91ce..d3615747f14 100644 --- a/chromium/third_party/blink/renderer/modules/webdatabase/web_database_host.cc +++ b/chromium/third_party/blink/renderer/modules/webdatabase/web_database_host.cc @@ -9,8 +9,9 @@ #include "base/single_thread_task_runner.h" #include "base/task/post_task.h" #include "base/task/task_traits.h" +#include "base/task/thread_pool.h" +#include "third_party/blink/public/common/thread_safe_browser_interface_broker_proxy.h" #include "third_party/blink/public/mojom/webdatabase/web_database.mojom-blink.h" -#include "third_party/blink/public/platform/interface_provider.h" #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/renderer/platform/scheduler/main_thread/main_thread.h" #include "third_party/blink/renderer/platform/weborigin/security_origin.h" @@ -27,7 +28,7 @@ WebDatabaseHost& WebDatabaseHost::GetInstance() { } void WebDatabaseHost::Init() { - Platform::Current()->GetInterfaceProvider()->GetInterface( + Platform::Current()->GetBrowserInterfaceBroker()->GetInterface( pending_remote_.InitWithNewPipeAndPassReceiver()); } @@ -38,9 +39,8 @@ mojom::blink::WebDatabaseHost& WebDatabaseHost::GetWebDatabaseHost() { if (!shared_remote_) { DCHECK(pending_remote_); shared_remote_ = mojo::SharedRemote<mojom::blink::WebDatabaseHost>( - std::move(pending_remote_), - base::CreateSequencedTaskRunner( - {base::ThreadPool(), base::WithBaseSyncPrimitives()})); + std::move(pending_remote_), base::ThreadPool::CreateSequencedTaskRunner( + {base::WithBaseSyncPrimitives()})); } return *shared_remote_; |