/* * Copyright (c) 2022, Andrew Kaster * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::HTML { // https://html.spec.whatwg.org/multipage/workers.html#worker-locations class WorkerLocation : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(WorkerLocation, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(WorkerLocation); public: virtual ~WorkerLocation() override; WebIDL::ExceptionOr href() const; String origin() const; WebIDL::ExceptionOr protocol() const; WebIDL::ExceptionOr host() const; WebIDL::ExceptionOr hostname() const; WebIDL::ExceptionOr port() const; String pathname() const; WebIDL::ExceptionOr search() const; WebIDL::ExceptionOr hash() const; private: explicit WorkerLocation(WorkerGlobalScope&); virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; GC::Ref m_global_scope; }; }