DedicatedWorkerGlobalScope.h [plain text]
#pragma once
#include "PostMessageOptions.h"
#include "WorkerGlobalScope.h"
namespace JSC {
class CallFrame;
class JSObject;
class JSValue;
}
namespace WebCore {
class ContentSecurityPolicyResponseHeaders;
class DedicatedWorkerThread;
class MessagePort;
class RequestAnimationFrameCallback;
class SerializedScriptValue;
#if ENABLE(OFFSCREEN_CANVAS)
class WorkerAnimationController;
using CallbackId = int;
#endif
class DedicatedWorkerGlobalScope final : public WorkerGlobalScope {
WTF_MAKE_ISO_ALLOCATED(DedicatedWorkerGlobalScope);
public:
static Ref<DedicatedWorkerGlobalScope> create(const WorkerParameters&, Ref<SecurityOrigin>&&, DedicatedWorkerThread&, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
virtual ~DedicatedWorkerGlobalScope();
const String& name() const { return m_name; }
ExceptionOr<void> postMessage(JSC::JSGlobalObject&, JSC::JSValue message, PostMessageOptions&&);
DedicatedWorkerThread& thread();
#if ENABLE(OFFSCREEN_CANVAS)
CallbackId requestAnimationFrame(Ref<RequestAnimationFrameCallback>&&);
void cancelAnimationFrame(CallbackId);
#endif
private:
using Base = WorkerGlobalScope;
DedicatedWorkerGlobalScope(const WorkerParameters&, Ref<SecurityOrigin>&&, DedicatedWorkerThread&, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
bool isDedicatedWorkerGlobalScope() const final { return true; }
ExceptionOr<void> importScripts(const Vector<String>& urls) final;
EventTargetInterface eventTargetInterface() const final;
String m_name;
#if ENABLE(OFFSCREEN_CANVAS)
RefPtr<WorkerAnimationController> m_workerAnimationController;
#endif
};
}