/* * 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); JS_DECLARE_ALLOCATOR(WorkerLocation); public: virtual ~WorkerLocation() override; WebIDL::ExceptionOr href() const; WebIDL::ExceptionOr origin() const; WebIDL::ExceptionOr protocol() const; WebIDL::ExceptionOr host() const; WebIDL::ExceptionOr hostname() const; WebIDL::ExceptionOr port() const; WebIDL::ExceptionOr pathname() const; WebIDL::ExceptionOr search() const; WebIDL::ExceptionOr hash() const; private: explicit WorkerLocation(WorkerGlobalScope&); virtual void visit_edges(Cell::Visitor&) override; JS::NonnullGCPtr m_global_scope; }; }