Copy as Markdown
Other Tools
/* THIS FILE IS AUTOGENERATED FROM CSPDictionaries.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_CSPDICTIONARIESBINDING_H_
#define DOM_CSPDICTIONARIESBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
namespace mozilla {
namespace dom {
struct CSP;
struct CSPAtoms;
struct CSPPoliciesAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct CSP : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mBase_uri;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mBlock_all_mixed_content;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mChild_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mConnect_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mDefault_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mFont_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mForm_action;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mFrame_ancestors;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mFrame_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mImg_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mManifest_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mMedia_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mObject_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mReferrer;
MOZ_INIT_OUTSIDE_CTOR bool mReport_only;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mReport_to;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mReport_uri;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mRequire_trusted_types_for;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mSandbox;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mScript_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mScript_src_attr;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mScript_src_elem;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mStyle_src;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mTrusted_types;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mUpgrade_insecure_requests;
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<nsString>> mWorker_src;
CSP();
explicit inline CSP(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CSP(CSP&& aOther) = default;
explicit inline CSP(const CSP& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
void
TraceDictionary(JSTracer* trc);
CSP&
operator=(const CSP& aOther);
private:
static bool
InitIds(JSContext* cx, CSPAtoms* atomsCache);
};
namespace binding_detail {
struct FastCSP : public CSP
{
inline FastCSP()
: CSP(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct CSPPolicies : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<CSP>> mCsp_policies;
CSPPolicies();
explicit inline CSPPolicies(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CSPPolicies(CSPPolicies&& aOther) = default;
explicit inline CSPPolicies(const CSPPolicies& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
bool
ToJSON(nsAString& aJSON) const;
void
TraceDictionary(JSTracer* trc);
CSPPolicies&
operator=(const CSPPolicies& aOther);
private:
static bool
InitIds(JSContext* cx, CSPPoliciesAtoms* atomsCache);
};
namespace binding_detail {
struct FastCSPPolicies : public CSPPolicies
{
inline FastCSPPolicies()
: CSPPolicies(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
} // namespace mozilla::dom
#endif // DOM_CSPDICTIONARIESBINDING_H_