/* 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
{
  int32_t mHeight;
  int32_t mWidth;
  int32_t mX;
  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
{
  Optional<nsString> mAsyncCause;
  JSObject* mAsyncParent;
  int32_t mColumn;
  Optional<nsString> mFunctionDisplayName;
  Optional<int32_t> mLine;
  JSObject* mParent;
  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
  Init(const nsAString& aJSON);

  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
{
  Optional<nsString> mCauseName;
  double mEnd;
  JSObject* mEndStack;
  Optional<uint16_t> mEventPhase;
  Optional<bool> mIsOffMainThread;
  Optional<ProfileTimelineMessagePortOperationType> mMessagePortOperation;
  nsString mName;
  Optional<uint16_t> mProcessType;
  Optional<Sequence<ProfileTimelineLayerRect>> mRectangles;
  Optional<nsString> mRestyleHint;
  JSObject* mStack;
  double mStart;
  Optional<nsString> mType;
  Optional<uint64_t> mUnixTime;
  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
  Init(const nsAString& aJSON);

  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
