DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /home/jenkins/src/releases/comm-beta/mozilla/dom/interfaces/security/nsIContentSecurityPolicy.idl
 */

#ifndef __gen_nsIContentSecurityPolicy_h__
#define __gen_nsIContentSecurityPolicy_h__


#ifndef __gen_nsISerializable_h__
#include "nsISerializable.h"
#endif

#ifndef __gen_nsIContentPolicy_h__
#include "nsIContentPolicy.h"
#endif

#include "js/GCAnnotations.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIURI; /* forward declaration */

class nsIDocShell; /* forward declaration */

class nsIEventTarget; /* forward declaration */

class nsIPrincipal; /* forward declaration */

class nsICSPEventListener; /* forward declaration */

namespace mozilla {
namespace dom {
class Element; /* webidl Element */
} // namespace dom
} // namespace mozilla

class nsIDocument; /* webidl Document */

typedef uint16_t  CSPDirective;

class nsCSPPolicy;

/* starting interface:    nsIContentSecurityPolicy */
#define NS_ICONTENTSECURITYPOLICY_IID_STR "b3c4c0ae-bd5e-4cad-87e0-8d210dbb3f9f"

#define NS_ICONTENTSECURITYPOLICY_IID \
  {0xb3c4c0ae, 0xbd5e, 0x4cad, \
    { 0x87, 0xe0, 0x8d, 0x21, 0x0d, 0xbb, 0x3f, 0x9f }}

class nsIContentSecurityPolicy : public nsISerializable {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTSECURITYPOLICY_IID)

  enum {
    NO_DIRECTIVE = 0U,
    DEFAULT_SRC_DIRECTIVE = 1U,
    SCRIPT_SRC_DIRECTIVE = 2U,
    OBJECT_SRC_DIRECTIVE = 3U,
    STYLE_SRC_DIRECTIVE = 4U,
    IMG_SRC_DIRECTIVE = 5U,
    MEDIA_SRC_DIRECTIVE = 6U,
    FRAME_SRC_DIRECTIVE = 7U,
    FONT_SRC_DIRECTIVE = 8U,
    CONNECT_SRC_DIRECTIVE = 9U,
    REPORT_URI_DIRECTIVE = 10U,
    FRAME_ANCESTORS_DIRECTIVE = 11U,
    REFLECTED_XSS_DIRECTIVE = 12U,
    BASE_URI_DIRECTIVE = 13U,
    FORM_ACTION_DIRECTIVE = 14U,
    WEB_MANIFEST_SRC_DIRECTIVE = 15U,
    UPGRADE_IF_INSECURE_DIRECTIVE = 16U,
    CHILD_SRC_DIRECTIVE = 17U,
    BLOCK_ALL_MIXED_CONTENT = 18U,
    REQUIRE_SRI_FOR = 19U,
    SANDBOX_DIRECTIVE = 20U,
    WORKER_SRC_DIRECTIVE = 21U
  };

  /* [binaryname(GetPolicyString)] AString getPolicy (in unsigned long index); */
  NS_IMETHOD GetPolicyString(uint32_t index, nsAString& _retval) = 0;

  /* [noscript,nostdcall,notxpcom] CSPPolicyPtr GetPolicy (in unsigned long index); */
  virtual const nsCSPPolicy * GetPolicy(uint32_t index) = 0;

  /* readonly attribute unsigned long policyCount; */
  NS_IMETHOD GetPolicyCount(uint32_t *aPolicyCount) = 0;

  /* readonly attribute bool upgradeInsecureRequests; */
  NS_IMETHOD GetUpgradeInsecureRequests(bool *aUpgradeInsecureRequests) = 0;

  /* readonly attribute bool blockAllMixedContent; */
  NS_IMETHOD GetBlockAllMixedContent(bool *aBlockAllMixedContent) = 0;

  /* readonly attribute bool enforcesFrameAncestors; */
  NS_IMETHOD GetEnforcesFrameAncestors(bool *aEnforcesFrameAncestors) = 0;

  /* void appendPolicy (in AString policyString, in boolean reportOnly, in boolean deliveredViaMetaTag); */
  NS_IMETHOD AppendPolicy(const nsAString& policyString, bool reportOnly, bool deliveredViaMetaTag) = 0;

  /* boolean getAllowsInline (in nsContentPolicyType aContentPolicyType, in AString aNonce, in boolean aParserCreated, in Element aTriggeringElement, in AString aContentOfPseudoScript, in unsigned long aLineNumber, in unsigned long aColumnNumber); */
  NS_IMETHOD GetAllowsInline(nsContentPolicyType aContentPolicyType, const nsAString& aNonce, bool aParserCreated, mozilla::dom::Element *aTriggeringElement, const nsAString& aContentOfPseudoScript, uint32_t aLineNumber, uint32_t aColumnNumber, bool *_retval) = 0;

  /* boolean getAllowsEval (out boolean shouldReportViolations); */
  NS_IMETHOD GetAllowsEval(bool *shouldReportViolations, bool *_retval) = 0;

  /* uint32_t getCSPSandboxFlags (); */
  NS_IMETHOD GetCSPSandboxFlags(uint32_t *_retval) = 0;

  /* void logViolationDetails (in unsigned short violationType, in Element triggeringElement, in AString sourceFile, in AString scriptSample, in int32_t lineNum, in int32_t columnNum, [optional] in AString nonce, [optional] in AString content); */
  NS_IMETHOD LogViolationDetails(uint16_t violationType, mozilla::dom::Element *triggeringElement, const nsAString& sourceFile, const nsAString& scriptSample, int32_t lineNum, int32_t columnNum, const nsAString& nonce, const nsAString& content) = 0;

  enum {
    VIOLATION_TYPE_INLINE_SCRIPT = 1U,
    VIOLATION_TYPE_EVAL = 2U,
    VIOLATION_TYPE_INLINE_STYLE = 3U,
    VIOLATION_TYPE_NONCE_SCRIPT = 4U,
    VIOLATION_TYPE_NONCE_STYLE = 5U,
    VIOLATION_TYPE_HASH_SCRIPT = 6U,
    VIOLATION_TYPE_HASH_STYLE = 7U,
    VIOLATION_TYPE_REQUIRE_SRI_FOR_STYLE = 8U,
    VIOLATION_TYPE_REQUIRE_SRI_FOR_SCRIPT = 9U
  };

  /* void setRequestContext (in Document aDocument, in nsIPrincipal aPrincipal); */
  NS_IMETHOD SetRequestContext(nsIDocument *aDocument, nsIPrincipal *aPrincipal) = 0;

  /* void setEventListener (in nsICSPEventListener aListener); */
  NS_IMETHOD SetEventListener(nsICSPEventListener *aListener) = 0;

  /* [noscript] void ensureEventTarget (in nsIEventTarget aEventTarget); */
  NS_IMETHOD EnsureEventTarget(nsIEventTarget *aEventTarget) = 0;

  /* bool requireSRIForType (in nsContentPolicyType aContentType); */
  NS_IMETHOD RequireSRIForType(nsContentPolicyType aContentType, bool *_retval) = 0;

  /* boolean permitsAncestry (in nsIDocShell docShell); */
  NS_IMETHOD PermitsAncestry(nsIDocShell *docShell, bool *_retval) = 0;

  /* boolean permits (in Element aTriggeringElement, in nsIURI aURI, in CSPDirective aDir, in boolean aSpecific); */
  NS_IMETHOD Permits(mozilla::dom::Element *aTriggeringElement, nsIURI *aURI, CSPDirective aDir, bool aSpecific, bool *_retval) = 0;

  /* short shouldLoad (in nsContentPolicyType aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeTypeGuess, in nsIURI aOriginalURIIfRedirect, in bool aSendViolationReports); */
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString& aMimeTypeGuess, nsIURI *aOriginalURIIfRedirect, bool aSendViolationReports, int16_t *_retval) = 0;

 // nsIObserver topic to fire when the policy encounters a violation.
#define CSP_VIOLATION_TOPIC "csp-on-violate-policy"
  /* AString toJSON (); */
  NS_IMETHOD ToJSON(nsAString& _retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSecurityPolicy, NS_ICONTENTSECURITYPOLICY_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICONTENTSECURITYPOLICY \
  NS_IMETHOD GetPolicyString(uint32_t index, nsAString& _retval) override; \
  virtual const nsCSPPolicy * GetPolicy(uint32_t index) override; \
  NS_IMETHOD GetPolicyCount(uint32_t *aPolicyCount) override; \
  NS_IMETHOD GetUpgradeInsecureRequests(bool *aUpgradeInsecureRequests) override; \
  NS_IMETHOD GetBlockAllMixedContent(bool *aBlockAllMixedContent) override; \
  NS_IMETHOD GetEnforcesFrameAncestors(bool *aEnforcesFrameAncestors) override; \
  NS_IMETHOD AppendPolicy(const nsAString& policyString, bool reportOnly, bool deliveredViaMetaTag) override; \
  NS_IMETHOD GetAllowsInline(nsContentPolicyType aContentPolicyType, const nsAString& aNonce, bool aParserCreated, mozilla::dom::Element *aTriggeringElement, const nsAString& aContentOfPseudoScript, uint32_t aLineNumber, uint32_t aColumnNumber, bool *_retval) override; \
  NS_IMETHOD GetAllowsEval(bool *shouldReportViolations, bool *_retval) override; \
  NS_IMETHOD GetCSPSandboxFlags(uint32_t *_retval) override; \
  NS_IMETHOD LogViolationDetails(uint16_t violationType, mozilla::dom::Element *triggeringElement, const nsAString& sourceFile, const nsAString& scriptSample, int32_t lineNum, int32_t columnNum, const nsAString& nonce, const nsAString& content) override; \
  NS_IMETHOD SetRequestContext(nsIDocument *aDocument, nsIPrincipal *aPrincipal) override; \
  NS_IMETHOD SetEventListener(nsICSPEventListener *aListener) override; \
  NS_IMETHOD EnsureEventTarget(nsIEventTarget *aEventTarget) override; \
  NS_IMETHOD RequireSRIForType(nsContentPolicyType aContentType, bool *_retval) override; \
  NS_IMETHOD PermitsAncestry(nsIDocShell *docShell, bool *_retval) override; \
  NS_IMETHOD Permits(mozilla::dom::Element *aTriggeringElement, nsIURI *aURI, CSPDirective aDir, bool aSpecific, bool *_retval) override; \
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString& aMimeTypeGuess, nsIURI *aOriginalURIIfRedirect, bool aSendViolationReports, int16_t *_retval) override; \
  NS_IMETHOD ToJSON(nsAString& _retval) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSICONTENTSECURITYPOLICY \
  nsresult GetPolicyString(uint32_t index, nsAString& _retval); \
  const nsCSPPolicy * GetPolicy(uint32_t index); \
  nsresult GetPolicyCount(uint32_t *aPolicyCount); \
  nsresult GetUpgradeInsecureRequests(bool *aUpgradeInsecureRequests); \
  nsresult GetBlockAllMixedContent(bool *aBlockAllMixedContent); \
  nsresult GetEnforcesFrameAncestors(bool *aEnforcesFrameAncestors); \
  nsresult AppendPolicy(const nsAString& policyString, bool reportOnly, bool deliveredViaMetaTag); \
  nsresult GetAllowsInline(nsContentPolicyType aContentPolicyType, const nsAString& aNonce, bool aParserCreated, mozilla::dom::Element *aTriggeringElement, const nsAString& aContentOfPseudoScript, uint32_t aLineNumber, uint32_t aColumnNumber, bool *_retval); \
  nsresult GetAllowsEval(bool *shouldReportViolations, bool *_retval); \
  nsresult GetCSPSandboxFlags(uint32_t *_retval); \
  nsresult LogViolationDetails(uint16_t violationType, mozilla::dom::Element *triggeringElement, const nsAString& sourceFile, const nsAString& scriptSample, int32_t lineNum, int32_t columnNum, const nsAString& nonce, const nsAString& content); \
  nsresult SetRequestContext(nsIDocument *aDocument, nsIPrincipal *aPrincipal); \
  nsresult SetEventListener(nsICSPEventListener *aListener); \
  nsresult EnsureEventTarget(nsIEventTarget *aEventTarget); \
  nsresult RequireSRIForType(nsContentPolicyType aContentType, bool *_retval); \
  nsresult PermitsAncestry(nsIDocShell *docShell, bool *_retval); \
  nsresult Permits(mozilla::dom::Element *aTriggeringElement, nsIURI *aURI, CSPDirective aDir, bool aSpecific, bool *_retval); \
  nsresult ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString& aMimeTypeGuess, nsIURI *aOriginalURIIfRedirect, bool aSendViolationReports, int16_t *_retval); \
  nsresult ToJSON(nsAString& _retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICONTENTSECURITYPOLICY(_to) \
  NS_IMETHOD GetPolicyString(uint32_t index, nsAString& _retval) override { return _to GetPolicyString(index, _retval); } \
  virtual const nsCSPPolicy * GetPolicy(uint32_t index) override { return _to GetPolicy(index); } \
  NS_IMETHOD GetPolicyCount(uint32_t *aPolicyCount) override { return _to GetPolicyCount(aPolicyCount); } \
  NS_IMETHOD GetUpgradeInsecureRequests(bool *aUpgradeInsecureRequests) override { return _to GetUpgradeInsecureRequests(aUpgradeInsecureRequests); } \
  NS_IMETHOD GetBlockAllMixedContent(bool *aBlockAllMixedContent) override { return _to GetBlockAllMixedContent(aBlockAllMixedContent); } \
  NS_IMETHOD GetEnforcesFrameAncestors(bool *aEnforcesFrameAncestors) override { return _to GetEnforcesFrameAncestors(aEnforcesFrameAncestors); } \
  NS_IMETHOD AppendPolicy(const nsAString& policyString, bool reportOnly, bool deliveredViaMetaTag) override { return _to AppendPolicy(policyString, reportOnly, deliveredViaMetaTag); } \
  NS_IMETHOD GetAllowsInline(nsContentPolicyType aContentPolicyType, const nsAString& aNonce, bool aParserCreated, mozilla::dom::Element *aTriggeringElement, const nsAString& aContentOfPseudoScript, uint32_t aLineNumber, uint32_t aColumnNumber, bool *_retval) override { return _to GetAllowsInline(aContentPolicyType, aNonce, aParserCreated, aTriggeringElement, aContentOfPseudoScript, aLineNumber, aColumnNumber, _retval); } \
  NS_IMETHOD GetAllowsEval(bool *shouldReportViolations, bool *_retval) override { return _to GetAllowsEval(shouldReportViolations, _retval); } \
  NS_IMETHOD GetCSPSandboxFlags(uint32_t *_retval) override { return _to GetCSPSandboxFlags(_retval); } \
  NS_IMETHOD LogViolationDetails(uint16_t violationType, mozilla::dom::Element *triggeringElement, const nsAString& sourceFile, const nsAString& scriptSample, int32_t lineNum, int32_t columnNum, const nsAString& nonce, const nsAString& content) override { return _to LogViolationDetails(violationType, triggeringElement, sourceFile, scriptSample, lineNum, columnNum, nonce, content); } \
  NS_IMETHOD SetRequestContext(nsIDocument *aDocument, nsIPrincipal *aPrincipal) override { return _to SetRequestContext(aDocument, aPrincipal); } \
  NS_IMETHOD SetEventListener(nsICSPEventListener *aListener) override { return _to SetEventListener(aListener); } \
  NS_IMETHOD EnsureEventTarget(nsIEventTarget *aEventTarget) override { return _to EnsureEventTarget(aEventTarget); } \
  NS_IMETHOD RequireSRIForType(nsContentPolicyType aContentType, bool *_retval) override { return _to RequireSRIForType(aContentType, _retval); } \
  NS_IMETHOD PermitsAncestry(nsIDocShell *docShell, bool *_retval) override { return _to PermitsAncestry(docShell, _retval); } \
  NS_IMETHOD Permits(mozilla::dom::Element *aTriggeringElement, nsIURI *aURI, CSPDirective aDir, bool aSpecific, bool *_retval) override { return _to Permits(aTriggeringElement, aURI, aDir, aSpecific, _retval); } \
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString& aMimeTypeGuess, nsIURI *aOriginalURIIfRedirect, bool aSendViolationReports, int16_t *_retval) override { return _to ShouldLoad(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeTypeGuess, aOriginalURIIfRedirect, aSendViolationReports, _retval); } \
  NS_IMETHOD ToJSON(nsAString& _retval) override { return _to ToJSON(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICONTENTSECURITYPOLICY(_to) \
  NS_IMETHOD GetPolicyString(uint32_t index, nsAString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPolicyString(index, _retval); } \
  virtual const nsCSPPolicy * GetPolicy(uint32_t index) override; \
  NS_IMETHOD GetPolicyCount(uint32_t *aPolicyCount) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPolicyCount(aPolicyCount); } \
  NS_IMETHOD GetUpgradeInsecureRequests(bool *aUpgradeInsecureRequests) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUpgradeInsecureRequests(aUpgradeInsecureRequests); } \
  NS_IMETHOD GetBlockAllMixedContent(bool *aBlockAllMixedContent) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBlockAllMixedContent(aBlockAllMixedContent); } \
  NS_IMETHOD GetEnforcesFrameAncestors(bool *aEnforcesFrameAncestors) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEnforcesFrameAncestors(aEnforcesFrameAncestors); } \
  NS_IMETHOD AppendPolicy(const nsAString& policyString, bool reportOnly, bool deliveredViaMetaTag) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendPolicy(policyString, reportOnly, deliveredViaMetaTag); } \
  NS_IMETHOD GetAllowsInline(nsContentPolicyType aContentPolicyType, const nsAString& aNonce, bool aParserCreated, mozilla::dom::Element *aTriggeringElement, const nsAString& aContentOfPseudoScript, uint32_t aLineNumber, uint32_t aColumnNumber, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowsInline(aContentPolicyType, aNonce, aParserCreated, aTriggeringElement, aContentOfPseudoScript, aLineNumber, aColumnNumber, _retval); } \
  NS_IMETHOD GetAllowsEval(bool *shouldReportViolations, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowsEval(shouldReportViolations, _retval); } \
  NS_IMETHOD GetCSPSandboxFlags(uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCSPSandboxFlags(_retval); } \
  NS_IMETHOD LogViolationDetails(uint16_t violationType, mozilla::dom::Element *triggeringElement, const nsAString& sourceFile, const nsAString& scriptSample, int32_t lineNum, int32_t columnNum, const nsAString& nonce, const nsAString& content) override { return !_to ? NS_ERROR_NULL_POINTER : _to->LogViolationDetails(violationType, triggeringElement, sourceFile, scriptSample, lineNum, columnNum, nonce, content); } \
  NS_IMETHOD SetRequestContext(nsIDocument *aDocument, nsIPrincipal *aPrincipal) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRequestContext(aDocument, aPrincipal); } \
  NS_IMETHOD SetEventListener(nsICSPEventListener *aListener) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetEventListener(aListener); } \
  NS_IMETHOD EnsureEventTarget(nsIEventTarget *aEventTarget) override { return !_to ? NS_ERROR_NULL_POINTER : _to->EnsureEventTarget(aEventTarget); } \
  NS_IMETHOD RequireSRIForType(nsContentPolicyType aContentType, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RequireSRIForType(aContentType, _retval); } \
  NS_IMETHOD PermitsAncestry(nsIDocShell *docShell, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->PermitsAncestry(docShell, _retval); } \
  NS_IMETHOD Permits(mozilla::dom::Element *aTriggeringElement, nsIURI *aURI, CSPDirective aDir, bool aSpecific, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Permits(aTriggeringElement, aURI, aDir, aSpecific, _retval); } \
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString& aMimeTypeGuess, nsIURI *aOriginalURIIfRedirect, bool aSendViolationReports, int16_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ShouldLoad(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeTypeGuess, aOriginalURIIfRedirect, aSendViolationReports, _retval); } \
  NS_IMETHOD ToJSON(nsAString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ToJSON(_retval); } 


/* starting interface:    nsICSPEventListener */
#define NS_ICSPEVENTLISTENER_IID_STR "c3163b14-3a8f-46dd-a4af-bd04680364cd"

#define NS_ICSPEVENTLISTENER_IID \
  {0xc3163b14, 0x3a8f, 0x46dd, \
    { 0xa4, 0xaf, 0xbd, 0x04, 0x68, 0x03, 0x64, 0xcd }}

class NS_NO_VTABLE nsICSPEventListener : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSPEVENTLISTENER_IID)

  /* void onCSPViolationEvent (in AString aJSON); */
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD OnCSPViolationEvent(const nsAString& aJSON) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsICSPEventListener, NS_ICSPEVENTLISTENER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICSPEVENTLISTENER \
  NS_IMETHOD OnCSPViolationEvent(const nsAString& aJSON) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSICSPEVENTLISTENER \
  nsresult OnCSPViolationEvent(const nsAString& aJSON); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICSPEVENTLISTENER(_to) \
  NS_IMETHOD OnCSPViolationEvent(const nsAString& aJSON) override { return _to OnCSPViolationEvent(aJSON); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICSPEVENTLISTENER(_to) \
  NS_IMETHOD OnCSPViolationEvent(const nsAString& aJSON) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnCSPViolationEvent(aJSON); } 


#endif /* __gen_nsIContentSecurityPolicy_h__ */