PaintWorkletGlobalScope.cpp (1255B)
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/. */ 6 7 #include "PaintWorkletGlobalScope.h" 8 9 #include "PaintWorkletImpl.h" 10 #include "mozilla/dom/FunctionBinding.h" 11 #include "mozilla/dom/PaintWorkletGlobalScopeBinding.h" 12 13 namespace mozilla::dom { 14 15 PaintWorkletGlobalScope::PaintWorkletGlobalScope(PaintWorkletImpl* aImpl) 16 : WorkletGlobalScope(aImpl) {} 17 18 PaintWorkletImpl* PaintWorkletGlobalScope::Impl() const { 19 return static_cast<PaintWorkletImpl*>(mImpl.get()); 20 } 21 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()), 27 aReflector); 28 } 29 30 void PaintWorkletGlobalScope::RegisterPaint(const nsAString& aType, 31 VoidFunction& aProcessorCtor) { 32 // Nothing to do here, yet. 33 } 34 35 } // namespace mozilla::dom