tools/profiler/JSAObjectBuilder.h
author Peter Van der Beken <peterv@propagandism.org>
Thu, 06 Dec 2012 11:41:14 +0100
changeset 120775 f23cff8ec6c9ab4cac0c4582967647140855a625
parent 120185 b130bb991d84db729555ad5b837dc3c5eb1a74a7
permissions -rw-r--r--
Fix for bug 818219 (Replace HTMLElement quickstubs with new binding methods) - Add a constructor to callbacks to allow conversion between callback types. r=bz.

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef JSAOBJECTBUILDER_H
#define JSAOBJECTBUILDER_H

class JSCustomObject;
class JSCustomArray;
class nsAString;

class JSAObjectBuilder
{
public:
  virtual ~JSAObjectBuilder() = 0;

  virtual void DefineProperty(JSCustomObject *aObject, const char *name, JSCustomObject *aValue) = 0;
  virtual void DefineProperty(JSCustomObject *aObject, const char *name, JSCustomArray *aValue) = 0;
  virtual void DefineProperty(JSCustomObject *aObject, const char *name, int value) = 0;
  virtual void DefineProperty(JSCustomObject *aObject, const char *name, double value) = 0;
  virtual void DefineProperty(JSCustomObject *aObject, const char *name, const char *value) = 0;
  virtual void ArrayPush(JSCustomArray *aArray, int value) = 0;
  virtual void ArrayPush(JSCustomArray *aArray, const char *value) = 0;
  virtual void ArrayPush(JSCustomArray *aArray, JSCustomObject *aObject) = 0;
  virtual JSCustomArray  *CreateArray() = 0;
  virtual JSCustomObject *CreateObject() = 0;
};

#endif