/* * Copyright (c) 2022, Andrew Kaster * Copyright (c) 2024, Jamie Mansfield * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include #include namespace Web::HTML { class WorkerNavigator : public Bindings::PlatformObject , public NavigatorConcurrentHardwareMixin , public NavigatorDeviceMemoryMixin , public NavigatorIDMixin , public NavigatorLanguageMixin , public NavigatorOnLineMixin , public StorageAPI::NavigatorStorage { WEB_PLATFORM_OBJECT(WorkerNavigator, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(WorkerNavigator); public: [[nodiscard]] static GC::Ref create(WorkerGlobalScope&); GC::Ref service_worker(); virtual ~WorkerNavigator() override; GC::Ref media_capabilities(); private: explicit WorkerNavigator(WorkerGlobalScope&); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; // ^StorageAPI::NavigatorStorage virtual Bindings::PlatformObject const& this_navigator_storage_object() const override { return *this; } // https://w3c.github.io/media-capabilities/#dom-workernavigator-mediacapabilities GC::Ptr m_media_capabilities; GC::Ptr m_service_worker_container; }; }