Bug 21668. Use nsCOMPtr (or Linss-ptr) to get the nativeThis. r=shaver

This commit is contained in:
waterson%netscape.com 1999-12-17 00:11:03 +00:00
Родитель 9fd346a651
Коммит 03a15dfd82
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -986,8 +986,17 @@ static const char kMethodBeginNonPrimaryStr[] = "\n\n"
"PR_STATIC_CALLBACK(JSBool)\n"
"%s%s(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)\n"
"{\n"
" nsIDOM%s *privateThis = (nsIDOM%s*)nsJSUtils::nsGetNativeThis(cx, obj);\n"
" nsIDOM%s *nativeThis = nsnull;\n"
#ifdef USE_COMPTR
" nsCOMPtr<nsIDOM%s> nativeThis;\n"
#else
" nsIDOM%sPtr nativeThis = nsnull;\n"
#endif
" nsresult result = NS_OK;\n"
#ifdef USE_COMPTR
" if (NS_OK != privateThis->QueryInterface(kI%sIID, getter_AddRefs(nativeThis))) {\n"
#else
" if (NS_OK != privateThis->QueryInterface(kI%sIID, (void **)&nativeThis)) {\n"
#endif" nsIDOM%s *nativeThis = nsnull;\n"
" nsresult result = NS_OK;\n"
" if (NS_OK != privateThis->QueryInterface(kI%sIID, (void **)&nativeThis)) {\n"
" return nsJSUtils::nsReportError(cx, NS_ERROR_DOM_WRONG_TYPE_ERR);\n"