2022-02-06 23:12:57 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-09-04 09:30:38 -03:00
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
2025-07-19 23:35:33 -03:00
|
|
|
#include <LibWeb/Export.h>
|
2022-02-06 23:12:57 -03:00
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/workers.html#worker-locations
|
2025-07-19 23:35:33 -03:00
|
|
|
class WEB_API WorkerLocation : public Bindings::PlatformObject {
|
2022-09-04 09:30:38 -03:00
|
|
|
WEB_PLATFORM_OBJECT(WorkerLocation, Bindings::PlatformObject);
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DECLARE_ALLOCATOR(WorkerLocation);
|
2022-09-04 09:30:38 -03:00
|
|
|
|
2022-02-06 23:12:57 -03:00
|
|
|
public:
|
2022-09-04 09:30:38 -03:00
|
|
|
virtual ~WorkerLocation() override;
|
2022-02-06 23:12:57 -03:00
|
|
|
|
2024-11-28 11:39:23 -03:00
|
|
|
String href() const;
|
2024-11-23 04:10:34 -03:00
|
|
|
String origin() const;
|
2024-11-28 11:39:23 -03:00
|
|
|
String protocol() const;
|
|
|
|
|
String host() const;
|
|
|
|
|
String hostname() const;
|
|
|
|
|
String port() const;
|
2024-08-05 01:55:39 -03:00
|
|
|
String pathname() const;
|
2024-11-28 11:39:23 -03:00
|
|
|
String search() const;
|
|
|
|
|
String hash() const;
|
2022-02-06 23:12:57 -03:00
|
|
|
|
|
|
|
|
private:
|
2022-09-04 09:30:38 -03:00
|
|
|
explicit WorkerLocation(WorkerGlobalScope&);
|
|
|
|
|
|
2024-07-28 15:14:45 -03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2022-09-04 09:30:38 -03:00
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
2022-02-06 23:12:57 -03:00
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC::Ref<WorkerGlobalScope> m_global_scope;
|
2022-02-06 23:12:57 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|