PaintWorkletImpl.h (1086B)
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 https://mozilla.org/MPL/2.0/. */ 6 7 #ifndef PaintWorkletImpl_h 8 #define PaintWorkletImpl_h 9 10 #include "mozilla/dom/WorkletImpl.h" 11 12 namespace mozilla { 13 14 class PaintWorkletImpl final : public WorkletImpl { 15 public: 16 // Methods for parent thread only: 17 18 static already_AddRefed<dom::Worklet> CreateWorklet( 19 nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal); 20 21 nsContentPolicyType ContentPolicyType() const override { 22 return nsIContentPolicy::TYPE_INTERNAL_PAINTWORKLET; 23 } 24 25 protected: 26 // Execution thread only. 27 already_AddRefed<dom::WorkletGlobalScope> ConstructGlobalScope( 28 JSContext* aCx) override; 29 30 private: 31 PaintWorkletImpl(nsPIDOMWindowInner* aWindow, nsIPrincipal* aPrincipal); 32 ~PaintWorkletImpl(); 33 }; 34 35 } // namespace mozilla 36 37 #endif // PaintWorkletImpl_h