/* THIS FILE IS AUTOGENERATED FROM ProfileTimelineMarker.webidl BY Codegen.py - DO NOT EDIT */

#ifndef mozilla_dom_ProfileTimelineMarkerBinding_h
#define mozilla_dom_ProfileTimelineMarkerBinding_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 NativePropertyHooks;
struct ProfileTimelineLayerRect;
struct ProfileTimelineLayerRectAtoms;
struct ProfileTimelineMarkerAtoms;
struct ProfileTimelineStackFrameAtoms;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

enum class ProfileTimelineMessagePortOperationType : uint32_t {
  SerializeData,
  DeserializeData,
  EndGuard_
};

namespace ProfileTimelineMessagePortOperationTypeValues {
extern const EnumEntry strings[3];
} // namespace ProfileTimelineMessagePortOperationTypeValues

bool
ToJSValue(JSContext* aCx, ProfileTimelineMessagePortOperationType aArgument, JS::MutableHandle<JS::Value> aValue);


enum class ProfileTimelineWorkerOperationType : uint32_t {
  SerializeDataOffMainThread,
  SerializeDataOnMainThread,
  DeserializeDataOffMainThread,
  DeserializeDataOnMainThread,
  EndGuard_
};

namespace ProfileTimelineWorkerOperationTypeValues {
extern const EnumEntry strings[5];
} // namespace ProfileTimelineWorkerOperationTypeValues

bool
ToJSValue(JSContext* aCx, ProfileTimelineWorkerOperationType aArgument, JS::MutableHandle<JS::Value> aValue);


struct ProfileTimelineLayerRect : public DictionaryBase
{
  MOZ_INIT_OUTSIDE_CTOR int32_t mHeight;
  MOZ_INIT_OUTSIDE_CTOR int32_t mWidth;
  MOZ_INIT_OUTSIDE_CTOR int32_t mX;
  MOZ_INIT_OUTSIDE_CTOR int32_t mY;

  ProfileTimelineLayerRect();

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

  explicit inline ProfileTimelineLayerRect(const ProfileTimelineLayerRect& 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 ProfileTimelineLayerRect& aOther);

private:
  static bool
  InitIds(JSContext* cx, ProfileTimelineLayerRectAtoms* atomsCache);
};

namespace binding_detail {
struct FastProfileTimelineLayerRect : public ProfileTimelineLayerRect
{
  inline FastProfileTimelineLayerRect()
    : ProfileTimelineLayerRect(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct ProfileTimelineStackFrame : public DictionaryBase
{
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mAsyncCause;
  MOZ_INIT_OUTSIDE_CTOR JSObject* mAsyncParent;
  MOZ_INIT_OUTSIDE_CTOR int32_t mColumn;
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mFunctionDisplayName;
  MOZ_INIT_OUTSIDE_CTOR Optional<int32_t> mLine;
  MOZ_INIT_OUTSIDE_CTOR JSObject* mParent;
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mSource;

  ProfileTimelineStackFrame();

  explicit inline ProfileTimelineStackFrame(const FastDictionaryInitializer& )
    : mAsyncParent(nullptr),
      mParent(nullptr)
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  ProfileTimelineStackFrame(const ProfileTimelineStackFrame&) = delete;
  void operator=(const ProfileTimelineStackFrame&) = delete;

  static bool
  InitIds(JSContext* cx, ProfileTimelineStackFrameAtoms* atomsCache);

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

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

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastProfileTimelineStackFrame : public ProfileTimelineStackFrame
{
  inline FastProfileTimelineStackFrame()
    : ProfileTimelineStackFrame(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct ProfileTimelineMarker : public DictionaryBase
{
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mCauseName;
  MOZ_INIT_OUTSIDE_CTOR double mEnd;
  MOZ_INIT_OUTSIDE_CTOR JSObject* mEndStack;
  MOZ_INIT_OUTSIDE_CTOR Optional<uint16_t> mEventPhase;
  MOZ_INIT_OUTSIDE_CTOR Optional<bool> mIsOffMainThread;
  MOZ_INIT_OUTSIDE_CTOR Optional<ProfileTimelineMessagePortOperationType> mMessagePortOperation;
  MOZ_INIT_OUTSIDE_CTOR nsString mName;
  MOZ_INIT_OUTSIDE_CTOR Optional<uint16_t> mProcessType;
  MOZ_INIT_OUTSIDE_CTOR Optional<Sequence<ProfileTimelineLayerRect>> mRectangles;
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mRestyleHint;
  MOZ_INIT_OUTSIDE_CTOR JSObject* mStack;
  MOZ_INIT_OUTSIDE_CTOR double mStart;
  MOZ_INIT_OUTSIDE_CTOR Optional<nsString> mType;
  MOZ_INIT_OUTSIDE_CTOR Optional<uint64_t> mUnixTime;
  MOZ_INIT_OUTSIDE_CTOR Optional<ProfileTimelineWorkerOperationType> mWorkerOperation;

  ProfileTimelineMarker();

  explicit inline ProfileTimelineMarker(const FastDictionaryInitializer& )
    : mEndStack(nullptr),
      mStack(nullptr)
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  ProfileTimelineMarker(const ProfileTimelineMarker&) = delete;
  void operator=(const ProfileTimelineMarker&) = delete;

  static bool
  InitIds(JSContext* cx, ProfileTimelineMarkerAtoms* atomsCache);

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

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

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastProfileTimelineMarker : public ProfileTimelineMarker
{
  inline FastProfileTimelineMarker()
    : ProfileTimelineMarker(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_ProfileTimelineMarkerBinding_h
