/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_CSPDictionariesBinding_h
#define mozilla_dom_CSPDictionariesBinding_h

#include "js/RootingAPI.h"
#include "jspubtd.h"
#include "mozilla/ErrorResult.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 {
namespace dom {

struct CSP : public DictionaryBase
{
  Optional<Sequence<nsString>> mBase_uri;
  Optional<Sequence<nsString>> mConnect_src;
  Optional<Sequence<nsString>> mDefault_src;
  Optional<Sequence<nsString>> mFont_src;
  Optional<Sequence<nsString>> mForm_action;
  Optional<Sequence<nsString>> mFrame_ancestors;
  Optional<Sequence<nsString>> mFrame_src;
  Optional<Sequence<nsString>> mImg_src;
  Optional<Sequence<nsString>> mMedia_src;
  Optional<Sequence<nsString>> mObject_src;
  Optional<Sequence<nsString>> mReferrer;
  bool mReport_only;
  Optional<Sequence<nsString>> mReport_uri;
  Optional<Sequence<nsString>> mScript_src;
  Optional<Sequence<nsString>> mStyle_src;

  CSP();

  explicit inline CSP(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

  explicit inline CSP(const CSP& aOther)
  {
    *this = aOther;
  }

  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  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
{
  Optional<Sequence<CSP>> mCsp_policies;

  CSPPolicies();

  explicit inline CSPPolicies(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

  explicit inline CSPPolicies(const CSPPolicies& aOther)
  {
    *this = aOther;
  }

  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  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 dom
} // namespace mozilla

#endif // mozilla_dom_CSPDictionariesBinding_h
