2022-02-07 05:12:57 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-09-04 15:30:38 +03:00
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
2022-02-07 05:12:57 +03:00
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/workers.html#worker-locations
|
2022-09-04 15:30:38 +03:00
|
|
|
class WorkerLocation : public Bindings::PlatformObject {
|
|
|
|
WEB_PLATFORM_OBJECT(WorkerLocation, Bindings::PlatformObject);
|
|
|
|
|
2022-02-07 05:12:57 +03:00
|
|
|
public:
|
2022-09-04 15:30:38 +03:00
|
|
|
virtual ~WorkerLocation() override;
|
2022-02-07 05:12:57 +03:00
|
|
|
|
2023-02-20 23:44:05 +03:00
|
|
|
WebIDL::ExceptionOr<String> href() const;
|
|
|
|
WebIDL::ExceptionOr<String> origin() const;
|
|
|
|
WebIDL::ExceptionOr<String> protocol() const;
|
|
|
|
WebIDL::ExceptionOr<String> host() const;
|
|
|
|
WebIDL::ExceptionOr<String> hostname() const;
|
|
|
|
WebIDL::ExceptionOr<String> port() const;
|
|
|
|
WebIDL::ExceptionOr<String> pathname() const;
|
|
|
|
WebIDL::ExceptionOr<String> search() const;
|
|
|
|
WebIDL::ExceptionOr<String> hash() const;
|
2022-02-07 05:12:57 +03:00
|
|
|
|
|
|
|
private:
|
2022-09-04 15:30:38 +03:00
|
|
|
explicit WorkerLocation(WorkerGlobalScope&);
|
|
|
|
|
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
2022-02-07 05:12:57 +03:00
|
|
|
|
2023-02-27 02:09:02 +03:00
|
|
|
JS::NonnullGCPtr<WorkerGlobalScope> m_global_scope;
|
2022-02-07 05:12:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|