Copy as Markdown

Other Tools

/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/dom/interfaces/security/nsIPolicyContainer.idl
*/
#ifndef __gen_nsIPolicyContainer_h__
#define __gen_nsIPolicyContainer_h__
#include "nsISerializable.h"
#include "mozilla/AlreadyAddRefed.h"
#include "mozilla/Assertions.h"
#include "mozilla/DebugOnly.h"
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIContentSecurityPolicy; /* forward declaration */
/* starting interface: nsIPolicyContainer */
#define NS_IPOLICYCONTAINER_IID_STR "c9da865e-c3d7-4aa1-a271-0f571f013c30"
#define NS_IPOLICYCONTAINER_IID \
{0xc9da865e, 0xc3d7, 0x4aa1, \
{ 0xa2, 0x71, 0x0f, 0x57, 0x1f, 0x01, 0x3c, 0x30 }}
class NS_NO_VTABLE nsIPolicyContainer : public nsISerializable {
public:
NS_INLINE_DECL_STATIC_IID(NS_IPOLICYCONTAINER_IID)
/* Used by ToJSValue to check which scriptable interface is implemented. */
using ScriptableInterfaceType = nsIPolicyContainer;
/* [infallible] readonly attribute nsIContentSecurityPolicy csp; */
NS_IMETHOD GetCsp(nsIContentSecurityPolicy **aCsp) = 0;
inline already_AddRefed<nsIContentSecurityPolicy> GetCsp()
{
nsIContentSecurityPolicy* result = nullptr;
mozilla::DebugOnly<nsresult> rv = GetCsp(&result);
MOZ_ASSERT(NS_SUCCEEDED(rv));
return already_AddRefed<nsIContentSecurityPolicy>(result);
}
/* void initFromCSP (in nsIContentSecurityPolicy aCSP); */
NS_IMETHOD InitFromCSP(nsIContentSecurityPolicy *aCSP) = 0;
};
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPOLICYCONTAINER \
using nsIPolicyContainer::GetCsp; \
NS_IMETHOD GetCsp(nsIContentSecurityPolicy **aCsp) override; \
NS_IMETHOD InitFromCSP(nsIContentSecurityPolicy *aCSP) 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_NSIPOLICYCONTAINER \
using nsIPolicyContainer::GetCsp; \
nsresult GetCsp(nsIContentSecurityPolicy **aCsp); \
nsresult InitFromCSP(nsIContentSecurityPolicy *aCSP);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPOLICYCONTAINER(_to) \
using nsIPolicyContainer::GetCsp; \
NS_IMETHOD GetCsp(nsIContentSecurityPolicy **aCsp) override { return _to GetCsp(aCsp); } \
NS_IMETHOD InitFromCSP(nsIContentSecurityPolicy *aCSP) override { return _to InitFromCSP(aCSP); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPOLICYCONTAINER(_to) \
NS_IMETHOD GetCsp(nsIContentSecurityPolicy **aCsp) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCsp(aCsp); } \
NS_IMETHOD InitFromCSP(nsIContentSecurityPolicy *aCSP) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InitFromCSP(aCSP); }
#endif /* __gen_nsIPolicyContainer_h__ */