diff --git a/Libraries/LibWeb/CMakeLists.txt b/Libraries/LibWeb/CMakeLists.txt index 2aebafa9d42..625534295ad 100644 --- a/Libraries/LibWeb/CMakeLists.txt +++ b/Libraries/LibWeb/CMakeLists.txt @@ -670,7 +670,7 @@ set(SOURCES SecureContexts/AbstractOperations.cpp ServiceWorker/Job.cpp ServiceWorker/Registration.cpp - ServiceWorker/ServiceWorker.cpp + ServiceWorker/ServiceWorkerRecord.cpp SRI/SRI.cpp StorageAPI/NavigatorStorage.cpp StorageAPI/StorageKey.cpp diff --git a/Libraries/LibWeb/ServiceWorker/Registration.cpp b/Libraries/LibWeb/ServiceWorker/Registration.cpp index d75c73bd336..5477be61bb0 100644 --- a/Libraries/LibWeb/ServiceWorker/Registration.cpp +++ b/Libraries/LibWeb/ServiceWorker/Registration.cpp @@ -90,7 +90,7 @@ void Registration::remove(StorageAPI::StorageKey const& key, URL::URL const& sco } // https://w3c.github.io/ServiceWorker/#get-newest-worker -ServiceWorker* Registration::newest_worker() const +ServiceWorkerRecord* Registration::newest_worker() const { // FIXME: 1. Run the following steps atomically. diff --git a/Libraries/LibWeb/ServiceWorker/Registration.h b/Libraries/LibWeb/ServiceWorker/Registration.h index 883fb6db4ee..1b013fbe9c0 100644 --- a/Libraries/LibWeb/ServiceWorker/Registration.h +++ b/Libraries/LibWeb/ServiceWorker/Registration.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include namespace Web::ServiceWorker { @@ -41,7 +41,7 @@ public: void set_last_update_check_time(MonotonicTime time) { m_last_update_check_time = time; } - ServiceWorker* newest_worker() const; + ServiceWorkerRecord* newest_worker() const; bool is_stale() const; private: @@ -50,10 +50,10 @@ private: StorageAPI::StorageKey m_storage_key; // https://w3c.github.io/ServiceWorker/#service-worker-registration-storage-key URL::URL m_scope_url; // https://w3c.github.io/ServiceWorker/#dfn-scope-url - // NOTE: These are "service workers", not "HTML::ServiceWorker"s - ServiceWorker* m_installing_worker { nullptr }; // https://w3c.github.io/ServiceWorker/#dfn-installing-worker - ServiceWorker* m_waiting_worker { nullptr }; // https://w3c.github.io/ServiceWorker/#dfn-waiting-worker - ServiceWorker* m_active_worker { nullptr }; // https://w3c.github.io/ServiceWorker/#dfn-active-worker + // NOTE: These are "service workers", not "ServiceWorker"s - (i.e, not what is exposed over JS) + ServiceWorkerRecord* m_installing_worker { nullptr }; // https://w3c.github.io/ServiceWorker/#dfn-installing-worker + ServiceWorkerRecord* m_waiting_worker { nullptr }; // https://w3c.github.io/ServiceWorker/#dfn-waiting-worker + ServiceWorkerRecord* m_active_worker { nullptr }; // https://w3c.github.io/ServiceWorker/#dfn-active-worker Optional m_last_update_check_time; // https://w3c.github.io/ServiceWorker/#dfn-last-update-check-time Bindings::ServiceWorkerUpdateViaCache m_update_via_cache_mode = Bindings::ServiceWorkerUpdateViaCache::Imports; // https://w3c.github.io/ServiceWorker/#dfn-update-via-cache diff --git a/Libraries/LibWeb/ServiceWorker/ServiceWorker.cpp b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.cpp similarity index 72% rename from Libraries/LibWeb/ServiceWorker/ServiceWorker.cpp rename to Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.cpp index 203a1b2aa43..bd9d817a2ae 100644 --- a/Libraries/LibWeb/ServiceWorker/ServiceWorker.cpp +++ b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include namespace Web::ServiceWorker { } diff --git a/Libraries/LibWeb/ServiceWorker/ServiceWorker.h b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.h similarity index 97% rename from Libraries/LibWeb/ServiceWorker/ServiceWorker.h rename to Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.h index b1d14fac05f..b68d061d65d 100644 --- a/Libraries/LibWeb/ServiceWorker/ServiceWorker.h +++ b/Libraries/LibWeb/ServiceWorker/ServiceWorkerRecord.h @@ -16,7 +16,7 @@ namespace Web::ServiceWorker { // This class corresponds to "service worker", not "ServiceWorker" // FIXME: This should be owned and managed at the user agent level // FIXME: A lot of the fields for this struct actually need to live in the Agent for the service worker in the WebWorker process -struct ServiceWorker { +struct ServiceWorkerRecord { Bindings::ServiceWorkerState state = Bindings::ServiceWorkerState::Parsed; // https://w3c.github.io/ServiceWorker/#dfn-state URL::URL script_url; // https://w3c.github.io/ServiceWorker/#dfn-script-url Bindings::WorkerType worker_type = Bindings::WorkerType::Classic; // https://w3c.github.io/ServiceWorker/#dfn-type