Serenity Operating System
1/*
2 * Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <LibWeb/Bindings/PlatformObject.h>
10
11namespace Web::HTML {
12
13// https://html.spec.whatwg.org/multipage/workers.html#worker-locations
14class WorkerLocation : public Bindings::PlatformObject {
15 WEB_PLATFORM_OBJECT(WorkerLocation, Bindings::PlatformObject);
16
17public:
18 virtual ~WorkerLocation() override;
19
20 WebIDL::ExceptionOr<String> href() const;
21 WebIDL::ExceptionOr<String> origin() const;
22 WebIDL::ExceptionOr<String> protocol() const;
23 WebIDL::ExceptionOr<String> host() const;
24 WebIDL::ExceptionOr<String> hostname() const;
25 WebIDL::ExceptionOr<String> port() const;
26 WebIDL::ExceptionOr<String> pathname() const;
27 WebIDL::ExceptionOr<String> search() const;
28 WebIDL::ExceptionOr<String> hash() const;
29
30private:
31 explicit WorkerLocation(WorkerGlobalScope&);
32
33 virtual void visit_edges(Cell::Visitor&) override;
34
35 WorkerGlobalScope& m_global_scope;
36};
37
38}