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 #ifndef DOM_WORKLET_WORKLETPRINCIPALS_H_
8 #define DOM_WORKLET_WORKLETPRINCIPALS_H_
10 #include "js/Principals.h"
11 #include "mozilla/RefPtr.h"
19 struct MOZ_HEAP_CLASS WorkletPrincipals final
: public JSPrincipals
{
20 // A new WorkletPrincipals has refcount zero.
21 explicit WorkletPrincipals(WorkletImpl
* aWorkletImpl
);
23 bool write(JSContext
* aCx
, JSStructuredCloneWriter
* aWriter
) override
;
25 bool isSystemOrAddonPrincipal() override
;
27 // Callback for JS_InitDestroyPrincipalsCallback()
28 static void Destroy(JSPrincipals
* aPrincipals
);
30 static const uint32_t kJSPrincipalsDebugToken
= 0x7e2df9f4;
34 RefPtr
<WorkletImpl
> mWorkletImpl
;
38 } // namespace mozilla
40 #endif // DOM_WORKLET_WORKLETPRINCIPALS_H_