1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "PaintWorkletGlobalScope.h"
9 #include "mozilla/dom/PaintWorkletGlobalScopeBinding.h"
10 #include "mozilla/dom/FunctionBinding.h"
11 #include "PaintWorkletImpl.h"
13 namespace mozilla::dom
{
15 PaintWorkletGlobalScope::PaintWorkletGlobalScope(PaintWorkletImpl
* aImpl
)
16 : WorkletGlobalScope(aImpl
) {}
18 PaintWorkletImpl
* PaintWorkletGlobalScope::Impl() const {
19 return static_cast<PaintWorkletImpl
*>(mImpl
.get());
22 bool PaintWorkletGlobalScope::WrapGlobalObject(
23 JSContext
* aCx
, JS::MutableHandle
<JSObject
*> aReflector
) {
24 JS::RealmOptions options
= CreateRealmOptions();
25 return PaintWorkletGlobalScope_Binding::Wrap(
26 aCx
, this, this, options
, nsJSPrincipals::get(mImpl
->Principal()), true,
30 void PaintWorkletGlobalScope::RegisterPaint(const nsAString
& aType
,
31 VoidFunction
& aProcessorCtor
) {
32 // Nothing to do here, yet.
35 } // namespace mozilla::dom