/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_NetDashboardBinding_h__
#define mozilla_dom_NetDashboardBinding_h__

#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/DOMJSClass.h"
#include "mozilla/dom/DOMJSProxyHandler.h"

class XPCWrappedNativeScope;

namespace mozilla {
namespace dom {

struct DNSCacheDict : public MainThreadDictionaryBase {
  DNSCacheDict() {}
  bool Init(JSContext* cx, JS::Handle<JSObject*> scopeObj, const JS::Value& val);
  bool ToObject(JSContext* cx, JSObject* parentObject, JS::Value *vp);

  bool Init(const nsAString& aJSON)
  {
    Maybe<JSAutoRequest> ar;
    Maybe<JSAutoCompartment> ac;
    Maybe< JS::Rooted<JS::Value> > json;
    JSContext* cx = ParseJSON(aJSON, ar, ac, json);
    NS_ENSURE_TRUE(cx, false);
    return Init(cx, JS::NullPtr(), json.ref());
  }

  Optional<Sequence<double > > mExpiration;
  Optional<Sequence<nsString > > mFamily;
  Optional<Sequence<Sequence<nsString > > > mHostaddr;
  Optional<Sequence<nsString > > mHostname;
private:
  // Disallow copy-construction
  DNSCacheDict(const DNSCacheDict&) MOZ_DELETE;
  static bool InitIds(JSContext* cx);
  static bool initedIds;
  static jsid expiration_id;
  static jsid family_id;
  static jsid hostaddr_id;
  static jsid hostname_id;
};
struct DNSCacheDictInitializer : public DNSCacheDict {
  DNSCacheDictInitializer() {
    // Safe to pass a null context if we pass a null value
    Init(nullptr, JS::NullPtr(), JS::NullValue());
  }
};

struct HttpConnInfoDict : public MainThreadDictionaryBase {
  HttpConnInfoDict() {}
  bool Init(JSContext* cx, JS::Handle<JSObject*> scopeObj, const JS::Value& val);
  bool ToObject(JSContext* cx, JSObject* parentObject, JS::Value *vp);

  bool Init(const nsAString& aJSON)
  {
    Maybe<JSAutoRequest> ar;
    Maybe<JSAutoCompartment> ac;
    Maybe< JS::Rooted<JS::Value> > json;
    JSContext* cx = ParseJSON(aJSON, ar, ac, json);
    NS_ENSURE_TRUE(cx, false);
    return Init(cx, JS::NullPtr(), json.ref());
  }

  Optional<Sequence<uint32_t > > mRtt;
  Optional<Sequence<uint32_t > > mTtl;
private:
  // Disallow copy-construction
  HttpConnInfoDict(const HttpConnInfoDict&) MOZ_DELETE;
  static bool InitIds(JSContext* cx);
  static bool initedIds;
  static jsid rtt_id;
  static jsid ttl_id;
};
struct HttpConnInfoDictInitializer : public HttpConnInfoDict {
  HttpConnInfoDictInitializer() {
    // Safe to pass a null context if we pass a null value
    Init(nullptr, JS::NullPtr(), JS::NullValue());
  }
};

struct SocketsDict : public MainThreadDictionaryBase {
  SocketsDict() {}
  bool Init(JSContext* cx, JS::Handle<JSObject*> scopeObj, const JS::Value& val);
  bool ToObject(JSContext* cx, JSObject* parentObject, JS::Value *vp);

  bool Init(const nsAString& aJSON)
  {
    Maybe<JSAutoRequest> ar;
    Maybe<JSAutoCompartment> ac;
    Maybe< JS::Rooted<JS::Value> > json;
    JSContext* cx = ParseJSON(aJSON, ar, ac, json);
    NS_ENSURE_TRUE(cx, false);
    return Init(cx, JS::NullPtr(), json.ref());
  }

  Optional<Sequence<bool > > mActive;
  Optional<Sequence<nsString > > mHost;
  Optional<Sequence<uint32_t > > mPort;
  double mReceived;
  double mSent;
  Optional<Sequence<double > > mSockreceived;
  Optional<Sequence<double > > mSocksent;
  Optional<Sequence<uint32_t > > mTcp;
private:
  // Disallow copy-construction
  SocketsDict(const SocketsDict&) MOZ_DELETE;
  static bool InitIds(JSContext* cx);
  static bool initedIds;
  static jsid active_id;
  static jsid host_id;
  static jsid port_id;
  static jsid received_id;
  static jsid sent_id;
  static jsid sockreceived_id;
  static jsid socksent_id;
  static jsid tcp_id;
};
struct SocketsDictInitializer : public SocketsDict {
  SocketsDictInitializer() {
    // Safe to pass a null context if we pass a null value
    Init(nullptr, JS::NullPtr(), JS::NullValue());
  }
};

struct WebSocketDict : public MainThreadDictionaryBase {
  WebSocketDict() {}
  bool Init(JSContext* cx, JS::Handle<JSObject*> scopeObj, const JS::Value& val);
  bool ToObject(JSContext* cx, JSObject* parentObject, JS::Value *vp);

  bool Init(const nsAString& aJSON)
  {
    Maybe<JSAutoRequest> ar;
    Maybe<JSAutoCompartment> ac;
    Maybe< JS::Rooted<JS::Value> > json;
    JSContext* cx = ParseJSON(aJSON, ar, ac, json);
    NS_ENSURE_TRUE(cx, false);
    return Init(cx, JS::NullPtr(), json.ref());
  }

  Optional<Sequence<bool > > mEncrypted;
  Optional<Sequence<nsString > > mHostport;
  Optional<Sequence<uint32_t > > mMsgreceived;
  Optional<Sequence<uint32_t > > mMsgsent;
  Optional<Sequence<double > > mReceivedsize;
  Optional<Sequence<double > > mSentsize;
private:
  // Disallow copy-construction
  WebSocketDict(const WebSocketDict&) MOZ_DELETE;
  static bool InitIds(JSContext* cx);
  static bool initedIds;
  static jsid encrypted_id;
  static jsid hostport_id;
  static jsid msgreceived_id;
  static jsid msgsent_id;
  static jsid receivedsize_id;
  static jsid sentsize_id;
};
struct WebSocketDictInitializer : public WebSocketDict {
  WebSocketDictInitializer() {
    // Safe to pass a null context if we pass a null value
    Init(nullptr, JS::NullPtr(), JS::NullValue());
  }
};

struct HttpConnDict : public MainThreadDictionaryBase {
  HttpConnDict() {}
  bool Init(JSContext* cx, JS::Handle<JSObject*> scopeObj, const JS::Value& val);
  bool ToObject(JSContext* cx, JSObject* parentObject, JS::Value *vp);

  bool Init(const nsAString& aJSON)
  {
    Maybe<JSAutoRequest> ar;
    Maybe<JSAutoCompartment> ac;
    Maybe< JS::Rooted<JS::Value> > json;
    JSContext* cx = ParseJSON(aJSON, ar, ac, json);
    NS_ENSURE_TRUE(cx, false);
    return Init(cx, JS::NullPtr(), json.ref());
  }

  Optional<Sequence<HttpConnInfoDict > > mActive;
  Optional<Sequence<nsString > > mHost;
  Optional<Sequence<HttpConnInfoDict > > mIdle;
  Optional<Sequence<uint32_t > > mPort;
  Optional<Sequence<bool > > mSpdy;
  Optional<Sequence<bool > > mSsl;
private:
  // Disallow copy-construction
  HttpConnDict(const HttpConnDict&) MOZ_DELETE;
  static bool InitIds(JSContext* cx);
  static bool initedIds;
  static jsid active_id;
  static jsid host_id;
  static jsid idle_id;
  static jsid port_id;
  static jsid spdy_id;
  static jsid ssl_id;
};
struct HttpConnDictInitializer : public HttpConnDict {
  HttpConnDictInitializer() {
    // Safe to pass a null context if we pass a null value
    Init(nullptr, JS::NullPtr(), JS::NullValue());
  }
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_NetDashboardBinding_h__
