dom/base/nsIJSNativeInitializer.h
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 06 Sep 2012 11:41:02 +0900
changeset 104366 5d63594c05a9fa801fbbbc8adb38946d8fb77970
parent 102997 a16372ce30b5f6b747246b01fcd215a4bf3b6342
child 128718 9a6b56a3f24321dc656d91b817a5027864257a76
permissions -rw-r--r--
Bug 784912 - nsIStreamListener.onDataAvailable should handle 64-bit offset. r=honza

/* -*- 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 nsIJSNativeInitializer_h__
#define nsIJSNativeInitializer_h__

#include "nsISupports.h"
#include "jsapi.h"

#define NS_IJSNATIVEINITIALIZER_IID \
{ 0x536c5ad2, 0x1275, 0x4706,       \
  { 0x99, 0xbd, 0x4a, 0xef, 0xb2, 0x4a, 0xb7, 0xf7 } }

/**
 * A JavaScript specific interface used to initialize new
 * native objects, created as a result of calling a
 * JavaScript constructor. The arguments are passed in
 * their raw form as jsval's.
 */

class nsIJSNativeInitializer : public nsISupports {
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IJSNATIVEINITIALIZER_IID)

  /**
   * Initialize a newly created native instance using the owner of the
   * constructor and the parameters passed into the JavaScript constructor.
   */
  NS_IMETHOD Initialize(nsISupports* aOwner, JSContext *cx, JSObject *obj,
                        uint32_t argc, jsval *argv) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIJSNativeInitializer,
                              NS_IJSNATIVEINITIALIZER_IID)

#endif // nsIJSNativeInitializer_h__