mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
LibWeb: Add initial implementation for WorkerGlobalScope
This initial implementation stubs out the WorkerGlobalScope, WorkerLocation and WorkerNavigator classes. It doesn't take into account all the things that actually need passed into the constructors for these objects, nor the extra abstract operations that need to be performed on them by the rest of the Browser infrastructure. However, it does create bindings that compile and link :^)
This commit is contained in:
parent
8b38df72a3
commit
820e99f97d
11 changed files with 527 additions and 0 deletions
43
Userland/Libraries/LibWeb/HTML/WorkerLocation.h
Normal file
43
Userland/Libraries/LibWeb/HTML/WorkerLocation.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/RefCounted.h>
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#worker-locations
|
||||
class WorkerLocation
|
||||
: public RefCounted<WorkerLocation>
|
||||
, public Bindings::Wrappable {
|
||||
public:
|
||||
using WrapperType = Bindings::WorkerLocationWrapper;
|
||||
|
||||
static NonnullRefPtr<WorkerLocation> create(WorkerGlobalScope& global_scope)
|
||||
{
|
||||
return adopt_ref(*new WorkerLocation(global_scope));
|
||||
}
|
||||
|
||||
String href() const;
|
||||
String origin() const;
|
||||
String protocol() const;
|
||||
String host() const;
|
||||
String hostname() const;
|
||||
String port() const;
|
||||
String pathname() const;
|
||||
String search() const;
|
||||
String hash() const;
|
||||
|
||||
private:
|
||||
WorkerLocation(WorkerGlobalScope&);
|
||||
|
||||
WorkerGlobalScope& m_global_scope;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue