dom/base/nsIJSNativeInitializer.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/base/nsIJSNativeInitializer.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsIJSNativeInitializer_h__
    1.10 +#define nsIJSNativeInitializer_h__
    1.11 +
    1.12 +#include "nsISupports.h"
    1.13 +
    1.14 +#define NS_IJSNATIVEINITIALIZER_IID \
    1.15 +{ 0xdb48eee5, 0x89a4, 0x4f18,       \
    1.16 +  { 0x86, 0xd0, 0x4c, 0x4e, 0x9d, 0x4b, 0xf8, 0x7e } }
    1.17 +
    1.18 +
    1.19 +/**
    1.20 + * A JavaScript specific interface used to initialize new
    1.21 + * native objects, created as a result of calling a
    1.22 + * JavaScript constructor. The arguments are passed in
    1.23 + * their raw form as JS::Value's.
    1.24 + */
    1.25 +
    1.26 +class nsIJSNativeInitializer : public nsISupports {
    1.27 +public:
    1.28 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IJSNATIVEINITIALIZER_IID)
    1.29 +
    1.30 +  /**
    1.31 +   * Initialize a newly created native instance using the owner of the
    1.32 +   * constructor and the parameters passed into the JavaScript constructor.
    1.33 +   */
    1.34 +  NS_IMETHOD Initialize(nsISupports* aOwner, JSContext *cx, JSObject *obj,
    1.35 +                        const JS::CallArgs& args) = 0;
    1.36 +};
    1.37 +
    1.38 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIJSNativeInitializer,
    1.39 +                              NS_IJSNATIVEINITIALIZER_IID)
    1.40 +
    1.41 +#endif // nsIJSNativeInitializer_h__

mercurial