1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 sw=2 et tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsDOMClassInfo_h___
8 #define nsDOMClassInfo_h___
10 #include "mozilla/Attributes.h"
11 #include "nsIDOMClassInfo.h"
12 #include "nsIXPCScriptable.h"
14 #include "nsIScriptSecurityManager.h"
15 #include "nsIScriptContext.h"
16 #include "nsDOMJSUtils.h" // for GetScriptContextFromJSContext
17 #include "nsIScriptGlobalObject.h"
18 #include "xpcpublic.h"
19 #include "nsIRunnable.h"
30 class nsNPAPIPluginInstance
;
31 class nsObjectLoadingContent
;
32 class nsIObjectLoadingContent
;
35 #ifndef MOZ_DISABLE_CRYPTOLEGACY
36 class nsIDOMCRMFObject
;
39 struct nsDOMClassInfoData
;
41 typedef nsIClassInfo
* (*nsDOMClassInfoConstructorFnc
)
42 (nsDOMClassInfoData
* aData
);
44 typedef nsresult (*nsDOMConstructorFunc
)(nsISupports
** aNewObject
);
46 struct nsDOMClassInfoData
49 const PRUnichar
*mNameUTF16
;
51 nsDOMClassInfoConstructorFnc mConstructorFptr
;
52 nsDOMClassInfoExternalConstructorFnc mExternalConstructorFptr
;
55 nsIClassInfo
*mCachedClassInfo
; // low bit is set to 1 if external,
56 // so be sure to mask if necessary!
57 const nsIID
*mProtoChainInterface
;
58 const nsIID
**mInterfaces
;
59 uint32_t mScriptableFlags
: 31; // flags must not use more than 31 bits!
60 uint32_t mHasClassInterface
: 1;
61 uint32_t mInterfacesBitmap
;
69 struct nsExternalDOMClassInfoData
: public nsDOMClassInfoData
71 const nsCID
*mConstructorCID
;
75 // To be used with the nsDOMClassInfoData::mCachedClassInfo pointer.
76 // The low bit is set when we created a generic helper for an external
77 // (which holds on to the nsDOMClassInfoData).
78 #define GET_CLEAN_CI_PTR(_ptr) (nsIClassInfo*)(uintptr_t(_ptr) & ~0x1)
79 #define MARK_EXTERNAL(_ptr) (nsIClassInfo*)(uintptr_t(_ptr) | 0x1)
80 #define IS_EXTERNAL(_ptr) (uintptr_t(_ptr) & 0x1)
83 class nsDOMClassInfo
: public nsXPCClassInfo
85 friend class nsHTMLDocumentSH
;
87 nsDOMClassInfo(nsDOMClassInfoData
* aData
);
88 virtual ~nsDOMClassInfo();
90 NS_DECL_NSIXPCSCRIPTABLE
96 // Helper method that returns a *non* refcounted pointer to a
97 // helper. So please note, don't release this pointer, if you do,
98 // you better make sure you've addreffed before release.
100 // Whaaaaa! I wanted to name this method GetClassInfo, but nooo,
101 // some of Microsoft devstudio's headers #defines GetClassInfo to
102 // GetClassInfoA so I can't, those $%#@^! bastards!!! What gives
103 // them the right to do that?
105 static nsIClassInfo
* GetClassInfoInstance(nsDOMClassInfoData
* aData
);
107 static void ShutDown();
109 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
111 return new nsDOMClassInfo(aData
);
115 * The following two functions exist because of the way that Xray wrappers
116 * work. In order to allow scriptable helpers to define non-IDL defined but
117 * still "safe" properties for Xray wrappers, we call into the scriptable
118 * helper with |obj| being the wrapper.
120 * Ideally, that would be the end of the story, however due to complications
121 * dealing with document.domain, it's possible to end up in a scriptable
122 * helper with a wrapper, even though we should be treating the lookup as a
125 * Note: So ObjectIsNativeWrapper(cx, obj) check usually means "through xray
126 * wrapper this part is not visible" while combined with
127 * || xpc::WrapperFactory::XrayWrapperNotShadowing(obj) it means "through
128 * xray wrapper it is visible only if it does not hide any native property."
130 static bool ObjectIsNativeWrapper(JSContext
* cx
, JSObject
* obj
);
132 static nsISupports
*GetNative(nsIXPConnectWrappedNative
*wrapper
, JSObject
*obj
);
134 static nsIXPConnect
*XPConnect()
140 friend nsIClassInfo
* NS_GetDOMClassInfoInstance(nsDOMClassInfoID aID
);
142 const nsDOMClassInfoData
* mData
;
144 virtual void PreserveWrapper(nsISupports
*aNative
) MOZ_OVERRIDE
148 virtual uint32_t GetInterfacesBitmap() MOZ_OVERRIDE
150 return mData
->mInterfacesBitmap
;
153 static nsresult
Init();
154 static nsresult
RegisterClassProtos(int32_t aDOMClassInfoID
);
155 static nsresult
RegisterExternalClasses();
156 nsresult
ResolveConstructor(JSContext
*cx
, JSObject
*obj
,
159 // Checks if id is a number and returns the number, if aIsNumber is
160 // non-null it's set to true if the id is a number and false if it's
161 // not a number. If id is not a number this method returns -1
162 static int32_t GetArrayIndexFromId(JSContext
*cx
, JS::Handle
<jsid
> id
,
163 bool *aIsNumber
= nullptr);
165 static inline bool IsReadonlyReplaceable(jsid id
)
167 return (id
== sParent_id
||
168 id
== sScrollbars_id
||
172 id
== sLocationbar_id
||
173 id
== sPersonalbar_id
||
174 id
== sStatusbar_id
||
175 id
== sControllers_id
||
178 id
== sScrollMaxX_id
||
179 id
== sScrollMaxY_id
||
185 static nsIXPConnect
*sXPConnect
;
186 static nsIScriptSecurityManager
*sSecMan
;
188 // nsIXPCScriptable code
189 static nsresult
DefineStaticJSVals(JSContext
*cx
);
191 static bool sIsInitialized
;
194 static jsid sParent_id
;
195 static jsid sScrollbars_id
;
196 static jsid sLocation_id
;
197 static jsid sConstructor_id
;
198 static jsid s_content_id
;
199 static jsid sContent_id
;
200 static jsid sMenubar_id
;
201 static jsid sToolbar_id
;
202 static jsid sLocationbar_id
;
203 static jsid sPersonalbar_id
;
204 static jsid sStatusbar_id
;
205 static jsid sControllers_id
;
206 static jsid sLength_id
;
207 static jsid sScrollX_id
;
208 static jsid sScrollY_id
;
209 static jsid sScrollMaxX_id
;
210 static jsid sScrollMaxY_id
;
211 static jsid sItem_id
;
212 static jsid sNamedItem_id
;
213 static jsid sEnumerate_id
;
214 static jsid sNavigator_id
;
216 static jsid sDocument_id
;
217 static jsid sFrames_id
;
218 static jsid sSelf_id
;
219 static jsid sJava_id
;
220 static jsid sWrappedJSObject_id
;
223 // THIS ONE ISN'T SAFE!! It assumes that the private of the JSObject is
226 const nsQueryInterface
227 do_QueryWrappedNative(nsIXPConnectWrappedNative
*wrapper
, JSObject
*obj
)
229 return nsQueryInterface(nsDOMClassInfo::GetNative(wrapper
, obj
));
232 // THIS ONE ISN'T SAFE!! It assumes that the private of the JSObject is
235 const nsQueryInterfaceWithError
236 do_QueryWrappedNative(nsIXPConnectWrappedNative
*wrapper
, JSObject
*obj
,
240 return nsQueryInterfaceWithError(nsDOMClassInfo::GetNative(wrapper
, obj
),
246 do_QueryWrapper(JSContext
*cx
, JSObject
*obj
)
248 nsISupports
*native
=
249 nsDOMClassInfo::XPConnect()->GetNativeOfWrapper(cx
, obj
);
250 return nsQueryInterface(native
);
254 nsQueryInterfaceWithError
255 do_QueryWrapper(JSContext
*cx
, JSObject
*obj
, nsresult
* error
)
257 nsISupports
*native
=
258 nsDOMClassInfo::XPConnect()->GetNativeOfWrapper(cx
, obj
);
259 return nsQueryInterfaceWithError(native
, error
);
263 typedef nsDOMClassInfo nsDOMGenericSH
;
265 // Makes sure that the wrapper is preserved if new properties are added.
266 class nsEventTargetSH
: public nsDOMGenericSH
269 nsEventTargetSH(nsDOMClassInfoData
* aData
) : nsDOMGenericSH(aData
)
273 virtual ~nsEventTargetSH()
277 NS_IMETHOD
PreCreate(nsISupports
*nativeObj
, JSContext
*cx
,
278 JSObject
*globalObj
, JSObject
**parentObj
) MOZ_OVERRIDE
;
279 NS_IMETHOD
AddProperty(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
280 JSObject
*obj
, jsid id
, jsval
*vp
, bool *_retval
) MOZ_OVERRIDE
;
282 virtual void PreserveWrapper(nsISupports
*aNative
) MOZ_OVERRIDE
;
284 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
286 return new nsEventTargetSH(aData
);
290 // Window scriptable helper
292 class nsWindowSH
: public nsDOMGenericSH
295 nsWindowSH(nsDOMClassInfoData
*aData
) : nsDOMGenericSH(aData
)
299 virtual ~nsWindowSH()
303 static nsresult
GlobalResolve(nsGlobalWindow
*aWin
, JSContext
*cx
,
304 JS::Handle
<JSObject
*> obj
, JS::Handle
<jsid
> id
,
308 NS_IMETHOD
PreCreate(nsISupports
*nativeObj
, JSContext
*cx
,
309 JSObject
*globalObj
, JSObject
**parentObj
) MOZ_OVERRIDE
;
311 NS_IMETHOD
PostCreate(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
312 JSObject
*obj
) MOZ_OVERRIDE
314 nsCOMPtr
<nsIScriptGlobalObject
> sgo(do_QueryWrappedNative(wrapper
));
316 NS_ASSERTION(!sgo
|| sgo
->GetGlobalJSObject() == nullptr,
317 "Multiple wrappers created for global object!");
321 virtual uint32_t GetScriptableFlags() MOZ_OVERRIDE
323 return nsDOMGenericSH::GetScriptableFlags() |
324 nsIXPCScriptable::WANT_POSTCREATE
;
327 NS_IMETHOD
Enumerate(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
328 JSObject
*obj
, bool *_retval
) MOZ_OVERRIDE
;
329 NS_IMETHOD
NewResolve(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
330 JSObject
*obj
, jsid id
, uint32_t flags
,
331 JSObject
**objp
, bool *_retval
) MOZ_OVERRIDE
;
332 NS_IMETHOD
Finalize(nsIXPConnectWrappedNative
*wrapper
, JSFreeOp
*fop
,
333 JSObject
*obj
) MOZ_OVERRIDE
;
334 NS_IMETHOD
OuterObject(nsIXPConnectWrappedNative
*wrapper
, JSContext
* cx
,
335 JSObject
* obj
, JSObject
* *_retval
) MOZ_OVERRIDE
;
337 static JSBool
GlobalScopePolluterNewResolve(JSContext
*cx
, JS::Handle
<JSObject
*> obj
,
338 JS::Handle
<jsid
> id
, unsigned flags
,
339 JS::MutableHandle
<JSObject
*> objp
);
340 static JSBool
GlobalScopePolluterGetProperty(JSContext
*cx
, JS::Handle
<JSObject
*> obj
,
341 JS::Handle
<jsid
> id
, JS::MutableHandle
<JS::Value
> vp
);
342 static JSBool
InvalidateGlobalScopePolluter(JSContext
*cx
,
343 JS::Handle
<JSObject
*> obj
);
344 static nsresult
InstallGlobalScopePolluter(JSContext
*cx
,
345 JS::Handle
<JSObject
*> obj
);
346 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
348 return new nsWindowSH(aData
);
352 // Location scriptable helper
354 class nsLocationSH
: public nsDOMGenericSH
357 nsLocationSH(nsDOMClassInfoData
* aData
) : nsDOMGenericSH(aData
)
361 virtual ~nsLocationSH()
366 NS_IMETHOD
CheckAccess(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
367 JSObject
*obj
, jsid id
, uint32_t mode
,
368 jsval
*vp
, bool *_retval
) MOZ_OVERRIDE
;
370 NS_IMETHOD
PreCreate(nsISupports
*nativeObj
, JSContext
*cx
,
371 JSObject
*globalObj
, JSObject
**parentObj
) MOZ_OVERRIDE
;
372 NS_IMETHODIMP
AddProperty(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
373 JSObject
*obj
, jsid id
, jsval
*vp
, bool *_retval
);
375 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
377 return new nsLocationSH(aData
);
382 // Navigator scriptable helper
384 class nsNavigatorSH
: public nsDOMGenericSH
387 nsNavigatorSH(nsDOMClassInfoData
* aData
) : nsDOMGenericSH(aData
)
391 virtual ~nsNavigatorSH()
396 NS_IMETHOD
PreCreate(nsISupports
*nativeObj
, JSContext
*cx
,
397 JSObject
*globalObj
, JSObject
**parentObj
) MOZ_OVERRIDE
;
398 NS_IMETHOD
NewResolve(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
399 JSObject
*obj
, jsid id
, uint32_t flags
,
400 JSObject
**objp
, bool *_retval
) MOZ_OVERRIDE
;
402 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
404 return new nsNavigatorSH(aData
);
408 // Generic array scriptable helper
410 class nsGenericArraySH
: public nsDOMClassInfo
413 nsGenericArraySH(nsDOMClassInfoData
* aData
) : nsDOMClassInfo(aData
)
417 virtual ~nsGenericArraySH()
422 NS_IMETHOD
NewResolve(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
423 JSObject
*obj
, jsid id
, uint32_t flags
,
424 JSObject
**objp
, bool *_retval
) MOZ_OVERRIDE
;
425 NS_IMETHOD
Enumerate(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
426 JSObject
*obj
, bool *_retval
) MOZ_OVERRIDE
;
428 virtual nsresult
GetLength(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
429 JSObject
*obj
, uint32_t *length
);
431 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
433 return new nsGenericArraySH(aData
);
438 // Array scriptable helper
440 class nsArraySH
: public nsGenericArraySH
443 nsArraySH(nsDOMClassInfoData
* aData
) : nsGenericArraySH(aData
)
451 // Subclasses need to override this, if the implementation can't fail it's
452 // allowed to not set *aResult.
453 virtual nsISupports
* GetItemAt(nsISupports
*aNative
, uint32_t aIndex
,
454 nsWrapperCache
**aCache
, nsresult
*aResult
) = 0;
457 NS_IMETHOD
GetProperty(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
458 JSObject
*obj
, jsid id
, jsval
*vp
, bool *_retval
) MOZ_OVERRIDE
;
461 // Not implemented, nothing should create an instance of this class.
462 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
);
468 class nsNamedArraySH
: public nsArraySH
471 nsNamedArraySH(nsDOMClassInfoData
* aData
) : nsArraySH(aData
)
475 virtual ~nsNamedArraySH()
479 NS_IMETHOD
NewResolve(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
480 JSObject
*obj
, jsid id
, uint32_t flags
,
481 JSObject
**objp
, bool *_retval
) MOZ_OVERRIDE
;
483 virtual nsISupports
* GetNamedItem(nsISupports
*aNative
,
484 const nsAString
& aName
,
485 nsWrapperCache
**cache
,
486 nsresult
*aResult
) = 0;
489 NS_IMETHOD
GetProperty(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
490 JSObject
*obj
, jsid id
, jsval
*vp
, bool *_retval
) MOZ_OVERRIDE
;
493 // Not implemented, nothing should create an instance of this class.
494 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
);
500 extern JSClass sHTMLDocumentAllClass
;
502 class nsHTMLDocumentSH
505 static JSBool
GetDocumentAllNodeList(JSContext
*cx
, JS::Handle
<JSObject
*> obj
,
507 nsContentList
**nodeList
);
509 static JSBool
DocumentAllGetProperty(JSContext
*cx
, JS::Handle
<JSObject
*> obj
, JS::Handle
<jsid
> id
,
510 JS::MutableHandle
<JS::Value
> vp
);
511 static JSBool
DocumentAllNewResolve(JSContext
*cx
, JS::Handle
<JSObject
*> obj
, JS::Handle
<jsid
> id
,
512 unsigned flags
, JS::MutableHandle
<JSObject
*> objp
);
513 static void ReleaseDocument(JSFreeOp
*fop
, JSObject
*obj
);
514 static JSBool
CallToGetPropMapper(JSContext
*cx
, unsigned argc
, jsval
*vp
);
518 // String array helper
520 class nsStringArraySH
: public nsGenericArraySH
523 nsStringArraySH(nsDOMClassInfoData
* aData
) : nsGenericArraySH(aData
)
527 virtual ~nsStringArraySH()
531 virtual nsresult
GetStringAt(nsISupports
*aNative
, int32_t aIndex
,
532 nsAString
& aResult
) = 0;
535 NS_IMETHOD
GetProperty(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
536 JSObject
*obj
, jsid id
, jsval
*vp
, bool *_retval
) MOZ_OVERRIDE
;
542 class nsHistorySH
: public nsStringArraySH
545 nsHistorySH(nsDOMClassInfoData
* aData
) : nsStringArraySH(aData
)
549 virtual ~nsHistorySH()
553 virtual nsresult
GetStringAt(nsISupports
*aNative
, int32_t aIndex
,
554 nsAString
& aResult
) MOZ_OVERRIDE
;
557 NS_IMETHOD
PreCreate(nsISupports
*nativeObj
, JSContext
*cx
,
558 JSObject
*globalObj
, JSObject
**parentObj
) MOZ_OVERRIDE
;
559 NS_IMETHOD
GetProperty(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
560 JSObject
*obj
, jsid id
, jsval
*vp
, bool *_retval
) MOZ_OVERRIDE
;
562 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
564 return new nsHistorySH(aData
);
568 // StringList scriptable helper
570 class nsStringListSH
: public nsStringArraySH
573 nsStringListSH(nsDOMClassInfoData
* aData
) : nsStringArraySH(aData
)
577 virtual ~nsStringListSH()
581 virtual nsresult
GetStringAt(nsISupports
*aNative
, int32_t aIndex
,
582 nsAString
& aResult
) MOZ_OVERRIDE
;
585 // Inherit GetProperty, Enumerate from nsStringArraySH
587 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
589 return new nsStringListSH(aData
);
596 class nsMediaListSH
: public nsStringArraySH
599 nsMediaListSH(nsDOMClassInfoData
* aData
) : nsStringArraySH(aData
)
603 virtual ~nsMediaListSH()
607 virtual nsresult
GetStringAt(nsISupports
*aNative
, int32_t aIndex
,
608 nsAString
& aResult
) MOZ_OVERRIDE
;
611 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
613 return new nsMediaListSH(aData
);
618 // StyleSheetList helper
620 class nsStyleSheetListSH
: public nsArraySH
623 nsStyleSheetListSH(nsDOMClassInfoData
* aData
) : nsArraySH(aData
)
627 virtual ~nsStyleSheetListSH()
631 virtual nsISupports
* GetItemAt(nsISupports
*aNative
, uint32_t aIndex
,
632 nsWrapperCache
**aCache
, nsresult
*aResult
) MOZ_OVERRIDE
;
635 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
637 return new nsStyleSheetListSH(aData
);
642 // CSSRuleList helper
644 class nsCSSRuleListSH
: public nsArraySH
647 nsCSSRuleListSH(nsDOMClassInfoData
* aData
) : nsArraySH(aData
)
651 virtual ~nsCSSRuleListSH()
655 virtual nsISupports
* GetItemAt(nsISupports
*aNative
, uint32_t aIndex
,
656 nsWrapperCache
**aCache
, nsresult
*aResult
) MOZ_OVERRIDE
;
659 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
661 return new nsCSSRuleListSH(aData
);
665 // WebApps Storage helpers
667 class nsStorage2SH
: public nsDOMGenericSH
670 nsStorage2SH(nsDOMClassInfoData
* aData
) : nsDOMGenericSH(aData
)
674 virtual ~nsStorage2SH()
678 NS_IMETHOD
NewResolve(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
679 JSObject
*obj
, jsid id
, uint32_t flags
,
680 JSObject
**objp
, bool *_retval
) MOZ_OVERRIDE
;
681 NS_IMETHOD
SetProperty(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
682 JSObject
*obj
, jsid id
, jsval
*vp
, bool *_retval
) MOZ_OVERRIDE
;
683 NS_IMETHOD
GetProperty(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
684 JSObject
*obj
, jsid id
, jsval
*vp
, bool *_retval
) MOZ_OVERRIDE
;
685 NS_IMETHOD
DelProperty(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
686 JSObject
*obj
, jsid id
, bool *_retval
) MOZ_OVERRIDE
;
687 NS_IMETHOD
NewEnumerate(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
688 JSObject
*obj
, uint32_t enum_op
, jsval
*statep
,
689 jsid
*idp
, bool *_retval
) MOZ_OVERRIDE
;
692 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
694 return new nsStorage2SH(aData
);
698 // Event handler 'this' translator class, this is called by XPConnect
699 // when a "function interface" (nsIDOMEventListener) is called, this
700 // class extracts 'this' fomr the first argument to the called
701 // function (nsIDOMEventListener::HandleEvent(in nsIDOMEvent)), this
702 // class will pass back nsIDOMEvent::currentTarget to be used as
705 class nsEventListenerThisTranslator
: public nsIXPCFunctionThisTranslator
708 nsEventListenerThisTranslator()
712 virtual ~nsEventListenerThisTranslator()
719 // nsIXPCFunctionThisTranslator
720 NS_DECL_NSIXPCFUNCTIONTHISTRANSLATOR
723 class nsDOMConstructorSH
: public nsDOMGenericSH
726 nsDOMConstructorSH(nsDOMClassInfoData
* aData
) : nsDOMGenericSH(aData
)
731 NS_IMETHOD
PreCreate(nsISupports
*nativeObj
, JSContext
*cx
,
732 JSObject
*globalObj
, JSObject
**parentObj
) MOZ_OVERRIDE
;
733 NS_IMETHOD
PostCreatePrototype(JSContext
* cx
, JSObject
* proto
) MOZ_OVERRIDE
737 NS_IMETHOD
NewResolve(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
738 JSObject
*obj
, jsid id
, uint32_t flags
,
739 JSObject
**objp
, bool *_retval
) MOZ_OVERRIDE
;
740 NS_IMETHOD
Call(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
741 JSObject
*obj
, const JS::CallArgs
&args
, bool *_retval
) MOZ_OVERRIDE
;
743 NS_IMETHOD
Construct(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
744 JSObject
*obj
, const JS::CallArgs
&args
, bool *_retval
) MOZ_OVERRIDE
;
746 NS_IMETHOD
HasInstance(nsIXPConnectWrappedNative
*wrapper
, JSContext
*cx
,
747 JSObject
*obj
, const jsval
&val
, bool *bp
,
750 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
752 return new nsDOMConstructorSH(aData
);
756 class nsNonDOMObjectSH
: public nsDOMGenericSH
759 nsNonDOMObjectSH(nsDOMClassInfoData
* aData
) : nsDOMGenericSH(aData
)
763 virtual ~nsNonDOMObjectSH()
768 NS_IMETHOD
GetFlags(uint32_t *aFlags
) MOZ_OVERRIDE
;
770 static nsIClassInfo
*doCreate(nsDOMClassInfoData
* aData
)
772 return new nsNonDOMObjectSH(aData
);
776 #endif /* nsDOMClassInfo_h___ */