Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM Cache.webidl BY Codegen.py - DO NOT EDIT */
#ifndef DOM_CACHEBINDING_H_
#define DOM_CACHEBINDING_H_
#include "js/CallAndConstruct.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/PrototypeList.h"
#include "mozilla/dom/Request.h"
#include "mozilla/dom/Response.h"
namespace mozilla {
namespace dom {
struct CacheBatchOperationAtoms;
struct CacheQueryOptions;
struct CacheQueryOptionsAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
class Request;
class Response;
namespace cache {
class Cache;
} // namespace cache
} // namespace dom
} // namespace mozilla
namespace mozilla::dom {
struct CacheQueryOptions : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR bool mIgnoreMethod;
MOZ_INIT_OUTSIDE_CTOR bool mIgnoreSearch;
MOZ_INIT_OUTSIDE_CTOR bool mIgnoreVary;
CacheQueryOptions();
explicit inline CacheQueryOptions(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CacheQueryOptions(CacheQueryOptions&& aOther) = default;
explicit inline CacheQueryOptions(const CacheQueryOptions& aOther)
{
*this = aOther;
}
bool
Init(BindingCallContext& cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
bool
Init(JSContext* cx_, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
CacheQueryOptions&
operator=(const CacheQueryOptions& aOther);
bool
operator==(const CacheQueryOptions& aOther) const;
private:
static bool
InitIds(JSContext* cx, CacheQueryOptionsAtoms* atomsCache);
};
namespace binding_detail {
struct FastCacheQueryOptions : public CacheQueryOptions
{
inline FastCacheQueryOptions()
: CacheQueryOptions(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
struct CacheBatchOperation : public DictionaryBase
{
MOZ_INIT_OUTSIDE_CTOR Optional<CacheQueryOptions> mOptions;
MOZ_INIT_OUTSIDE_CTOR Optional<OwningNonNull<mozilla::dom::Request>> mRequest;
MOZ_INIT_OUTSIDE_CTOR Optional<OwningNonNull<mozilla::dom::Response>> mResponse;
MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mType;
CacheBatchOperation();
explicit inline CacheBatchOperation(const FastDictionaryInitializer& )
{
// Do nothing here; this is used by our "Fast" subclass
}
CacheBatchOperation(CacheBatchOperation&& aOther) = default;
explicit inline CacheBatchOperation(const CacheBatchOperation& aOther)
{
*this = aOther;
}
bool
Init(const char* sourceDescription = "Value", bool passedToJSImpl = false);
void
TraceDictionary(JSTracer* trc);
inline void
TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags)
{
ImplCycleCollectionTraverse(aCallback, mRequest, "mRequest", aFlags);
ImplCycleCollectionTraverse(aCallback, mResponse, "mResponse", aFlags);
}
inline void
UnlinkForCC()
{
ImplCycleCollectionUnlink(mRequest);
ImplCycleCollectionUnlink(mResponse);
}
CacheBatchOperation&
operator=(const CacheBatchOperation& aOther);
private:
static bool
InitIds(JSContext* cx, CacheBatchOperationAtoms* atomsCache);
};
namespace binding_detail {
struct FastCacheBatchOperation : public CacheBatchOperation
{
inline FastCacheBatchOperation()
: CacheBatchOperation(FastDictionaryInitializer())
{
// Doesn't matter what int we pass to the parent constructor
}
};
} // namespace binding_detail
namespace Cache_Binding {
typedef mozilla::dom::cache::Cache NativeType;
bool
ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);
bool
Wrap(JSContext* aCx, mozilla::dom::cache::Cache* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
template <class T>
inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
{
JS::Rooted<JSObject*> reflector(aCx);
return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
}
void
CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx)
{
/* Get the interface prototype object for this class. This will create the
object as needed. */
return GetPerInterfaceObjectHandle(aCx, prototypes::id::Cache,
&CreateInterfaceObjects,
/* aDefineOnGlobal = */ true);
}
inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true)
{
/* Get the interface object for this class. This will create the object as
needed. */
return GetPerInterfaceObjectHandle(aCx, constructors::id::Cache,
&CreateInterfaceObjects,
aDefineOnGlobal);
}
JSObject*
GetConstructorObject(JSContext* aCx);
} // namespace Cache_Binding
} // namespace mozilla::dom
#endif // DOM_CACHEBINDING_H_