jsval can now be a parameter or return type. Got rid of unused variable warnings. Fixed secMan leak. Removed nsIDOMHTMLBlockQuote.h

This commit is contained in:
vidur%netscape.com 1999-08-27 06:11:39 +00:00
Родитель 4397f0e95f
Коммит e1502c33a7
116 изменённых файлов: 2041 добавлений и 1377 удалений

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

@ -34,21 +34,21 @@ class nsIDOMNSLocation : public nsISupports {
public:
static const nsIID& GetIID() { static nsIID iid = NS_IDOMNSLOCATION_IID; return iid; }
NS_IMETHOD Reload(JSContext *cx, jsval *argv, PRUint32 argc)=0;
NS_IMETHOD Reload(JSContext* cx, jsval* argv, PRUint32 argc)=0;
NS_IMETHOD Replace(JSContext *cx, jsval *argv, PRUint32 argc)=0;
NS_IMETHOD Replace(JSContext* cx, jsval* argv, PRUint32 argc)=0;
};
#define NS_DECL_IDOMNSLOCATION \
NS_IMETHOD Reload(JSContext *cx, jsval *argv, PRUint32 argc); \
NS_IMETHOD Replace(JSContext *cx, jsval *argv, PRUint32 argc); \
NS_IMETHOD Reload(JSContext* cx, jsval* argv, PRUint32 argc); \
NS_IMETHOD Replace(JSContext* cx, jsval* argv, PRUint32 argc); \
#define NS_FORWARD_IDOMNSLOCATION(_to) \
NS_IMETHOD Reload(JSContext *cx, jsval *argv, PRUint32 argc) { return _to Reload(cx, argv, argc); } \
NS_IMETHOD Replace(JSContext *cx, jsval *argv, PRUint32 argc) { return _to Replace(cx, argv, argc); } \
NS_IMETHOD Reload(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Reload(cx, argv, argc); } \
NS_IMETHOD Replace(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Replace(cx, argv, argc); } \
#endif // nsIDOMNSLocation_h__

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

@ -23,6 +23,7 @@
#include "nsISupports.h"
#include "nsString.h"
#include "nsIScriptContext.h"
#include "jsapi.h"
class nsIDOMPluginArray;
class nsIDOMMimeTypeArray;
@ -54,6 +55,10 @@ public:
NS_IMETHOD GetUserAgent(nsString& aUserAgent)=0;
NS_IMETHOD JavaEnabled(PRBool* aReturn)=0;
NS_IMETHOD TaintEnabled(PRBool* aReturn)=0;
NS_IMETHOD Preference(JSContext* cx, jsval* argv, PRUint32 argc, jsval* aReturn)=0;
};
@ -68,6 +73,8 @@ public:
NS_IMETHOD GetSecurityPolicy(nsString& aSecurityPolicy); \
NS_IMETHOD GetUserAgent(nsString& aUserAgent); \
NS_IMETHOD JavaEnabled(PRBool* aReturn); \
NS_IMETHOD TaintEnabled(PRBool* aReturn); \
NS_IMETHOD Preference(JSContext* cx, jsval* argv, PRUint32 argc, jsval* aReturn); \
@ -82,6 +89,8 @@ public:
NS_IMETHOD GetSecurityPolicy(nsString& aSecurityPolicy) { return _to GetSecurityPolicy(aSecurityPolicy); } \
NS_IMETHOD GetUserAgent(nsString& aUserAgent) { return _to GetUserAgent(aUserAgent); } \
NS_IMETHOD JavaEnabled(PRBool* aReturn) { return _to JavaEnabled(aReturn); } \
NS_IMETHOD TaintEnabled(PRBool* aReturn) { return _to TaintEnabled(aReturn); } \
NS_IMETHOD Preference(JSContext* cx, jsval* argv, PRUint32 argc, jsval* aReturn) { return _to Preference(cx, argv, argc, aReturn); } \
extern "C" NS_DOM nsresult NS_InitNavigatorClass(nsIScriptContext *aContext, void **aPrototype);

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

@ -116,11 +116,11 @@ public:
NS_IMETHOD Dump(const nsString& aStr)=0;
NS_IMETHOD Alert(JSContext *cx, jsval *argv, PRUint32 argc)=0;
NS_IMETHOD Alert(JSContext* cx, jsval* argv, PRUint32 argc)=0;
NS_IMETHOD Confirm(JSContext *cx, jsval *argv, PRUint32 argc, PRBool* aReturn)=0;
NS_IMETHOD Confirm(JSContext* cx, jsval* argv, PRUint32 argc, PRBool* aReturn)=0;
NS_IMETHOD Prompt(JSContext *cx, jsval *argv, PRUint32 argc, nsString& aReturn)=0;
NS_IMETHOD Prompt(JSContext* cx, jsval* argv, PRUint32 argc, nsString& aReturn)=0;
NS_IMETHOD Focus()=0;
@ -154,15 +154,15 @@ public:
NS_IMETHOD ClearInterval(PRInt32 aTimerID)=0;
NS_IMETHOD SetTimeout(JSContext *cx, jsval *argv, PRUint32 argc, PRInt32* aReturn)=0;
NS_IMETHOD SetTimeout(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn)=0;
NS_IMETHOD SetInterval(JSContext *cx, jsval *argv, PRUint32 argc, PRInt32* aReturn)=0;
NS_IMETHOD SetInterval(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn)=0;
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aAnchorAlignment, const nsString& aPopupAlignment, nsIDOMWindow** aReturn)=0;
NS_IMETHOD Open(JSContext *cx, jsval *argv, PRUint32 argc, nsIDOMWindow** aReturn)=0;
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn)=0;
NS_IMETHOD OpenDialog(JSContext *cx, jsval *argv, PRUint32 argc, nsIDOMWindow** aReturn)=0;
NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn)=0;
};
@ -210,9 +210,9 @@ public:
NS_IMETHOD GetPageYOffset(PRInt32* aPageYOffset); \
NS_IMETHOD SetPageYOffset(PRInt32 aPageYOffset); \
NS_IMETHOD Dump(const nsString& aStr); \
NS_IMETHOD Alert(JSContext *cx, jsval *argv, PRUint32 argc); \
NS_IMETHOD Confirm(JSContext *cx, jsval *argv, PRUint32 argc, PRBool* aReturn); \
NS_IMETHOD Prompt(JSContext *cx, jsval *argv, PRUint32 argc, nsString& aReturn); \
NS_IMETHOD Alert(JSContext* cx, jsval* argv, PRUint32 argc); \
NS_IMETHOD Confirm(JSContext* cx, jsval* argv, PRUint32 argc, PRBool* aReturn); \
NS_IMETHOD Prompt(JSContext* cx, jsval* argv, PRUint32 argc, nsString& aReturn); \
NS_IMETHOD Focus(); \
NS_IMETHOD Blur(); \
NS_IMETHOD Close(); \
@ -229,11 +229,11 @@ public:
NS_IMETHOD ScrollBy(PRInt32 aXScrollDif, PRInt32 aYScrollDif); \
NS_IMETHOD ClearTimeout(PRInt32 aTimerID); \
NS_IMETHOD ClearInterval(PRInt32 aTimerID); \
NS_IMETHOD SetTimeout(JSContext *cx, jsval *argv, PRUint32 argc, PRInt32* aReturn); \
NS_IMETHOD SetInterval(JSContext *cx, jsval *argv, PRUint32 argc, PRInt32* aReturn); \
NS_IMETHOD SetTimeout(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn); \
NS_IMETHOD SetInterval(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn); \
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aAnchorAlignment, const nsString& aPopupAlignment, nsIDOMWindow** aReturn); \
NS_IMETHOD Open(JSContext *cx, jsval *argv, PRUint32 argc, nsIDOMWindow** aReturn); \
NS_IMETHOD OpenDialog(JSContext *cx, jsval *argv, PRUint32 argc, nsIDOMWindow** aReturn); \
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn); \
NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn); \
@ -281,9 +281,9 @@ public:
NS_IMETHOD GetPageYOffset(PRInt32* aPageYOffset) { return _to GetPageYOffset(aPageYOffset); } \
NS_IMETHOD SetPageYOffset(PRInt32 aPageYOffset) { return _to SetPageYOffset(aPageYOffset); } \
NS_IMETHOD Dump(const nsString& aStr) { return _to Dump(aStr); } \
NS_IMETHOD Alert(JSContext *cx, jsval *argv, PRUint32 argc) { return _to Alert(cx, argv, argc); } \
NS_IMETHOD Confirm(JSContext *cx, jsval *argv, PRUint32 argc, PRBool* aReturn) { return _to Confirm(cx, argv, argc, aReturn); } \
NS_IMETHOD Prompt(JSContext *cx, jsval *argv, PRUint32 argc, nsString& aReturn) { return _to Prompt(cx, argv, argc, aReturn); } \
NS_IMETHOD Alert(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Alert(cx, argv, argc); } \
NS_IMETHOD Confirm(JSContext* cx, jsval* argv, PRUint32 argc, PRBool* aReturn) { return _to Confirm(cx, argv, argc, aReturn); } \
NS_IMETHOD Prompt(JSContext* cx, jsval* argv, PRUint32 argc, nsString& aReturn) { return _to Prompt(cx, argv, argc, aReturn); } \
NS_IMETHOD Focus() { return _to Focus(); } \
NS_IMETHOD Blur() { return _to Blur(); } \
NS_IMETHOD Close() { return _to Close(); } \
@ -300,11 +300,11 @@ public:
NS_IMETHOD ScrollBy(PRInt32 aXScrollDif, PRInt32 aYScrollDif) { return _to ScrollBy(aXScrollDif, aYScrollDif); } \
NS_IMETHOD ClearTimeout(PRInt32 aTimerID) { return _to ClearTimeout(aTimerID); } \
NS_IMETHOD ClearInterval(PRInt32 aTimerID) { return _to ClearInterval(aTimerID); } \
NS_IMETHOD SetTimeout(JSContext *cx, jsval *argv, PRUint32 argc, PRInt32* aReturn) { return _to SetTimeout(cx, argv, argc, aReturn); } \
NS_IMETHOD SetInterval(JSContext *cx, jsval *argv, PRUint32 argc, PRInt32* aReturn) { return _to SetInterval(cx, argv, argc, aReturn); } \
NS_IMETHOD SetTimeout(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn) { return _to SetTimeout(cx, argv, argc, aReturn); } \
NS_IMETHOD SetInterval(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn) { return _to SetInterval(cx, argv, argc, aReturn); } \
NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& aAnchorAlignment, const nsString& aPopupAlignment, nsIDOMWindow** aReturn) { return _to CreatePopup(aElement, aPopupContent, aXPos, aYPos, aPopupType, aAnchorAlignment, aPopupAlignment, aReturn); } \
NS_IMETHOD Open(JSContext *cx, jsval *argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to Open(cx, argv, argc, aReturn); } \
NS_IMETHOD OpenDialog(JSContext *cx, jsval *argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to OpenDialog(cx, argv, argc, aReturn); } \
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to Open(cx, argv, argc, aReturn); } \
NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to OpenDialog(cx, argv, argc, aReturn); } \
extern nsresult NS_InitWindowClass(nsIScriptContext *aContext, nsIScriptGlobalObject *aGlobal);

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

@ -8,7 +8,6 @@ nsIDOMHTMLAreaElement.h
nsIDOMHTMLBRElement.h
nsIDOMHTMLBaseElement.h
nsIDOMHTMLBaseFontElement.h
nsIDOMHTMLBlockquoteElement.h
nsIDOMHTMLBodyElement.h
nsIDOMHTMLButtonElement.h
nsIDOMHTMLCollection.h

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

@ -32,7 +32,6 @@ EXPORTS = \
nsIDOMHTMLBRElement.h \
nsIDOMHTMLBaseElement.h \
nsIDOMHTMLBaseFontElement.h \
nsIDOMHTMLBlockquoteElement.h \
nsIDOMHTMLBodyElement.h \
nsIDOMHTMLButtonElement.h \
nsIDOMHTMLCollection.h \

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

@ -27,7 +27,6 @@ EXPORTS= \
nsIDOMHTMLBRElement.h \
nsIDOMHTMLBaseElement.h \
nsIDOMHTMLBaseFontElement.h \
nsIDOMHTMLBlockquoteElement.h \
nsIDOMHTMLBodyElement.h \
nsIDOMHTMLButtonElement.h \
nsIDOMHTMLCollection.h \

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

@ -179,8 +179,8 @@ public:
NS_IMETHOD SetUseMap(const nsString& aUseMap) { return _to SetUseMap(aUseMap); } \
NS_IMETHOD GetValue(nsString& aValue) { return _to GetValue(aValue); } \
NS_IMETHOD SetValue(const nsString& aValue) { return _to SetValue(aValue); } \
NS_IMETHOD GetAutocomplete(PRInt32* aAutocomplete) { return _to GetAutocomplete(aAutocomplete); } \
NS_IMETHOD SetAutocomplete(PRInt32 aAutocomplete) { return _to SetAutocomplete(aAutocomplete); } \
NS_IMETHOD GetAutocomplete(nsString& aAutocomplete) { return _to GetAutocomplete(aAutocomplete); } \
NS_IMETHOD SetAutocomplete(const nsString& aAutocomplete) { return _to SetAutocomplete(aAutocomplete); } \
NS_IMETHOD Blur() { return _to Blur(); } \
NS_IMETHOD Focus() { return _to Focus(); } \
NS_IMETHOD Select() { return _to Select(); } \

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

@ -63,11 +63,11 @@ public:
NS_IMETHOD NamedItem(const nsString& aName, nsIDOMElement** aReturn)=0;
NS_IMETHOD Open(JSContext *cx, jsval *argv, PRUint32 argc)=0;
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc)=0;
NS_IMETHOD Write(JSContext *cx, jsval *argv, PRUint32 argc)=0;
NS_IMETHOD Write(JSContext* cx, jsval* argv, PRUint32 argc)=0;
NS_IMETHOD Writeln(JSContext *cx, jsval *argv, PRUint32 argc)=0;
NS_IMETHOD Writeln(JSContext* cx, jsval* argv, PRUint32 argc)=0;
};
@ -88,9 +88,9 @@ public:
NS_IMETHOD GetPlugins(nsIDOMHTMLCollection** aPlugins); \
NS_IMETHOD GetSelection(nsString& aReturn); \
NS_IMETHOD NamedItem(const nsString& aName, nsIDOMElement** aReturn); \
NS_IMETHOD Open(JSContext *cx, jsval *argv, PRUint32 argc); \
NS_IMETHOD Write(JSContext *cx, jsval *argv, PRUint32 argc); \
NS_IMETHOD Writeln(JSContext *cx, jsval *argv, PRUint32 argc); \
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc); \
NS_IMETHOD Write(JSContext* cx, jsval* argv, PRUint32 argc); \
NS_IMETHOD Writeln(JSContext* cx, jsval* argv, PRUint32 argc); \
@ -111,9 +111,9 @@ public:
NS_IMETHOD GetPlugins(nsIDOMHTMLCollection** aPlugins) { return _to GetPlugins(aPlugins); } \
NS_IMETHOD GetSelection(nsString& aReturn) { return _to GetSelection(aReturn); } \
NS_IMETHOD NamedItem(const nsString& aName, nsIDOMElement** aReturn) { return _to NamedItem(aName, aReturn); } \
NS_IMETHOD Open(JSContext *cx, jsval *argv, PRUint32 argc) { return _to Open(cx, argv, argc); } \
NS_IMETHOD Write(JSContext *cx, jsval *argv, PRUint32 argc) { return _to Write(cx, argv, argc); } \
NS_IMETHOD Writeln(JSContext *cx, jsval *argv, PRUint32 argc) { return _to Writeln(cx, argv, argc); } \
NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Open(cx, argv, argc); } \
NS_IMETHOD Write(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Write(cx, argv, argc); } \
NS_IMETHOD Writeln(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Writeln(cx, argv, argc); } \
#endif // nsIDOMNSHTMLDocument_h__

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

@ -12,6 +12,7 @@ interface Navigator {
readonly attribute DOMString securityPolicy;
readonly attribute DOMString userAgent;
boolean javaEnabled();
boolean javaEnabled();
boolean taintEnabled();
jsval preference(/* ... */);
};

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

@ -28,7 +28,6 @@ IDLSRCS = \
HTMLBRElement.idl \
HTMLBaseElement.idl \
HTMLBaseFontElement.idl \
HTMLBlockquoteElement.idl \
HTMLBodyElement.idl \
HTMLButtonElement.idl \
HTMLCollection.idl \

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

@ -327,6 +327,10 @@ public:
NS_IMETHOD JavaEnabled(PRBool* aReturn);
NS_IMETHOD TaintEnabled(PRBool* aReturn);
NS_IMETHOD Preference(JSContext* cx, jsval* argv, PRUint32 argc, jsval* aReturn);
protected:
void *mScriptObject;
nsIDOMMimeTypeArray* mMimeTypes;

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMBarProp.h"
@ -60,14 +61,14 @@ GetBarPropProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case BARPROP_VISIBLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "barprop.visible", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetBarPropProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetBarPropProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case BARPROP_VISIBLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "barprop.visible", &ok);
if (!ok) {
//Need to throw error here
@ -135,7 +135,6 @@ SetBarPropProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHistory.h"
@ -63,14 +64,14 @@ GetHistoryProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HISTORY_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "history.length", &ok);
if (!ok) {
//Need to throw error here
@ -87,6 +88,7 @@ GetHistoryProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HISTORY_CURRENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "history.current", &ok);
if (!ok) {
//Need to throw error here
@ -103,6 +105,7 @@ GetHistoryProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HISTORY_PREVIOUS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "history.previous", &ok);
if (!ok) {
//Need to throw error here
@ -119,6 +122,7 @@ GetHistoryProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HISTORY_NEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "history.next", &ok);
if (!ok) {
//Need to throw error here
@ -136,7 +140,6 @@ GetHistoryProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -161,9 +164,8 @@ SetHistoryProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -171,7 +173,6 @@ SetHistoryProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -222,8 +223,8 @@ HistoryBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -233,7 +234,6 @@ HistoryBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -265,8 +265,8 @@ HistoryForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -276,7 +276,6 @@ HistoryForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -309,8 +308,8 @@ HistoryGo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -320,7 +319,6 @@ HistoryGo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMLocation.h"
@ -69,14 +70,14 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case LOCATION_HASH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.hash", &ok);
if (!ok) {
//Need to throw error here
@ -93,6 +94,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_HOST:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.host", &ok);
if (!ok) {
//Need to throw error here
@ -109,6 +111,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_HOSTNAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.hostname", &ok);
if (!ok) {
//Need to throw error here
@ -125,6 +128,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_PATHNAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.pathname", &ok);
if (!ok) {
//Need to throw error here
@ -141,6 +145,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_PORT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.port", &ok);
if (!ok) {
//Need to throw error here
@ -157,6 +162,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_PROTOCOL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.protocol", &ok);
if (!ok) {
//Need to throw error here
@ -173,6 +179,7 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_SEARCH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.search", &ok);
if (!ok) {
//Need to throw error here
@ -190,7 +197,6 @@ GetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -215,14 +221,14 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case LOCATION_HASH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.hash", &ok);
if (!ok) {
//Need to throw error here
@ -237,6 +243,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_HOST:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.host", &ok);
if (!ok) {
//Need to throw error here
@ -251,6 +258,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_HOSTNAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.hostname", &ok);
if (!ok) {
//Need to throw error here
@ -265,6 +273,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_PATHNAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.pathname", &ok);
if (!ok) {
//Need to throw error here
@ -279,6 +288,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_PORT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.port", &ok);
if (!ok) {
//Need to throw error here
@ -293,6 +303,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_PROTOCOL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.protocol", &ok);
if (!ok) {
//Need to throw error here
@ -307,6 +318,7 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case LOCATION_SEARCH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "location.search", &ok);
if (!ok) {
//Need to throw error here
@ -322,7 +334,6 @@ SetLocationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -374,8 +385,8 @@ LocationToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -385,7 +396,6 @@ LocationToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -423,8 +433,8 @@ NSLocationReload(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -434,7 +444,6 @@ NSLocationReload(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -472,8 +481,8 @@ NSLocationReplace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -483,7 +492,6 @@ NSLocationReplace(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMMimeType.h"
@ -66,14 +67,14 @@ GetMimeTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case MIMETYPE_DESCRIPTION:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "mimetype.description", &ok);
if (!ok) {
//Need to throw error here
@ -90,6 +91,7 @@ GetMimeTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case MIMETYPE_ENABLEDPLUGIN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "mimetype.enabledplugin", &ok);
if (!ok) {
//Need to throw error here
@ -107,6 +109,7 @@ GetMimeTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case MIMETYPE_SUFFIXES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "mimetype.suffixes", &ok);
if (!ok) {
//Need to throw error here
@ -123,6 +126,7 @@ GetMimeTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case MIMETYPE_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "mimetype.type", &ok);
if (!ok) {
//Need to throw error here
@ -140,7 +144,6 @@ GetMimeTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -165,9 +168,8 @@ SetMimeTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -175,7 +177,6 @@ SetMimeTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMMimeType.h"
@ -64,15 +65,15 @@ GetMimeTypeArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
switch(JSVAL_TO_INT(id)) {
case MIMETYPEARRAY_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "mimetypearray.length", &ok);
if (!ok) {
//Need to throw error here
@ -150,9 +151,8 @@ SetMimeTypeArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
@ -161,7 +161,6 @@ SetMimeTypeArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -214,8 +213,8 @@ MimeTypeArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -225,7 +224,6 @@ MimeTypeArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -268,8 +266,8 @@ MimeTypeArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -279,7 +277,6 @@ MimeTypeArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNavigator.h"
@ -74,14 +75,14 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case NAVIGATOR_APPCODENAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.appcodename", &ok);
if (!ok) {
//Need to throw error here
@ -98,6 +99,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NAVIGATOR_APPNAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.appname", &ok);
if (!ok) {
//Need to throw error here
@ -114,6 +116,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NAVIGATOR_APPVERSION:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.appversion", &ok);
if (!ok) {
//Need to throw error here
@ -130,6 +133,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NAVIGATOR_LANGUAGE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.language", &ok);
if (!ok) {
//Need to throw error here
@ -146,6 +150,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NAVIGATOR_MIMETYPES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.mimetypes", &ok);
if (!ok) {
//Need to throw error here
@ -163,6 +168,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NAVIGATOR_PLATFORM:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.platform", &ok);
if (!ok) {
//Need to throw error here
@ -179,6 +185,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NAVIGATOR_PLUGINS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.plugins", &ok);
if (!ok) {
//Need to throw error here
@ -196,6 +203,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NAVIGATOR_SECURITYPOLICY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.securitypolicy", &ok);
if (!ok) {
//Need to throw error here
@ -212,6 +220,7 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NAVIGATOR_USERAGENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.useragent", &ok);
if (!ok) {
//Need to throw error here
@ -229,7 +238,6 @@ GetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -254,9 +262,8 @@ SetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -264,7 +271,6 @@ SetNavigatorProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -316,8 +322,8 @@ NavigatorJavaEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -327,7 +333,6 @@ NavigatorJavaEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -348,6 +353,92 @@ NavigatorJavaEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
}
//
// Native method TaintEnabled
//
PR_STATIC_CALLBACK(JSBool)
NavigatorTaintEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsIDOMNavigator *nativeThis = (nsIDOMNavigator*)nsJSUtils::nsGetNativeThis(cx, obj);
PRBool nativeRet;
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
PRBool ok;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.taintenabled", &ok);
if (!ok) {
//Need to throw error here
return JS_FALSE;
}
}
// If there's no private data, this must be the prototype, so ignore
if (nsnull == nativeThis) {
return JS_TRUE;
}
{
if (NS_OK != nativeThis->TaintEnabled(&nativeRet)) {
return JS_FALSE;
}
*rval = BOOLEAN_TO_JSVAL(nativeRet);
}
return JS_TRUE;
}
//
// Native method Preference
//
PR_STATIC_CALLBACK(JSBool)
NavigatorPreference(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsIDOMNavigator *nativeThis = (nsIDOMNavigator*)nsJSUtils::nsGetNativeThis(cx, obj);
jsval nativeRet;
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
PRBool ok;
secMan->CheckScriptAccess(scriptCX, obj, "navigator.preference", &ok);
if (!ok) {
//Need to throw error here
return JS_FALSE;
}
}
// If there's no private data, this must be the prototype, so ignore
if (nsnull == nativeThis) {
return JS_TRUE;
}
{
if (NS_OK != nativeThis->Preference(cx, argv+0, argc-0, &nativeRet)) {
return JS_FALSE;
}
*rval = nativeRet;
}
return JS_TRUE;
}
/***********************************************************************/
//
// class for Navigator
@ -390,6 +481,8 @@ static JSPropertySpec NavigatorProperties[] =
static JSFunctionSpec NavigatorMethods[] =
{
{"javaEnabled", NavigatorJavaEnabled, 0},
{"taintEnabled", NavigatorTaintEnabled, 0},
{"preference", NavigatorPreference, 0},
{0}
};

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMMimeType.h"
@ -67,15 +68,15 @@ GetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
switch(JSVAL_TO_INT(id)) {
case PLUGIN_DESCRIPTION:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "plugin.description", &ok);
if (!ok) {
//Need to throw error here
@ -92,6 +93,7 @@ GetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case PLUGIN_FILENAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "plugin.filename", &ok);
if (!ok) {
//Need to throw error here
@ -108,6 +110,7 @@ GetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case PLUGIN_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "plugin.name", &ok);
if (!ok) {
//Need to throw error here
@ -124,6 +127,7 @@ GetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case PLUGIN_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "plugin.length", &ok);
if (!ok) {
//Need to throw error here
@ -201,9 +205,8 @@ SetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
@ -212,7 +215,6 @@ SetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -265,8 +267,8 @@ PluginItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -276,7 +278,6 @@ PluginItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -319,8 +320,8 @@ PluginNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -330,7 +331,6 @@ PluginNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMPlugin.h"
@ -64,15 +65,15 @@ GetPluginArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
switch(JSVAL_TO_INT(id)) {
case PLUGINARRAY_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "pluginarray.length", &ok);
if (!ok) {
//Need to throw error here
@ -150,9 +151,8 @@ SetPluginArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
@ -161,7 +161,6 @@ SetPluginArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -214,8 +213,8 @@ PluginArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -225,7 +224,6 @@ PluginArrayItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -268,8 +266,8 @@ PluginArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -279,7 +277,6 @@ PluginArrayNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -318,8 +315,8 @@ PluginArrayRefresh(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -329,7 +326,6 @@ PluginArrayRefresh(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMScreen.h"
@ -67,14 +68,14 @@ GetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case SCREEN_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "screen.width", &ok);
if (!ok) {
//Need to throw error here
@ -91,6 +92,7 @@ GetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case SCREEN_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "screen.height", &ok);
if (!ok) {
//Need to throw error here
@ -107,6 +109,7 @@ GetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case SCREEN_PIXELDEPTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "screen.pixeldepth", &ok);
if (!ok) {
//Need to throw error here
@ -123,6 +126,7 @@ GetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case SCREEN_COLORDEPTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "screen.colordepth", &ok);
if (!ok) {
//Need to throw error here
@ -139,6 +143,7 @@ GetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case SCREEN_AVAILWIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "screen.availwidth", &ok);
if (!ok) {
//Need to throw error here
@ -155,6 +160,7 @@ GetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case SCREEN_AVAILHEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "screen.availheight", &ok);
if (!ok) {
//Need to throw error here
@ -171,6 +177,7 @@ GetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case SCREEN_AVAILLEFT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "screen.availleft", &ok);
if (!ok) {
//Need to throw error here
@ -187,6 +194,7 @@ GetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case SCREEN_AVAILTOP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "screen.availtop", &ok);
if (!ok) {
//Need to throw error here
@ -204,7 +212,6 @@ GetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -229,9 +236,8 @@ SetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -239,7 +245,6 @@ SetScreenProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNavigator.h"
@ -119,14 +120,14 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case WINDOW_WINDOW:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.window", &ok);
if (!ok) {
//Need to throw error here
@ -144,6 +145,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_SELF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.self", &ok);
if (!ok) {
//Need to throw error here
@ -161,6 +163,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_DOCUMENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.document", &ok);
if (!ok) {
//Need to throw error here
@ -178,6 +181,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_NAVIGATOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.navigator", &ok);
if (!ok) {
//Need to throw error here
@ -195,6 +199,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_SCREEN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.screen", &ok);
if (!ok) {
//Need to throw error here
@ -212,6 +217,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_HISTORY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.history", &ok);
if (!ok) {
//Need to throw error here
@ -229,6 +235,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_PARENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.parent", &ok);
if (!ok) {
//Need to throw error here
@ -246,6 +253,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_TOP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.top", &ok);
if (!ok) {
//Need to throw error here
@ -263,6 +271,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_CONTENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.content", &ok);
if (!ok) {
//Need to throw error here
@ -280,6 +289,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_MENUBAR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.menubar", &ok);
if (!ok) {
//Need to throw error here
@ -297,6 +307,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_TOOLBAR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.toolbar", &ok);
if (!ok) {
//Need to throw error here
@ -314,6 +325,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_LOCATIONBAR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.locationbar", &ok);
if (!ok) {
//Need to throw error here
@ -331,6 +343,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_PERSONALBAR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.personalbar", &ok);
if (!ok) {
//Need to throw error here
@ -348,6 +361,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_STATUSBAR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.statusbar", &ok);
if (!ok) {
//Need to throw error here
@ -365,6 +379,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_SCROLLBARS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.scrollbars", &ok);
if (!ok) {
//Need to throw error here
@ -382,6 +397,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_DIRECTORIES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.directories", &ok);
if (!ok) {
//Need to throw error here
@ -399,6 +415,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_CLOSED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.closed", &ok);
if (!ok) {
//Need to throw error here
@ -415,6 +432,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_FRAMES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.frames", &ok);
if (!ok) {
//Need to throw error here
@ -432,6 +450,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_OPENER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.opener", &ok);
if (!ok) {
//Need to throw error here
@ -449,6 +468,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_STATUS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.status", &ok);
if (!ok) {
//Need to throw error here
@ -465,6 +485,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_DEFAULTSTATUS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.defaultstatus", &ok);
if (!ok) {
//Need to throw error here
@ -481,6 +502,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.name", &ok);
if (!ok) {
//Need to throw error here
@ -497,6 +519,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_INNERWIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.innerwidth", &ok);
if (!ok) {
//Need to throw error here
@ -513,6 +536,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_INNERHEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.innerheight", &ok);
if (!ok) {
//Need to throw error here
@ -529,6 +553,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_OUTERWIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.outerwidth", &ok);
if (!ok) {
//Need to throw error here
@ -545,6 +570,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_OUTERHEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.outerheight", &ok);
if (!ok) {
//Need to throw error here
@ -561,6 +587,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_SCREENX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.screenx", &ok);
if (!ok) {
//Need to throw error here
@ -577,6 +604,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_SCREENY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.screeny", &ok);
if (!ok) {
//Need to throw error here
@ -593,6 +621,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_PAGEXOFFSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.pagexoffset", &ok);
if (!ok) {
//Need to throw error here
@ -609,6 +638,7 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_PAGEYOFFSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.pageyoffset", &ok);
if (!ok) {
//Need to throw error here
@ -626,7 +656,6 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -651,14 +680,14 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case WINDOW_OPENER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.opener", &ok);
if (!ok) {
//Need to throw error here
@ -677,6 +706,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_STATUS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.status", &ok);
if (!ok) {
//Need to throw error here
@ -691,6 +721,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_DEFAULTSTATUS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.defaultstatus", &ok);
if (!ok) {
//Need to throw error here
@ -705,6 +736,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.name", &ok);
if (!ok) {
//Need to throw error here
@ -719,6 +751,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_INNERWIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.innerwidth", &ok);
if (!ok) {
//Need to throw error here
@ -740,6 +773,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_INNERHEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.innerheight", &ok);
if (!ok) {
//Need to throw error here
@ -761,6 +795,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_OUTERWIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.outerwidth", &ok);
if (!ok) {
//Need to throw error here
@ -782,6 +817,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_OUTERHEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.outerheight", &ok);
if (!ok) {
//Need to throw error here
@ -803,6 +839,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_SCREENX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.screenx", &ok);
if (!ok) {
//Need to throw error here
@ -824,6 +861,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_SCREENY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.screeny", &ok);
if (!ok) {
//Need to throw error here
@ -845,6 +883,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_PAGEXOFFSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.pagexoffset", &ok);
if (!ok) {
//Need to throw error here
@ -866,6 +905,7 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case WINDOW_PAGEYOFFSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "window.pageyoffset", &ok);
if (!ok) {
//Need to throw error here
@ -888,7 +928,6 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -940,8 +979,8 @@ WindowDump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -951,7 +990,6 @@ WindowDump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -989,8 +1027,8 @@ WindowAlert(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1000,7 +1038,6 @@ WindowAlert(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1033,8 +1070,8 @@ WindowConfirm(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1044,7 +1081,6 @@ WindowConfirm(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1077,8 +1113,8 @@ WindowPrompt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1088,7 +1124,6 @@ WindowPrompt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1120,8 +1155,8 @@ WindowFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1131,7 +1166,6 @@ WindowFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1163,8 +1197,8 @@ WindowBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1174,7 +1208,6 @@ WindowBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1206,8 +1239,8 @@ WindowClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1217,7 +1250,6 @@ WindowClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1249,8 +1281,8 @@ WindowBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1260,7 +1292,6 @@ WindowBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1292,8 +1323,8 @@ WindowForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1303,7 +1334,6 @@ WindowForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1335,8 +1365,8 @@ WindowHome(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1346,7 +1376,6 @@ WindowHome(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1378,8 +1407,8 @@ WindowStop(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1389,7 +1418,6 @@ WindowStop(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1421,8 +1449,8 @@ WindowPrint(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1432,7 +1460,6 @@ WindowPrint(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1466,8 +1493,8 @@ WindowMoveTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1477,7 +1504,6 @@ WindowMoveTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1524,8 +1550,8 @@ WindowMoveBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1535,7 +1561,6 @@ WindowMoveBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1582,8 +1607,8 @@ WindowResizeTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1593,7 +1618,6 @@ WindowResizeTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1640,8 +1664,8 @@ WindowResizeBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1651,7 +1675,6 @@ WindowResizeBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1698,8 +1721,8 @@ WindowScrollTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1709,7 +1732,6 @@ WindowScrollTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1756,8 +1778,8 @@ WindowScrollBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1767,7 +1789,6 @@ WindowScrollBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1813,8 +1834,8 @@ WindowClearTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1824,7 +1845,6 @@ WindowClearTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1866,8 +1886,8 @@ WindowClearInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1877,7 +1897,6 @@ WindowClearInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1919,8 +1938,8 @@ WindowSetTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1930,7 +1949,6 @@ WindowSetTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1963,8 +1981,8 @@ WindowSetInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1974,7 +1992,6 @@ WindowSetInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -2014,8 +2031,8 @@ WindowCreatePopup(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -2025,7 +2042,6 @@ WindowCreatePopup(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -2088,8 +2104,8 @@ WindowOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -2099,7 +2115,6 @@ WindowOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -2132,8 +2147,8 @@ WindowOpenDialog(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -2143,7 +2158,6 @@ WindowOpenDialog(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -2182,8 +2196,8 @@ EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -2193,7 +2207,6 @@ EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -2238,8 +2251,8 @@ EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -2249,7 +2262,6 @@ EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -2296,8 +2308,8 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -2307,7 +2319,6 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -2363,8 +2374,8 @@ EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -2374,7 +2385,6 @@ EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMWindowCollection.h"
@ -64,15 +65,15 @@ GetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
switch(JSVAL_TO_INT(id)) {
case WINDOWCOLLECTION_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "windowcollection.length", &ok);
if (!ok) {
//Need to throw error here
@ -150,9 +151,8 @@ SetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
@ -161,7 +161,6 @@ SetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -214,8 +213,8 @@ WindowCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -225,7 +224,6 @@ WindowCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -268,8 +266,8 @@ WindowCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -279,7 +277,6 @@ WindowCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMAttr.h"
@ -62,14 +63,14 @@ GetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case ATTR_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "attr.name", &ok);
if (!ok) {
//Need to throw error here
@ -86,6 +87,7 @@ GetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case ATTR_SPECIFIED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "attr.specified", &ok);
if (!ok) {
//Need to throw error here
@ -102,6 +104,7 @@ GetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case ATTR_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "attr.value", &ok);
if (!ok) {
//Need to throw error here
@ -119,7 +122,6 @@ GetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -144,14 +146,14 @@ SetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case ATTR_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "attr.value", &ok);
if (!ok) {
//Need to throw error here
@ -167,7 +169,6 @@ SetAttrProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCDATASection.h"
@ -54,9 +55,8 @@ GetCDATASectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -64,7 +64,6 @@ GetCDATASectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -89,9 +88,8 @@ SetCDATASectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -99,7 +97,6 @@ SetCDATASectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCharacterData.h"
@ -61,14 +62,14 @@ GetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CHARACTERDATA_DATA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "characterdata.data", &ok);
if (!ok) {
//Need to throw error here
@ -85,6 +86,7 @@ GetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CHARACTERDATA_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "characterdata.length", &ok);
if (!ok) {
//Need to throw error here
@ -102,7 +104,6 @@ GetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -127,14 +128,14 @@ SetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CHARACTERDATA_DATA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "characterdata.data", &ok);
if (!ok) {
//Need to throw error here
@ -150,7 +151,6 @@ SetCharacterDataProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -204,8 +204,8 @@ CharacterDataSubstringData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -215,7 +215,6 @@ CharacterDataSubstringData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -261,8 +260,8 @@ CharacterDataAppendData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -272,7 +271,6 @@ CharacterDataAppendData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -312,8 +310,8 @@ CharacterDataInsertData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -323,7 +321,6 @@ CharacterDataInsertData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -367,8 +364,8 @@ CharacterDataDeleteData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -378,7 +375,6 @@ CharacterDataDeleteData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -426,8 +422,8 @@ CharacterDataReplaceData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -437,7 +433,6 @@ CharacterDataReplaceData(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMComment.h"
@ -54,9 +55,8 @@ GetCommentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -64,7 +64,6 @@ GetCommentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -89,9 +88,8 @@ SetCommentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -99,7 +97,6 @@ SetCommentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMDOMImplementation.h"
@ -54,9 +55,8 @@ GetDOMImplementationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -64,7 +64,6 @@ GetDOMImplementationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -89,9 +88,8 @@ SetDOMImplementationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -99,7 +97,6 @@ SetDOMImplementationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -153,8 +150,8 @@ DOMImplementationHasFeature(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -164,7 +161,6 @@ DOMImplementationHasFeature(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMElement.h"
@ -108,14 +109,14 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case DOCUMENT_DOCTYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "document.doctype", &ok);
if (!ok) {
//Need to throw error here
@ -133,6 +134,7 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case DOCUMENT_IMPLEMENTATION:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "document.implementation", &ok);
if (!ok) {
//Need to throw error here
@ -150,6 +152,7 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case DOCUMENT_DOCUMENTELEMENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "document.documentelement", &ok);
if (!ok) {
//Need to throw error here
@ -167,6 +170,7 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSDOCUMENT_STYLESHEETS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nsdocument.stylesheets", &ok);
if (!ok) {
//Need to throw error here
@ -194,7 +198,6 @@ GetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -219,9 +222,8 @@ SetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -229,7 +231,6 @@ SetDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -282,8 +283,8 @@ DocumentCreateElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -293,7 +294,6 @@ DocumentCreateElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -332,8 +332,8 @@ DocumentCreateDocumentFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -343,7 +343,6 @@ DocumentCreateDocumentFragment(JSContext *cx, JSObject *obj, uintN argc, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -377,8 +376,8 @@ DocumentCreateTextNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -388,7 +387,6 @@ DocumentCreateTextNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -428,8 +426,8 @@ DocumentCreateComment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -439,7 +437,6 @@ DocumentCreateComment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -479,8 +476,8 @@ DocumentCreateCDATASection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -490,7 +487,6 @@ DocumentCreateCDATASection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -531,8 +527,8 @@ DocumentCreateProcessingInstruction(JSContext *cx, JSObject *obj, uintN argc, js
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -542,7 +538,6 @@ DocumentCreateProcessingInstruction(JSContext *cx, JSObject *obj, uintN argc, js
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -583,8 +578,8 @@ DocumentCreateAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -594,7 +589,6 @@ DocumentCreateAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -634,8 +628,8 @@ DocumentCreateEntityReference(JSContext *cx, JSObject *obj, uintN argc, jsval *a
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -645,7 +639,6 @@ DocumentCreateEntityReference(JSContext *cx, JSObject *obj, uintN argc, jsval *a
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -685,8 +678,8 @@ DocumentGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -696,7 +689,6 @@ DocumentGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -743,8 +735,8 @@ NSDocumentCreateElementWithNameSpace(JSContext *cx, JSObject *obj, uintN argc, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -754,7 +746,6 @@ NSDocumentCreateElementWithNameSpace(JSContext *cx, JSObject *obj, uintN argc, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -800,8 +791,8 @@ NSDocumentCreateRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -811,7 +802,6 @@ NSDocumentCreateRange(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -850,8 +840,8 @@ EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -861,7 +851,6 @@ EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -906,8 +895,8 @@ EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -917,7 +906,6 @@ EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMDocumentFragment.h"
@ -54,9 +55,8 @@ GetDocumentFragmentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -64,7 +64,6 @@ GetDocumentFragmentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -89,9 +88,8 @@ SetDocumentFragmentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -99,7 +97,6 @@ SetDocumentFragmentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNamedNodeMap.h"
@ -65,14 +66,14 @@ GetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case DOCUMENTTYPE_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "documenttype.name", &ok);
if (!ok) {
//Need to throw error here
@ -89,6 +90,7 @@ GetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case DOCUMENTTYPE_ENTITIES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "documenttype.entities", &ok);
if (!ok) {
//Need to throw error here
@ -106,6 +108,7 @@ GetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case DOCUMENTTYPE_NOTATIONS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "documenttype.notations", &ok);
if (!ok) {
//Need to throw error here
@ -124,7 +127,6 @@ GetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -149,9 +151,8 @@ SetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -159,7 +160,6 @@ SetDocumentTypeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMElement.h"
@ -66,14 +67,14 @@ GetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case ELEMENT_TAGNAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "element.tagname", &ok);
if (!ok) {
//Need to throw error here
@ -91,7 +92,6 @@ GetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -116,9 +116,8 @@ SetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -126,7 +125,6 @@ SetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -179,8 +177,8 @@ ElementGetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -190,7 +188,6 @@ ElementGetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -230,8 +227,8 @@ ElementSetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -241,7 +238,6 @@ ElementSetAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -281,8 +277,8 @@ ElementRemoveAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -292,7 +288,6 @@ ElementRemoveAttribute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -332,8 +327,8 @@ ElementGetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -343,7 +338,6 @@ ElementGetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -383,8 +377,8 @@ ElementSetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -394,7 +388,6 @@ ElementSetAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -440,8 +433,8 @@ ElementRemoveAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -451,7 +444,6 @@ ElementRemoveAttributeNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -497,8 +489,8 @@ ElementGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -508,7 +500,6 @@ ElementGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -546,8 +537,8 @@ ElementNormalize(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -557,7 +548,6 @@ ElementNormalize(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMEntity.h"
@ -62,14 +63,14 @@ GetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case ENTITY_PUBLICID:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "entity.publicid", &ok);
if (!ok) {
//Need to throw error here
@ -86,6 +87,7 @@ GetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case ENTITY_SYSTEMID:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "entity.systemid", &ok);
if (!ok) {
//Need to throw error here
@ -102,6 +104,7 @@ GetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case ENTITY_NOTATIONNAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "entity.notationname", &ok);
if (!ok) {
//Need to throw error here
@ -119,7 +122,6 @@ GetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -144,9 +146,8 @@ SetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -154,7 +155,6 @@ SetEntityProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMEntityReference.h"
@ -54,9 +55,8 @@ GetEntityReferenceProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -64,7 +64,6 @@ GetEntityReferenceProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -89,9 +88,8 @@ SetEntityReferenceProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -99,7 +97,6 @@ SetEntityReferenceProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNamedNodeMap.h"
@ -63,14 +64,14 @@ GetNamedNodeMapProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case NAMEDNODEMAP_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "namednodemap.length", &ok);
if (!ok) {
//Need to throw error here
@ -121,9 +122,8 @@ SetNamedNodeMapProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -131,7 +131,6 @@ SetNamedNodeMapProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -184,8 +183,8 @@ NamedNodeMapGetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -195,7 +194,6 @@ NamedNodeMapGetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -235,8 +233,8 @@ NamedNodeMapSetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -246,7 +244,6 @@ NamedNodeMapSetNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -292,8 +289,8 @@ NamedNodeMapRemoveNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -303,7 +300,6 @@ NamedNodeMapRemoveNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -343,8 +339,8 @@ NamedNodeMapItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -354,7 +350,6 @@ NamedNodeMapItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMDocument.h"
@ -85,14 +86,14 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case NODE_NODENAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.nodename", &ok);
if (!ok) {
//Need to throw error here
@ -109,6 +110,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_NODEVALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.nodevalue", &ok);
if (!ok) {
//Need to throw error here
@ -125,6 +127,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_NODETYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.nodetype", &ok);
if (!ok) {
//Need to throw error here
@ -141,6 +144,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_PARENTNODE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.parentnode", &ok);
if (!ok) {
//Need to throw error here
@ -158,6 +162,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_CHILDNODES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.childnodes", &ok);
if (!ok) {
//Need to throw error here
@ -175,6 +180,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_FIRSTCHILD:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.firstchild", &ok);
if (!ok) {
//Need to throw error here
@ -192,6 +198,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_LASTCHILD:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.lastchild", &ok);
if (!ok) {
//Need to throw error here
@ -209,6 +216,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_PREVIOUSSIBLING:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.previoussibling", &ok);
if (!ok) {
//Need to throw error here
@ -226,6 +234,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_NEXTSIBLING:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.nextsibling", &ok);
if (!ok) {
//Need to throw error here
@ -243,6 +252,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_ATTRIBUTES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.attributes", &ok);
if (!ok) {
//Need to throw error here
@ -260,6 +270,7 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NODE_OWNERDOCUMENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.ownerdocument", &ok);
if (!ok) {
//Need to throw error here
@ -278,7 +289,6 @@ GetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -303,14 +313,14 @@ SetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case NODE_NODEVALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "node.nodevalue", &ok);
if (!ok) {
//Need to throw error here
@ -326,7 +336,6 @@ SetNodeProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -380,8 +389,8 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -391,7 +400,6 @@ NodeInsertBefore(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -445,8 +453,8 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -456,7 +464,6 @@ NodeReplaceChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -509,8 +516,8 @@ NodeRemoveChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -520,7 +527,6 @@ NodeRemoveChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -566,8 +572,8 @@ NodeAppendChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -577,7 +583,6 @@ NodeAppendChild(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -622,8 +627,8 @@ NodeHasChildNodes(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -633,7 +638,6 @@ NodeHasChildNodes(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -667,8 +671,8 @@ NodeCloneNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -678,7 +682,6 @@ NodeCloneNode(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -727,8 +730,8 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -738,7 +741,6 @@ EventTargetAddEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -794,8 +796,8 @@ EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -805,7 +807,6 @@ EventTargetRemoveEventListener(JSContext *cx, JSObject *obj, uintN argc, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNode.h"
@ -63,14 +64,14 @@ GetNodeListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case NODELIST_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nodelist.length", &ok);
if (!ok) {
//Need to throw error here
@ -121,9 +122,8 @@ SetNodeListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -131,7 +131,6 @@ SetNodeListProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -184,8 +183,8 @@ NodeListItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -195,7 +194,6 @@ NodeListItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNotation.h"
@ -61,14 +62,14 @@ GetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case NOTATION_PUBLICID:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "notation.publicid", &ok);
if (!ok) {
//Need to throw error here
@ -85,6 +86,7 @@ GetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NOTATION_SYSTEMID:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "notation.systemid", &ok);
if (!ok) {
//Need to throw error here
@ -102,7 +104,6 @@ GetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -127,9 +128,8 @@ SetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -137,7 +137,6 @@ SetNotationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMProcessingInstruction.h"
@ -61,14 +62,14 @@ GetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case PROCESSINGINSTRUCTION_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "processinginstruction.target", &ok);
if (!ok) {
//Need to throw error here
@ -85,6 +86,7 @@ GetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
}
case PROCESSINGINSTRUCTION_DATA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "processinginstruction.data", &ok);
if (!ok) {
//Need to throw error here
@ -102,7 +104,6 @@ GetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -127,14 +128,14 @@ SetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case PROCESSINGINSTRUCTION_DATA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "processinginstruction.data", &ok);
if (!ok) {
//Need to throw error here
@ -150,7 +151,6 @@ SetProcessingInstructionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMStyleSheet.h"
@ -62,14 +63,14 @@ GetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case STYLESHEET_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "stylesheet.type", &ok);
if (!ok) {
//Need to throw error here
@ -86,6 +87,7 @@ GetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case STYLESHEET_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "stylesheet.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -102,6 +104,7 @@ GetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case STYLESHEET_READONLY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "stylesheet.readonly", &ok);
if (!ok) {
//Need to throw error here
@ -119,7 +122,6 @@ GetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -144,14 +146,14 @@ SetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case STYLESHEET_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "stylesheet.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -169,7 +171,6 @@ SetStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMStyleSheetCollection.h"
@ -63,14 +64,14 @@ GetStyleSheetCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case STYLESHEETCOLLECTION_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "stylesheetcollection.length", &ok);
if (!ok) {
//Need to throw error here
@ -121,9 +122,8 @@ SetStyleSheetCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -131,7 +131,6 @@ SetStyleSheetCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -184,8 +183,8 @@ StyleSheetCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -195,7 +194,6 @@ StyleSheetCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMText.h"
@ -54,9 +55,8 @@ GetTextProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -64,7 +64,6 @@ GetTextProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -89,9 +88,8 @@ SetTextProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -99,7 +97,6 @@ SetTextProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -152,8 +149,8 @@ TextSplitText(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -163,7 +160,6 @@ TextSplitText(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCSSStyleDeclaration.h"
@ -63,14 +64,14 @@ GetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSFONTFACERULE_STYLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssfontfacerule.style", &ok);
if (!ok) {
//Need to throw error here
@ -89,7 +90,6 @@ GetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -114,14 +114,14 @@ SetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSFONTFACERULE_STYLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssfontfacerule.style", &ok);
if (!ok) {
//Need to throw error here
@ -141,7 +141,6 @@ SetCSSFontFaceRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCSSImportRule.h"
@ -65,14 +66,14 @@ GetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSIMPORTRULE_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssimportrule.href", &ok);
if (!ok) {
//Need to throw error here
@ -89,6 +90,7 @@ GetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSIMPORTRULE_MEDIA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssimportrule.media", &ok);
if (!ok) {
//Need to throw error here
@ -105,6 +107,7 @@ GetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSIMPORTRULE_STYLESHEET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssimportrule.stylesheet", &ok);
if (!ok) {
//Need to throw error here
@ -123,7 +126,6 @@ GetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -148,14 +150,14 @@ SetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSIMPORTRULE_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssimportrule.href", &ok);
if (!ok) {
//Need to throw error here
@ -170,6 +172,7 @@ SetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSIMPORTRULE_MEDIA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssimportrule.media", &ok);
if (!ok) {
//Need to throw error here
@ -185,7 +188,6 @@ SetCSSImportRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCSSStyleRuleCollection.h"
@ -64,14 +65,14 @@ GetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSMEDIARULE_MEDIATYPES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssmediarule.mediatypes", &ok);
if (!ok) {
//Need to throw error here
@ -88,6 +89,7 @@ GetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSMEDIARULE_CSSRULES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssmediarule.cssrules", &ok);
if (!ok) {
//Need to throw error here
@ -106,7 +108,6 @@ GetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -131,14 +132,14 @@ SetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSMEDIARULE_MEDIATYPES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssmediarule.mediatypes", &ok);
if (!ok) {
//Need to throw error here
@ -154,7 +155,6 @@ SetCSSMediaRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -208,8 +208,8 @@ CSSMediaRuleInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -219,7 +219,6 @@ CSSMediaRuleInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -262,8 +261,8 @@ CSSMediaRuleDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -273,7 +272,6 @@ CSSMediaRuleDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCSSPageRule.h"
@ -64,14 +65,14 @@ GetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSPAGERULE_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "csspagerule.name", &ok);
if (!ok) {
//Need to throw error here
@ -88,6 +89,7 @@ GetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSPAGERULE_STYLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "csspagerule.style", &ok);
if (!ok) {
//Need to throw error here
@ -106,7 +108,6 @@ GetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -131,14 +132,14 @@ SetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSPAGERULE_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "csspagerule.name", &ok);
if (!ok) {
//Need to throw error here
@ -153,6 +154,7 @@ SetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSPAGERULE_STYLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "csspagerule.style", &ok);
if (!ok) {
//Need to throw error here
@ -172,7 +174,6 @@ SetCSSPageRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCSSRule.h"
@ -65,14 +66,14 @@ GetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSRULE_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssrule.type", &ok);
if (!ok) {
//Need to throw error here
@ -89,6 +90,7 @@ GetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSRULE_CSSTEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssrule.csstext", &ok);
if (!ok) {
//Need to throw error here
@ -105,6 +107,7 @@ GetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSRULE_SHEET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssrule.sheet", &ok);
if (!ok) {
//Need to throw error here
@ -123,7 +126,6 @@ GetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -148,14 +150,14 @@ SetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSRULE_CSSTEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssrule.csstext", &ok);
if (!ok) {
//Need to throw error here
@ -171,7 +173,6 @@ SetCSSRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCSSStyleDeclaration.h"
@ -61,14 +62,14 @@ GetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSSTYLEDECLARATION_CSSTEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstyledeclaration.csstext", &ok);
if (!ok) {
//Need to throw error here
@ -85,6 +86,7 @@ GetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
case CSSSTYLEDECLARATION_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstyledeclaration.length", &ok);
if (!ok) {
//Need to throw error here
@ -134,14 +136,14 @@ SetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSSTYLEDECLARATION_CSSTEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstyledeclaration.csstext", &ok);
if (!ok) {
//Need to throw error here
@ -157,7 +159,6 @@ SetCSSStyleDeclarationProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -210,8 +211,8 @@ CSSStyleDeclarationGetPropertyValue(JSContext *cx, JSObject *obj, uintN argc, js
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -221,7 +222,6 @@ CSSStyleDeclarationGetPropertyValue(JSContext *cx, JSObject *obj, uintN argc, js
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -261,8 +261,8 @@ CSSStyleDeclarationGetPropertyPriority(JSContext *cx, JSObject *obj, uintN argc,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -272,7 +272,6 @@ CSSStyleDeclarationGetPropertyPriority(JSContext *cx, JSObject *obj, uintN argc,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -313,8 +312,8 @@ CSSStyleDeclarationSetProperty(JSContext *cx, JSObject *obj, uintN argc, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -324,7 +323,6 @@ CSSStyleDeclarationSetProperty(JSContext *cx, JSObject *obj, uintN argc, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -366,8 +364,8 @@ CSSStyleDeclarationItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -377,7 +375,6 @@ CSSStyleDeclarationItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCSSStyleDeclaration.h"
@ -64,14 +65,14 @@ GetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSSTYLERULE_SELECTORTEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylerule.selectortext", &ok);
if (!ok) {
//Need to throw error here
@ -88,6 +89,7 @@ GetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSSTYLERULE_STYLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylerule.style", &ok);
if (!ok) {
//Need to throw error here
@ -106,7 +108,6 @@ GetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -131,14 +132,14 @@ SetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSSTYLERULE_SELECTORTEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylerule.selectortext", &ok);
if (!ok) {
//Need to throw error here
@ -153,6 +154,7 @@ SetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSSTYLERULE_STYLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylerule.style", &ok);
if (!ok) {
//Need to throw error here
@ -172,7 +174,6 @@ SetCSSStyleRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCSSStyleRule.h"
@ -63,14 +64,14 @@ GetCSSStyleRuleCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSSTYLERULECOLLECTION_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylerulecollection.length", &ok);
if (!ok) {
//Need to throw error here
@ -121,9 +122,8 @@ SetCSSStyleRuleCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -131,7 +131,6 @@ SetCSSStyleRuleCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -184,8 +183,8 @@ CSSStyleRuleCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -195,7 +194,6 @@ CSSStyleRuleCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNode.h"
@ -74,14 +75,14 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case CSSSTYLESHEET_OWNINGNODE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylesheet.owningnode", &ok);
if (!ok) {
//Need to throw error here
@ -99,6 +100,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSSTYLESHEET_PARENTSTYLESHEET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylesheet.parentstylesheet", &ok);
if (!ok) {
//Need to throw error here
@ -116,6 +118,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSSTYLESHEET_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylesheet.href", &ok);
if (!ok) {
//Need to throw error here
@ -132,6 +135,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSSTYLESHEET_TITLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylesheet.title", &ok);
if (!ok) {
//Need to throw error here
@ -148,6 +152,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSSTYLESHEET_MEDIA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylesheet.media", &ok);
if (!ok) {
//Need to throw error here
@ -164,6 +169,7 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case CSSSTYLESHEET_CSSRULES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "cssstylesheet.cssrules", &ok);
if (!ok) {
//Need to throw error here
@ -182,7 +188,6 @@ GetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -207,9 +212,8 @@ SetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -217,7 +221,6 @@ SetCSSStyleSheetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -271,8 +274,8 @@ CSSStyleSheetInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -282,7 +285,6 @@ CSSStyleSheetInsertRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -325,8 +327,8 @@ CSSStyleSheetDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -336,7 +338,6 @@ CSSStyleSheetDeleteRule(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMCSSUnknownRule.h"
@ -54,9 +55,8 @@ GetCSSUnknownRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -64,7 +64,6 @@ GetCSSUnknownRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -89,9 +88,8 @@ SetCSSUnknownRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -99,7 +97,6 @@ SetCSSUnknownRuleProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNode.h"
@ -66,14 +67,14 @@ GetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case EVENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "event.type", &ok);
if (!ok) {
//Need to throw error here
@ -90,6 +91,7 @@ GetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case EVENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "event.target", &ok);
if (!ok) {
//Need to throw error here
@ -107,6 +109,7 @@ GetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case EVENT_CURRENTNODE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "event.currentnode", &ok);
if (!ok) {
//Need to throw error here
@ -124,6 +127,7 @@ GetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case EVENT_EVENTPHASE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "event.eventphase", &ok);
if (!ok) {
//Need to throw error here
@ -141,7 +145,6 @@ GetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -166,9 +169,8 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -176,7 +178,6 @@ SetEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -227,8 +228,8 @@ EventPreventBubble(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -238,7 +239,6 @@ EventPreventBubble(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -270,8 +270,8 @@ EventPreventCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -281,7 +281,6 @@ EventPreventCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -313,8 +312,8 @@ EventPreventDefault(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -324,7 +323,6 @@ EventPreventDefault(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNSUIEvent.h"
@ -88,14 +89,14 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case UIEVENT_SCREENX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.screenx", &ok);
if (!ok) {
//Need to throw error here
@ -112,6 +113,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_SCREENY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.screeny", &ok);
if (!ok) {
//Need to throw error here
@ -128,6 +130,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_CLIENTX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.clientx", &ok);
if (!ok) {
//Need to throw error here
@ -144,6 +147,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_CLIENTY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.clienty", &ok);
if (!ok) {
//Need to throw error here
@ -160,6 +164,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_ALTKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.altkey", &ok);
if (!ok) {
//Need to throw error here
@ -176,6 +181,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_CTRLKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.ctrlkey", &ok);
if (!ok) {
//Need to throw error here
@ -192,6 +198,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_SHIFTKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.shiftkey", &ok);
if (!ok) {
//Need to throw error here
@ -208,6 +215,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_METAKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.metakey", &ok);
if (!ok) {
//Need to throw error here
@ -224,6 +232,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_CHARCODE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.charcode", &ok);
if (!ok) {
//Need to throw error here
@ -240,6 +249,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_KEYCODE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.keycode", &ok);
if (!ok) {
//Need to throw error here
@ -256,6 +266,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_BUTTON:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.button", &ok);
if (!ok) {
//Need to throw error here
@ -272,6 +283,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case UIEVENT_CLICKCOUNT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "uievent.clickcount", &ok);
if (!ok) {
//Need to throw error here
@ -288,6 +300,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSUIEVENT_LAYERX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.layerx", &ok);
if (!ok) {
//Need to throw error here
@ -313,6 +326,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSUIEVENT_LAYERY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.layery", &ok);
if (!ok) {
//Need to throw error here
@ -338,6 +352,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSUIEVENT_PAGEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.pagex", &ok);
if (!ok) {
//Need to throw error here
@ -363,6 +378,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSUIEVENT_PAGEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.pagey", &ok);
if (!ok) {
//Need to throw error here
@ -388,6 +404,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSUIEVENT_WHICH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.which", &ok);
if (!ok) {
//Need to throw error here
@ -413,6 +430,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSUIEVENT_RANGEPARENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.rangeparent", &ok);
if (!ok) {
//Need to throw error here
@ -439,6 +457,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSUIEVENT_RANGEOFFSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.rangeoffset", &ok);
if (!ok) {
//Need to throw error here
@ -464,6 +483,7 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSUIEVENT_RC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nsuievent.rc", &ok);
if (!ok) {
//Need to throw error here
@ -491,7 +511,6 @@ GetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -516,9 +535,8 @@ SetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -526,7 +544,6 @@ SetUIEventProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -32,7 +32,6 @@ CPPSRCS = \
nsJSHTMLBRElement.cpp \
nsJSHTMLBaseElement.cpp \
nsJSHTMLBaseFontElement.cpp \
nsJSHTMLBlockquoteElement.cpp \
nsJSHTMLBodyElement.cpp \
nsJSHTMLButtonElement.cpp \
nsJSHTMLCollection.cpp \

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

@ -31,7 +31,6 @@ CPPSRCS = \
nsJSHTMLBRElement.cpp \
nsJSHTMLBaseElement.cpp \
nsJSHTMLBaseFontElement.cpp \
nsJSHTMLBlockquoteElement.cpp \
nsJSHTMLBodyElement.cpp \
nsJSHTMLButtonElement.cpp \
nsJSHTMLCollection.cpp \
@ -92,7 +91,6 @@ CPP_OBJS= \
.\$(OBJDIR)\nsJSHTMLBRElement.obj \
.\$(OBJDIR)\nsJSHTMLBaseElement.obj \
.\$(OBJDIR)\nsJSHTMLBaseFontElement.obj \
.\$(OBJDIR)\nsJSHTMLBlockquoteElement.obj \
.\$(OBJDIR)\nsJSHTMLBodyElement.obj \
.\$(OBJDIR)\nsJSHTMLButtonElement.obj \
.\$(OBJDIR)\nsJSHTMLCollection.obj \

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLAnchorElement.h"
@ -71,14 +72,14 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLANCHORELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -95,6 +96,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_CHARSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.charset", &ok);
if (!ok) {
//Need to throw error here
@ -111,6 +113,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_COORDS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.coords", &ok);
if (!ok) {
//Need to throw error here
@ -127,6 +130,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.href", &ok);
if (!ok) {
//Need to throw error here
@ -143,6 +147,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_HREFLANG:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.hreflang", &ok);
if (!ok) {
//Need to throw error here
@ -159,6 +164,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -175,6 +181,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_REL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.rel", &ok);
if (!ok) {
//Need to throw error here
@ -191,6 +198,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_REV:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.rev", &ok);
if (!ok) {
//Need to throw error here
@ -207,6 +215,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_SHAPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.shape", &ok);
if (!ok) {
//Need to throw error here
@ -223,6 +232,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -239,6 +249,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -255,6 +266,7 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -272,7 +284,6 @@ GetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -297,14 +308,14 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLANCHORELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -319,6 +330,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_CHARSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.charset", &ok);
if (!ok) {
//Need to throw error here
@ -333,6 +345,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_COORDS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.coords", &ok);
if (!ok) {
//Need to throw error here
@ -347,6 +360,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.href", &ok);
if (!ok) {
//Need to throw error here
@ -361,6 +375,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_HREFLANG:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.hreflang", &ok);
if (!ok) {
//Need to throw error here
@ -375,6 +390,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -389,6 +405,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_REL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.rel", &ok);
if (!ok) {
//Need to throw error here
@ -403,6 +420,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_REV:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.rev", &ok);
if (!ok) {
//Need to throw error here
@ -417,6 +435,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_SHAPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.shape", &ok);
if (!ok) {
//Need to throw error here
@ -431,6 +450,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -452,6 +472,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -466,6 +487,7 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLANCHORELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlanchorelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -481,7 +503,6 @@ SetHTMLAnchorElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -532,8 +553,8 @@ HTMLAnchorElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -543,7 +564,6 @@ HTMLAnchorElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -575,8 +595,8 @@ HTMLAnchorElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -586,7 +606,6 @@ HTMLAnchorElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLAppletElement.h"
@ -70,14 +71,14 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLAPPLETELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -94,6 +95,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_ALT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.alt", &ok);
if (!ok) {
//Need to throw error here
@ -110,6 +112,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_ARCHIVE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.archive", &ok);
if (!ok) {
//Need to throw error here
@ -126,6 +129,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_CODE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.code", &ok);
if (!ok) {
//Need to throw error here
@ -142,6 +146,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_CODEBASE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.codebase", &ok);
if (!ok) {
//Need to throw error here
@ -158,6 +163,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -174,6 +180,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_HSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.hspace", &ok);
if (!ok) {
//Need to throw error here
@ -190,6 +197,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -206,6 +214,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_OBJECT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.object", &ok);
if (!ok) {
//Need to throw error here
@ -222,6 +231,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_VSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.vspace", &ok);
if (!ok) {
//Need to throw error here
@ -238,6 +248,7 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -255,7 +266,6 @@ GetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -280,14 +290,14 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLAPPLETELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -302,6 +312,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_ALT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.alt", &ok);
if (!ok) {
//Need to throw error here
@ -316,6 +327,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_ARCHIVE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.archive", &ok);
if (!ok) {
//Need to throw error here
@ -330,6 +342,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_CODE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.code", &ok);
if (!ok) {
//Need to throw error here
@ -344,6 +357,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_CODEBASE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.codebase", &ok);
if (!ok) {
//Need to throw error here
@ -358,6 +372,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -372,6 +387,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_HSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.hspace", &ok);
if (!ok) {
//Need to throw error here
@ -386,6 +402,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -400,6 +417,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_OBJECT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.object", &ok);
if (!ok) {
//Need to throw error here
@ -414,6 +432,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_VSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.vspace", &ok);
if (!ok) {
//Need to throw error here
@ -428,6 +447,7 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAPPLETELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlappletelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -443,7 +463,6 @@ SetHTMLAppletElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLAreaElement.h"
@ -67,14 +68,14 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLAREAELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -91,6 +92,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_ALT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.alt", &ok);
if (!ok) {
//Need to throw error here
@ -107,6 +109,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_COORDS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.coords", &ok);
if (!ok) {
//Need to throw error here
@ -123,6 +126,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.href", &ok);
if (!ok) {
//Need to throw error here
@ -139,6 +143,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_NOHREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.nohref", &ok);
if (!ok) {
//Need to throw error here
@ -155,6 +160,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_SHAPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.shape", &ok);
if (!ok) {
//Need to throw error here
@ -171,6 +177,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -187,6 +194,7 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -204,7 +212,6 @@ GetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -229,14 +236,14 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLAREAELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -251,6 +258,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_ALT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.alt", &ok);
if (!ok) {
//Need to throw error here
@ -265,6 +273,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_COORDS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.coords", &ok);
if (!ok) {
//Need to throw error here
@ -279,6 +288,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.href", &ok);
if (!ok) {
//Need to throw error here
@ -293,6 +303,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_NOHREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.nohref", &ok);
if (!ok) {
//Need to throw error here
@ -309,6 +320,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_SHAPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.shape", &ok);
if (!ok) {
//Need to throw error here
@ -323,6 +335,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -344,6 +357,7 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLAREAELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlareaelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -359,7 +373,6 @@ SetHTMLAreaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLBRElement.h"
@ -60,14 +61,14 @@ GetHTMLBRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBRELEMENT_CLEAR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbrelement.clear", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLBRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLBRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBRELEMENT_CLEAR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbrelement.clear", &ok);
if (!ok) {
//Need to throw error here
@ -133,7 +133,6 @@ SetHTMLBRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLBaseElement.h"
@ -61,14 +62,14 @@ GetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBASEELEMENT_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbaseelement.href", &ok);
if (!ok) {
//Need to throw error here
@ -85,6 +86,7 @@ GetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBASEELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbaseelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -102,7 +104,6 @@ GetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -127,14 +128,14 @@ SetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBASEELEMENT_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbaseelement.href", &ok);
if (!ok) {
//Need to throw error here
@ -149,6 +150,7 @@ SetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBASEELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbaseelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -164,7 +166,6 @@ SetHTMLBaseElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLBaseFontElement.h"
@ -62,14 +63,14 @@ GetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBASEFONTELEMENT_COLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbasefontelement.color", &ok);
if (!ok) {
//Need to throw error here
@ -86,6 +87,7 @@ GetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
case HTMLBASEFONTELEMENT_FACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbasefontelement.face", &ok);
if (!ok) {
//Need to throw error here
@ -102,6 +104,7 @@ GetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
case HTMLBASEFONTELEMENT_SIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbasefontelement.size", &ok);
if (!ok) {
//Need to throw error here
@ -119,7 +122,6 @@ GetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -144,14 +146,14 @@ SetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBASEFONTELEMENT_COLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbasefontelement.color", &ok);
if (!ok) {
//Need to throw error here
@ -166,6 +168,7 @@ SetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
case HTMLBASEFONTELEMENT_FACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbasefontelement.face", &ok);
if (!ok) {
//Need to throw error here
@ -180,6 +183,7 @@ SetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
case HTMLBASEFONTELEMENT_SIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbasefontelement.size", &ok);
if (!ok) {
//Need to throw error here
@ -195,7 +199,6 @@ SetHTMLBaseFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLBodyElement.h"
@ -65,14 +66,14 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBODYELEMENT_ALINK:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.alink", &ok);
if (!ok) {
//Need to throw error here
@ -89,6 +90,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_BACKGROUND:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.background", &ok);
if (!ok) {
//Need to throw error here
@ -105,6 +107,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_BGCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.bgcolor", &ok);
if (!ok) {
//Need to throw error here
@ -121,6 +124,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_LINK:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.link", &ok);
if (!ok) {
//Need to throw error here
@ -137,6 +141,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_TEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.text", &ok);
if (!ok) {
//Need to throw error here
@ -153,6 +158,7 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_VLINK:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.vlink", &ok);
if (!ok) {
//Need to throw error here
@ -170,7 +176,6 @@ GetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -195,14 +200,14 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBODYELEMENT_ALINK:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.alink", &ok);
if (!ok) {
//Need to throw error here
@ -217,6 +222,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_BACKGROUND:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.background", &ok);
if (!ok) {
//Need to throw error here
@ -231,6 +237,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_BGCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.bgcolor", &ok);
if (!ok) {
//Need to throw error here
@ -245,6 +252,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_LINK:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.link", &ok);
if (!ok) {
//Need to throw error here
@ -259,6 +267,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_TEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.text", &ok);
if (!ok) {
//Need to throw error here
@ -273,6 +282,7 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBODYELEMENT_VLINK:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbodyelement.vlink", &ok);
if (!ok) {
//Need to throw error here
@ -288,7 +298,6 @@ SetHTMLBodyElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNSHTMLButtonElement.h"
@ -72,14 +73,14 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBUTTONELEMENT_FORM:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.form", &ok);
if (!ok) {
//Need to throw error here
@ -97,6 +98,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -113,6 +115,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -129,6 +132,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -145,6 +149,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -161,6 +166,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -177,6 +183,7 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.value", &ok);
if (!ok) {
//Need to throw error here
@ -194,7 +201,6 @@ GetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -219,14 +225,14 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLBUTTONELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -241,6 +247,7 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -257,6 +264,7 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -271,6 +279,7 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -292,6 +301,7 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLBUTTONELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlbuttonelement.value", &ok);
if (!ok) {
//Need to throw error here
@ -307,7 +317,6 @@ SetHTMLButtonElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -364,8 +373,8 @@ NSHTMLButtonElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -375,7 +384,6 @@ NSHTMLButtonElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -413,8 +421,8 @@ NSHTMLButtonElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -424,7 +432,6 @@ NSHTMLButtonElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNode.h"
@ -64,15 +65,15 @@ GetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
switch(JSVAL_TO_INT(id)) {
case HTMLCOLLECTION_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlcollection.length", &ok);
if (!ok) {
//Need to throw error here
@ -150,9 +151,8 @@ SetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
@ -161,7 +161,6 @@ SetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -214,8 +213,8 @@ HTMLCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -225,7 +224,6 @@ HTMLCollectionItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -268,8 +266,8 @@ HTMLCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -279,7 +277,6 @@ HTMLCollectionNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLDListElement.h"
@ -60,14 +61,14 @@ GetHTMLDListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLDLISTELEMENT_COMPACT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldlistelement.compact", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLDListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLDListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLDLISTELEMENT_COMPACT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldlistelement.compact", &ok);
if (!ok) {
//Need to throw error here
@ -135,7 +135,6 @@ SetHTMLDListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLDirectoryElement.h"
@ -60,14 +61,14 @@ GetHTMLDirectoryElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLDIRECTORYELEMENT_COMPACT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldirectoryelement.compact", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLDirectoryElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLDirectoryElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLDIRECTORYELEMENT_COMPACT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldirectoryelement.compact", &ok);
if (!ok) {
//Need to throw error here
@ -135,7 +135,6 @@ SetHTMLDirectoryElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLDivElement.h"
@ -60,14 +61,14 @@ GetHTMLDivElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLDIVELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldivelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLDivElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLDivElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLDIVELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldivelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -133,7 +133,6 @@ SetHTMLDivElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMElement.h"
@ -95,15 +96,15 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
switch(JSVAL_TO_INT(id)) {
case HTMLDOCUMENT_TITLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.title", &ok);
if (!ok) {
//Need to throw error here
@ -120,6 +121,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_REFERRER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.referrer", &ok);
if (!ok) {
//Need to throw error here
@ -136,6 +138,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_DOMAIN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.domain", &ok);
if (!ok) {
//Need to throw error here
@ -152,6 +155,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_URL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.url", &ok);
if (!ok) {
//Need to throw error here
@ -168,6 +172,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_BODY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.body", &ok);
if (!ok) {
//Need to throw error here
@ -185,6 +190,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_IMAGES:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.images", &ok);
if (!ok) {
//Need to throw error here
@ -202,6 +208,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_APPLETS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.applets", &ok);
if (!ok) {
//Need to throw error here
@ -219,6 +226,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_LINKS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.links", &ok);
if (!ok) {
//Need to throw error here
@ -236,6 +244,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_FORMS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.forms", &ok);
if (!ok) {
//Need to throw error here
@ -253,6 +262,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_ANCHORS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.anchors", &ok);
if (!ok) {
//Need to throw error here
@ -270,6 +280,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_COOKIE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.cookie", &ok);
if (!ok) {
//Need to throw error here
@ -286,6 +297,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_ALINKCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.alinkcolor", &ok);
if (!ok) {
//Need to throw error here
@ -311,6 +323,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_LINKCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.linkcolor", &ok);
if (!ok) {
//Need to throw error here
@ -336,6 +349,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_VLINKCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.vlinkcolor", &ok);
if (!ok) {
//Need to throw error here
@ -361,6 +375,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_BGCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.bgcolor", &ok);
if (!ok) {
//Need to throw error here
@ -386,6 +401,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_FGCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.fgcolor", &ok);
if (!ok) {
//Need to throw error here
@ -411,6 +427,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_LASTMODIFIED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.lastmodified", &ok);
if (!ok) {
//Need to throw error here
@ -436,6 +453,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_EMBEDS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.embeds", &ok);
if (!ok) {
//Need to throw error here
@ -462,6 +480,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_LAYERS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.layers", &ok);
if (!ok) {
//Need to throw error here
@ -488,6 +507,7 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_PLUGINS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.plugins", &ok);
if (!ok) {
//Need to throw error here
@ -515,7 +535,6 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
checkNamedItem = PR_TRUE;
}
NS_RELEASE(secMan);
}
if (checkNamedItem) {
@ -576,15 +595,15 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
switch(JSVAL_TO_INT(id)) {
case HTMLDOCUMENT_TITLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.title", &ok);
if (!ok) {
//Need to throw error here
@ -599,6 +618,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_BODY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.body", &ok);
if (!ok) {
//Need to throw error here
@ -617,6 +637,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLDOCUMENT_COOKIE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmldocument.cookie", &ok);
if (!ok) {
//Need to throw error here
@ -631,6 +652,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_ALINKCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.alinkcolor", &ok);
if (!ok) {
//Need to throw error here
@ -654,6 +676,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_LINKCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.linkcolor", &ok);
if (!ok) {
//Need to throw error here
@ -677,6 +700,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_VLINKCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.vlinkcolor", &ok);
if (!ok) {
//Need to throw error here
@ -700,6 +724,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_BGCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.bgcolor", &ok);
if (!ok) {
//Need to throw error here
@ -723,6 +748,7 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLDOCUMENT_FGCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmldocument.fgcolor", &ok);
if (!ok) {
//Need to throw error here
@ -747,7 +773,6 @@ SetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -798,8 +823,8 @@ HTMLDocumentClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -809,7 +834,6 @@ HTMLDocumentClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -843,8 +867,8 @@ HTMLDocumentGetElementById(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -854,7 +878,6 @@ HTMLDocumentGetElementById(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -894,8 +917,8 @@ HTMLDocumentGetElementsByName(JSContext *cx, JSObject *obj, uintN argc, jsval *a
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -905,7 +928,6 @@ HTMLDocumentGetElementsByName(JSContext *cx, JSObject *obj, uintN argc, jsval *a
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -950,8 +972,8 @@ NSHTMLDocumentGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -961,7 +983,6 @@ NSHTMLDocumentGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1001,8 +1022,8 @@ NSHTMLDocumentNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1012,7 +1033,6 @@ NSHTMLDocumentNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, j
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1056,8 +1076,8 @@ NSHTMLDocumentOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1067,7 +1087,6 @@ NSHTMLDocumentOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1105,8 +1124,8 @@ NSHTMLDocumentWrite(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1116,7 +1135,6 @@ NSHTMLDocumentWrite(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -1154,8 +1172,8 @@ NSHTMLDocumentWriteln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -1165,7 +1183,6 @@ NSHTMLDocumentWriteln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLElement.h"
@ -68,14 +69,14 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLELEMENT_ID:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.id", &ok);
if (!ok) {
//Need to throw error here
@ -92,6 +93,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLELEMENT_TITLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.title", &ok);
if (!ok) {
//Need to throw error here
@ -108,6 +110,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLELEMENT_LANG:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.lang", &ok);
if (!ok) {
//Need to throw error here
@ -124,6 +127,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLELEMENT_DIR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.dir", &ok);
if (!ok) {
//Need to throw error here
@ -140,6 +144,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLELEMENT_CLASSNAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.classname", &ok);
if (!ok) {
//Need to throw error here
@ -156,6 +161,7 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLELEMENT_STYLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.style", &ok);
if (!ok) {
//Need to throw error here
@ -174,7 +180,6 @@ GetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -199,14 +204,14 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLELEMENT_ID:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.id", &ok);
if (!ok) {
//Need to throw error here
@ -221,6 +226,7 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLELEMENT_TITLE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.title", &ok);
if (!ok) {
//Need to throw error here
@ -235,6 +241,7 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLELEMENT_LANG:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.lang", &ok);
if (!ok) {
//Need to throw error here
@ -249,6 +256,7 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLELEMENT_DIR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.dir", &ok);
if (!ok) {
//Need to throw error here
@ -263,6 +271,7 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLELEMENT_CLASSNAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlelement.classname", &ok);
if (!ok) {
//Need to throw error here
@ -278,7 +287,6 @@ SetHTMLElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMPlugin.h"
@ -72,14 +73,14 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLEMBEDELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -96,6 +97,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -112,6 +114,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -128,6 +131,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -144,6 +148,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -160,6 +165,7 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -177,7 +183,6 @@ GetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -202,14 +207,14 @@ SetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLEMBEDELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -224,6 +229,7 @@ SetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -238,6 +244,7 @@ SetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -252,6 +259,7 @@ SetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -266,6 +274,7 @@ SetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -280,6 +289,7 @@ SetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLEMBEDELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlembedelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -295,7 +305,6 @@ SetHTMLEmbedElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLFieldSetElement.h"
@ -63,14 +64,14 @@ GetHTMLFieldSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLFIELDSETELEMENT_FORM:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlfieldsetelement.form", &ok);
if (!ok) {
//Need to throw error here
@ -89,7 +90,6 @@ GetHTMLFieldSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -114,9 +114,8 @@ SetHTMLFieldSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
@ -124,7 +123,6 @@ SetHTMLFieldSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLFontElement.h"
@ -62,14 +63,14 @@ GetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLFONTELEMENT_COLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlfontelement.color", &ok);
if (!ok) {
//Need to throw error here
@ -86,6 +87,7 @@ GetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFONTELEMENT_FACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlfontelement.face", &ok);
if (!ok) {
//Need to throw error here
@ -102,6 +104,7 @@ GetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFONTELEMENT_SIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlfontelement.size", &ok);
if (!ok) {
//Need to throw error here
@ -119,7 +122,6 @@ GetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -144,14 +146,14 @@ SetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLFONTELEMENT_COLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlfontelement.color", &ok);
if (!ok) {
//Need to throw error here
@ -166,6 +168,7 @@ SetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFONTELEMENT_FACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlfontelement.face", &ok);
if (!ok) {
//Need to throw error here
@ -180,6 +183,7 @@ SetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFONTELEMENT_SIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlfontelement.size", &ok);
if (!ok) {
//Need to throw error here
@ -195,7 +199,6 @@ SetHTMLFontElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMNSHTMLFormElement.h"
@ -78,15 +79,15 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
switch(JSVAL_TO_INT(id)) {
case HTMLFORMELEMENT_ELEMENTS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.elements", &ok);
if (!ok) {
//Need to throw error here
@ -104,6 +105,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_LENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.length", &ok);
if (!ok) {
//Need to throw error here
@ -120,6 +122,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -136,6 +139,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_ACCEPTCHARSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.acceptcharset", &ok);
if (!ok) {
//Need to throw error here
@ -152,6 +156,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_ACTION:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.action", &ok);
if (!ok) {
//Need to throw error here
@ -168,6 +173,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_ENCTYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.enctype", &ok);
if (!ok) {
//Need to throw error here
@ -184,6 +190,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_METHOD:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.method", &ok);
if (!ok) {
//Need to throw error here
@ -200,6 +207,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -216,6 +224,7 @@ GetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case NSHTMLFORMELEMENT_ENCODING:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "nshtmlformelement.encoding", &ok);
if (!ok) {
//Need to throw error here
@ -320,15 +329,15 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
PRBool checkNamedItem = PR_TRUE;
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
checkNamedItem = PR_FALSE;
switch(JSVAL_TO_INT(id)) {
case HTMLFORMELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -343,6 +352,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_ACCEPTCHARSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.acceptcharset", &ok);
if (!ok) {
//Need to throw error here
@ -357,6 +367,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_ACTION:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.action", &ok);
if (!ok) {
//Need to throw error here
@ -371,6 +382,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_ENCTYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.enctype", &ok);
if (!ok) {
//Need to throw error here
@ -385,6 +397,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_METHOD:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.method", &ok);
if (!ok) {
//Need to throw error here
@ -399,6 +412,7 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFORMELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlformelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -414,7 +428,6 @@ SetHTMLFormElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -465,8 +478,8 @@ HTMLFormElementSubmit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -476,7 +489,6 @@ HTMLFormElementSubmit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -508,8 +520,8 @@ HTMLFormElementReset(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -519,7 +531,6 @@ HTMLFormElementReset(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -559,8 +570,8 @@ NSHTMLFormElementNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -570,7 +581,6 @@ NSHTMLFormElementNamedItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -616,8 +626,8 @@ NSHTMLFormElementItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -627,7 +637,6 @@ NSHTMLFormElementItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLFrameElement.h"
@ -67,14 +68,14 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLFRAMEELEMENT_FRAMEBORDER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.frameborder", &ok);
if (!ok) {
//Need to throw error here
@ -91,6 +92,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_LONGDESC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.longdesc", &ok);
if (!ok) {
//Need to throw error here
@ -107,6 +109,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_MARGINHEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.marginheight", &ok);
if (!ok) {
//Need to throw error here
@ -123,6 +126,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_MARGINWIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.marginwidth", &ok);
if (!ok) {
//Need to throw error here
@ -139,6 +143,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -155,6 +160,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_NORESIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.noresize", &ok);
if (!ok) {
//Need to throw error here
@ -171,6 +177,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_SCROLLING:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.scrolling", &ok);
if (!ok) {
//Need to throw error here
@ -187,6 +194,7 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -204,7 +212,6 @@ GetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -229,14 +236,14 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLFRAMEELEMENT_FRAMEBORDER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.frameborder", &ok);
if (!ok) {
//Need to throw error here
@ -251,6 +258,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_LONGDESC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.longdesc", &ok);
if (!ok) {
//Need to throw error here
@ -265,6 +273,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_MARGINHEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.marginheight", &ok);
if (!ok) {
//Need to throw error here
@ -279,6 +288,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_MARGINWIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.marginwidth", &ok);
if (!ok) {
//Need to throw error here
@ -293,6 +303,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -307,6 +318,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_NORESIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.noresize", &ok);
if (!ok) {
//Need to throw error here
@ -323,6 +335,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_SCROLLING:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.scrolling", &ok);
if (!ok) {
//Need to throw error here
@ -337,6 +350,7 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLFRAMEELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframeelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -352,7 +366,6 @@ SetHTMLFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLFrameSetElement.h"
@ -61,14 +62,14 @@ GetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLFRAMESETELEMENT_COLS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframesetelement.cols", &ok);
if (!ok) {
//Need to throw error here
@ -85,6 +86,7 @@ GetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
case HTMLFRAMESETELEMENT_ROWS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframesetelement.rows", &ok);
if (!ok) {
//Need to throw error here
@ -102,7 +104,6 @@ GetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -127,14 +128,14 @@ SetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLFRAMESETELEMENT_COLS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframesetelement.cols", &ok);
if (!ok) {
//Need to throw error here
@ -149,6 +150,7 @@ SetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
case HTMLFRAMESETELEMENT_ROWS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlframesetelement.rows", &ok);
if (!ok) {
//Need to throw error here
@ -164,7 +166,6 @@ SetHTMLFrameSetElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLHRElement.h"
@ -63,14 +64,14 @@ GetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLHRELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhrelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -87,6 +88,7 @@ GetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLHRELEMENT_NOSHADE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhrelement.noshade", &ok);
if (!ok) {
//Need to throw error here
@ -103,6 +105,7 @@ GetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLHRELEMENT_SIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhrelement.size", &ok);
if (!ok) {
//Need to throw error here
@ -119,6 +122,7 @@ GetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLHRELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhrelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -136,7 +140,6 @@ GetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -161,14 +164,14 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLHRELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhrelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -183,6 +186,7 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLHRELEMENT_NOSHADE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhrelement.noshade", &ok);
if (!ok) {
//Need to throw error here
@ -199,6 +203,7 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLHRELEMENT_SIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhrelement.size", &ok);
if (!ok) {
//Need to throw error here
@ -213,6 +218,7 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLHRELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhrelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -228,7 +234,6 @@ SetHTMLHRElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLHeadElement.h"
@ -60,14 +61,14 @@ GetHTMLHeadElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLHEADELEMENT_PROFILE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlheadelement.profile", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLHeadElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLHeadElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLHEADELEMENT_PROFILE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlheadelement.profile", &ok);
if (!ok) {
//Need to throw error here
@ -133,7 +133,6 @@ SetHTMLHeadElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLHeadingElement.h"
@ -60,14 +61,14 @@ GetHTMLHeadingElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLHEADINGELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlheadingelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLHeadingElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLHeadingElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLHEADINGELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlheadingelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -133,7 +133,6 @@ SetHTMLHeadingElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLHtmlElement.h"
@ -60,14 +61,14 @@ GetHTMLHtmlElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLHTMLELEMENT_VERSION:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhtmlelement.version", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLHtmlElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLHtmlElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLHTMLELEMENT_VERSION:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlhtmlelement.version", &ok);
if (!ok) {
//Need to throw error here
@ -133,7 +133,6 @@ SetHTMLHtmlElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLIFrameElement.h"
@ -69,14 +70,14 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLIFRAMEELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -93,6 +94,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_FRAMEBORDER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.frameborder", &ok);
if (!ok) {
//Need to throw error here
@ -109,6 +111,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -125,6 +128,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_LONGDESC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.longdesc", &ok);
if (!ok) {
//Need to throw error here
@ -141,6 +145,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_MARGINHEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.marginheight", &ok);
if (!ok) {
//Need to throw error here
@ -157,6 +162,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_MARGINWIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.marginwidth", &ok);
if (!ok) {
//Need to throw error here
@ -173,6 +179,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -189,6 +196,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_SCROLLING:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.scrolling", &ok);
if (!ok) {
//Need to throw error here
@ -205,6 +213,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -221,6 +230,7 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -238,7 +248,6 @@ GetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -263,14 +272,14 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLIFRAMEELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -285,6 +294,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_FRAMEBORDER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.frameborder", &ok);
if (!ok) {
//Need to throw error here
@ -299,6 +309,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -313,6 +324,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_LONGDESC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.longdesc", &ok);
if (!ok) {
//Need to throw error here
@ -327,6 +339,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_MARGINHEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.marginheight", &ok);
if (!ok) {
//Need to throw error here
@ -341,6 +354,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_MARGINWIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.marginwidth", &ok);
if (!ok) {
//Need to throw error here
@ -355,6 +369,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -369,6 +384,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_SCROLLING:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.scrolling", &ok);
if (!ok) {
//Need to throw error here
@ -383,6 +399,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -397,6 +414,7 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIFRAMEELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmliframeelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -412,7 +430,6 @@ SetHTMLIFrameElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMImage.h"
@ -79,14 +80,14 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLIMAGEELEMENT_LOWSRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.lowsrc", &ok);
if (!ok) {
//Need to throw error here
@ -103,6 +104,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -119,6 +121,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -135,6 +138,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_ALT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.alt", &ok);
if (!ok) {
//Need to throw error here
@ -151,6 +155,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_BORDER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.border", &ok);
if (!ok) {
//Need to throw error here
@ -167,6 +172,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -183,6 +189,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_HSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.hspace", &ok);
if (!ok) {
//Need to throw error here
@ -199,6 +206,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_ISMAP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.ismap", &ok);
if (!ok) {
//Need to throw error here
@ -215,6 +223,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_LONGDESC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.longdesc", &ok);
if (!ok) {
//Need to throw error here
@ -231,6 +240,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -247,6 +257,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_USEMAP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.usemap", &ok);
if (!ok) {
//Need to throw error here
@ -263,6 +274,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_VSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.vspace", &ok);
if (!ok) {
//Need to throw error here
@ -279,6 +291,7 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -296,7 +309,6 @@ GetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -321,14 +333,14 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLIMAGEELEMENT_LOWSRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.lowsrc", &ok);
if (!ok) {
//Need to throw error here
@ -343,6 +355,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -357,6 +370,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -371,6 +385,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_ALT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.alt", &ok);
if (!ok) {
//Need to throw error here
@ -385,6 +400,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_BORDER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.border", &ok);
if (!ok) {
//Need to throw error here
@ -399,6 +415,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -413,6 +430,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_HSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.hspace", &ok);
if (!ok) {
//Need to throw error here
@ -427,6 +445,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_ISMAP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.ismap", &ok);
if (!ok) {
//Need to throw error here
@ -443,6 +462,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_LONGDESC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.longdesc", &ok);
if (!ok) {
//Need to throw error here
@ -457,6 +477,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -471,6 +492,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_USEMAP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.usemap", &ok);
if (!ok) {
//Need to throw error here
@ -485,6 +507,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_VSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.vspace", &ok);
if (!ok) {
//Need to throw error here
@ -499,6 +522,7 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLIMAGEELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlimageelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -514,7 +538,6 @@ SetHTMLImageElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLInputElement.h"
@ -81,14 +82,14 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLINPUTELEMENT_DEFAULTVALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.defaultvalue", &ok);
if (!ok) {
//Need to throw error here
@ -105,6 +106,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_DEFAULTCHECKED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.defaultchecked", &ok);
if (!ok) {
//Need to throw error here
@ -121,6 +123,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_FORM:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.form", &ok);
if (!ok) {
//Need to throw error here
@ -138,6 +141,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_ACCEPT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.accept", &ok);
if (!ok) {
//Need to throw error here
@ -154,6 +158,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -170,6 +175,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -186,6 +192,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_ALT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.alt", &ok);
if (!ok) {
//Need to throw error here
@ -202,6 +209,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_CHECKED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.checked", &ok);
if (!ok) {
//Need to throw error here
@ -218,6 +226,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -234,6 +243,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_MAXLENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.maxlength", &ok);
if (!ok) {
//Need to throw error here
@ -250,6 +260,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -266,6 +277,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_READONLY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.readonly", &ok);
if (!ok) {
//Need to throw error here
@ -282,6 +294,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_SIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.size", &ok);
if (!ok) {
//Need to throw error here
@ -298,6 +311,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -314,6 +328,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -330,6 +345,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -346,6 +362,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_USEMAP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.usemap", &ok);
if (!ok) {
//Need to throw error here
@ -362,6 +379,7 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.value", &ok);
if (!ok) {
//Need to throw error here
@ -378,13 +396,14 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_AUTOCOMPLETE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.autocomplete", &ok);
if (!ok) {
//Need to throw error here
return JS_FALSE;
}
nsAutoString prop;
if (NS_OK == a->GetAutocomplete(prop)) {
if (NS_SUCCEEDED(a->GetAutocomplete(prop))) {
nsJSUtils::nsConvertStringToJSVal(prop, cx, vp);
}
else {
@ -395,7 +414,6 @@ GetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -420,14 +438,14 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLINPUTELEMENT_DEFAULTVALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.defaultvalue", &ok);
if (!ok) {
//Need to throw error here
@ -442,6 +460,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_DEFAULTCHECKED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.defaultchecked", &ok);
if (!ok) {
//Need to throw error here
@ -458,6 +477,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_ACCEPT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.accept", &ok);
if (!ok) {
//Need to throw error here
@ -472,6 +492,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -486,6 +507,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -500,6 +522,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_ALT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.alt", &ok);
if (!ok) {
//Need to throw error here
@ -514,6 +537,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_CHECKED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.checked", &ok);
if (!ok) {
//Need to throw error here
@ -530,6 +554,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -546,6 +571,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_MAXLENGTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.maxlength", &ok);
if (!ok) {
//Need to throw error here
@ -567,6 +593,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -581,6 +608,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_READONLY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.readonly", &ok);
if (!ok) {
//Need to throw error here
@ -597,6 +625,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_SIZE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.size", &ok);
if (!ok) {
//Need to throw error here
@ -611,6 +640,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_SRC:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.src", &ok);
if (!ok) {
//Need to throw error here
@ -625,6 +655,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -646,6 +677,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_USEMAP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.usemap", &ok);
if (!ok) {
//Need to throw error here
@ -660,6 +692,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.value", &ok);
if (!ok) {
//Need to throw error here
@ -674,6 +707,7 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLINPUTELEMENT_AUTOCOMPLETE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlinputelement.autocomplete", &ok);
if (!ok) {
//Need to throw error here
@ -686,10 +720,9 @@ SetHTMLInputElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
}
default:
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
@ -740,8 +773,8 @@ HTMLInputElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -751,7 +784,6 @@ HTMLInputElementBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -783,8 +815,8 @@ HTMLInputElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -794,7 +826,6 @@ HTMLInputElementFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -826,8 +857,8 @@ HTMLInputElementSelect(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -837,7 +868,6 @@ HTMLInputElementSelect(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore
@ -869,8 +899,8 @@ HTMLInputElementClick(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
*rval = JSVAL_NULL;
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
{
@ -880,7 +910,6 @@ HTMLInputElementClick(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
//Need to throw error here
return JS_FALSE;
}
NS_RELEASE(secMan);
}
// If there's no private data, this must be the prototype, so ignore

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLFormElement.h"
@ -64,14 +65,14 @@ GetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLISINDEXELEMENT_FORM:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlisindexelement.form", &ok);
if (!ok) {
//Need to throw error here
@ -89,6 +90,7 @@ GetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLISINDEXELEMENT_PROMPT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlisindexelement.prompt", &ok);
if (!ok) {
//Need to throw error here
@ -106,7 +108,6 @@ GetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -131,14 +132,14 @@ SetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLISINDEXELEMENT_PROMPT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlisindexelement.prompt", &ok);
if (!ok) {
//Need to throw error here
@ -154,7 +155,6 @@ SetHTMLIsIndexElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLLIElement.h"
@ -61,14 +62,14 @@ GetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLIELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllielement.type", &ok);
if (!ok) {
//Need to throw error here
@ -85,6 +86,7 @@ GetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLIELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllielement.value", &ok);
if (!ok) {
//Need to throw error here
@ -102,7 +104,6 @@ GetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -127,14 +128,14 @@ SetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLIELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllielement.type", &ok);
if (!ok) {
//Need to throw error here
@ -149,6 +150,7 @@ SetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLIELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllielement.value", &ok);
if (!ok) {
//Need to throw error here
@ -171,7 +173,6 @@ SetHTMLLIElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLFormElement.h"
@ -65,14 +66,14 @@ GetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLABELELEMENT_FORM:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllabelelement.form", &ok);
if (!ok) {
//Need to throw error here
@ -90,6 +91,7 @@ GetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLABELELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllabelelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -106,6 +108,7 @@ GetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLABELELEMENT_HTMLFOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllabelelement.htmlfor", &ok);
if (!ok) {
//Need to throw error here
@ -123,7 +126,6 @@ GetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -148,14 +150,14 @@ SetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLABELELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllabelelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -170,6 +172,7 @@ SetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLABELELEMENT_HTMLFOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllabelelement.htmlfor", &ok);
if (!ok) {
//Need to throw error here
@ -185,7 +188,6 @@ SetHTMLLabelElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMDocument.h"
@ -70,14 +71,14 @@ GetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLAYERELEMENT_TOP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.top", &ok);
if (!ok) {
//Need to throw error here
@ -94,6 +95,7 @@ GetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_LEFT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.left", &ok);
if (!ok) {
//Need to throw error here
@ -110,6 +112,7 @@ GetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_VISIBILITY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.visibility", &ok);
if (!ok) {
//Need to throw error here
@ -126,6 +129,7 @@ GetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_BACKGROUND:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.background", &ok);
if (!ok) {
//Need to throw error here
@ -142,6 +146,7 @@ GetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_BGCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.bgcolor", &ok);
if (!ok) {
//Need to throw error here
@ -158,6 +163,7 @@ GetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -174,6 +180,7 @@ GetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_ZINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.zindex", &ok);
if (!ok) {
//Need to throw error here
@ -190,6 +197,7 @@ GetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_DOCUMENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.document", &ok);
if (!ok) {
//Need to throw error here
@ -208,7 +216,6 @@ GetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -233,14 +240,14 @@ SetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLAYERELEMENT_TOP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.top", &ok);
if (!ok) {
//Need to throw error here
@ -262,6 +269,7 @@ SetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_LEFT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.left", &ok);
if (!ok) {
//Need to throw error here
@ -283,6 +291,7 @@ SetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_VISIBILITY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.visibility", &ok);
if (!ok) {
//Need to throw error here
@ -297,6 +306,7 @@ SetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_BACKGROUND:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.background", &ok);
if (!ok) {
//Need to throw error here
@ -311,6 +321,7 @@ SetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_BGCOLOR:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.bgcolor", &ok);
if (!ok) {
//Need to throw error here
@ -325,6 +336,7 @@ SetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -339,6 +351,7 @@ SetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLAYERELEMENT_ZINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllayerelement.zindex", &ok);
if (!ok) {
//Need to throw error here
@ -361,7 +374,6 @@ SetHTMLLayerElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLFormElement.h"
@ -65,14 +66,14 @@ GetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLEGENDELEMENT_FORM:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllegendelement.form", &ok);
if (!ok) {
//Need to throw error here
@ -90,6 +91,7 @@ GetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLEGENDELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllegendelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -106,6 +108,7 @@ GetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLEGENDELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllegendelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -123,7 +126,6 @@ GetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -148,14 +150,14 @@ SetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLEGENDELEMENT_ACCESSKEY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllegendelement.accesskey", &ok);
if (!ok) {
//Need to throw error here
@ -170,6 +172,7 @@ SetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLEGENDELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllegendelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -185,7 +188,6 @@ SetHTMLLegendElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLLinkElement.h"
@ -68,14 +69,14 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLINKELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -92,6 +93,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_CHARSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.charset", &ok);
if (!ok) {
//Need to throw error here
@ -108,6 +110,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.href", &ok);
if (!ok) {
//Need to throw error here
@ -124,6 +127,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_HREFLANG:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.hreflang", &ok);
if (!ok) {
//Need to throw error here
@ -140,6 +144,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_MEDIA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.media", &ok);
if (!ok) {
//Need to throw error here
@ -156,6 +161,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_REL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.rel", &ok);
if (!ok) {
//Need to throw error here
@ -172,6 +178,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_REV:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.rev", &ok);
if (!ok) {
//Need to throw error here
@ -188,6 +195,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -204,6 +212,7 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -221,7 +230,6 @@ GetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -246,14 +254,14 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLLINKELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -270,6 +278,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_CHARSET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.charset", &ok);
if (!ok) {
//Need to throw error here
@ -284,6 +293,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_HREF:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.href", &ok);
if (!ok) {
//Need to throw error here
@ -298,6 +308,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_HREFLANG:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.hreflang", &ok);
if (!ok) {
//Need to throw error here
@ -312,6 +323,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_MEDIA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.media", &ok);
if (!ok) {
//Need to throw error here
@ -326,6 +338,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_REL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.rel", &ok);
if (!ok) {
//Need to throw error here
@ -340,6 +353,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_REV:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.rev", &ok);
if (!ok) {
//Need to throw error here
@ -354,6 +368,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_TARGET:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.target", &ok);
if (!ok) {
//Need to throw error here
@ -368,6 +383,7 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLLINKELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmllinkelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -383,7 +399,6 @@ SetHTMLLinkElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLMapElement.h"
@ -64,14 +65,14 @@ GetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLMAPELEMENT_AREAS:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmapelement.areas", &ok);
if (!ok) {
//Need to throw error here
@ -89,6 +90,7 @@ GetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLMAPELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmapelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -106,7 +108,6 @@ GetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -131,14 +132,14 @@ SetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLMAPELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmapelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -154,7 +155,6 @@ SetHTMLMapElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLMenuElement.h"
@ -60,14 +61,14 @@ GetHTMLMenuElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLMENUELEMENT_COMPACT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmenuelement.compact", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLMenuElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLMenuElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLMENUELEMENT_COMPACT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmenuelement.compact", &ok);
if (!ok) {
//Need to throw error here
@ -135,7 +135,6 @@ SetHTMLMenuElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLMetaElement.h"
@ -63,14 +64,14 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLMETAELEMENT_CONTENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmetaelement.content", &ok);
if (!ok) {
//Need to throw error here
@ -87,6 +88,7 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLMETAELEMENT_HTTPEQUIV:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmetaelement.httpequiv", &ok);
if (!ok) {
//Need to throw error here
@ -103,6 +105,7 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLMETAELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmetaelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -119,6 +122,7 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLMETAELEMENT_SCHEME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmetaelement.scheme", &ok);
if (!ok) {
//Need to throw error here
@ -136,7 +140,6 @@ GetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -161,14 +164,14 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLMETAELEMENT_CONTENT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmetaelement.content", &ok);
if (!ok) {
//Need to throw error here
@ -183,6 +186,7 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLMETAELEMENT_HTTPEQUIV:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmetaelement.httpequiv", &ok);
if (!ok) {
//Need to throw error here
@ -197,6 +201,7 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLMETAELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmetaelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -211,6 +216,7 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLMETAELEMENT_SCHEME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmetaelement.scheme", &ok);
if (!ok) {
//Need to throw error here
@ -226,7 +232,6 @@ SetHTMLMetaElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLModElement.h"
@ -61,14 +62,14 @@ GetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLMODELEMENT_CITE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmodelement.cite", &ok);
if (!ok) {
//Need to throw error here
@ -85,6 +86,7 @@ GetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLMODELEMENT_DATETIME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmodelement.datetime", &ok);
if (!ok) {
//Need to throw error here
@ -102,7 +104,6 @@ GetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -127,14 +128,14 @@ SetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLMODELEMENT_CITE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmodelement.cite", &ok);
if (!ok) {
//Need to throw error here
@ -149,6 +150,7 @@ SetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLMODELEMENT_DATETIME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlmodelement.datetime", &ok);
if (!ok) {
//Need to throw error here
@ -164,7 +166,6 @@ SetHTMLModElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLOListElement.h"
@ -62,14 +63,14 @@ GetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLOLISTELEMENT_COMPACT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlolistelement.compact", &ok);
if (!ok) {
//Need to throw error here
@ -86,6 +87,7 @@ GetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOLISTELEMENT_START:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlolistelement.start", &ok);
if (!ok) {
//Need to throw error here
@ -102,6 +104,7 @@ GetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOLISTELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlolistelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -119,7 +122,6 @@ GetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -144,14 +146,14 @@ SetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLOLISTELEMENT_COMPACT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlolistelement.compact", &ok);
if (!ok) {
//Need to throw error here
@ -168,6 +170,7 @@ SetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOLISTELEMENT_START:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlolistelement.start", &ok);
if (!ok) {
//Need to throw error here
@ -189,6 +192,7 @@ SetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOLISTELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlolistelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -204,7 +208,6 @@ SetHTMLOListElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLFormElement.h"
@ -80,14 +81,14 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLOBJECTELEMENT_FORM:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.form", &ok);
if (!ok) {
//Need to throw error here
@ -105,6 +106,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_CODE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.code", &ok);
if (!ok) {
//Need to throw error here
@ -121,6 +123,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -137,6 +140,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_ARCHIVE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.archive", &ok);
if (!ok) {
//Need to throw error here
@ -153,6 +157,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_BORDER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.border", &ok);
if (!ok) {
//Need to throw error here
@ -169,6 +174,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_CODEBASE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.codebase", &ok);
if (!ok) {
//Need to throw error here
@ -185,6 +191,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_CODETYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.codetype", &ok);
if (!ok) {
//Need to throw error here
@ -201,6 +208,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_DATA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.data", &ok);
if (!ok) {
//Need to throw error here
@ -217,6 +225,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_DECLARE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.declare", &ok);
if (!ok) {
//Need to throw error here
@ -233,6 +242,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -249,6 +259,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_HSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.hspace", &ok);
if (!ok) {
//Need to throw error here
@ -265,6 +276,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -281,6 +293,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_STANDBY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.standby", &ok);
if (!ok) {
//Need to throw error here
@ -297,6 +310,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -313,6 +327,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -329,6 +344,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_USEMAP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.usemap", &ok);
if (!ok) {
//Need to throw error here
@ -345,6 +361,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_VSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.vspace", &ok);
if (!ok) {
//Need to throw error here
@ -361,6 +378,7 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -378,7 +396,6 @@ GetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -403,14 +420,14 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLOBJECTELEMENT_CODE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.code", &ok);
if (!ok) {
//Need to throw error here
@ -425,6 +442,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -439,6 +457,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_ARCHIVE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.archive", &ok);
if (!ok) {
//Need to throw error here
@ -453,6 +472,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_BORDER:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.border", &ok);
if (!ok) {
//Need to throw error here
@ -467,6 +487,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_CODEBASE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.codebase", &ok);
if (!ok) {
//Need to throw error here
@ -481,6 +502,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_CODETYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.codetype", &ok);
if (!ok) {
//Need to throw error here
@ -495,6 +517,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_DATA:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.data", &ok);
if (!ok) {
//Need to throw error here
@ -509,6 +532,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_DECLARE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.declare", &ok);
if (!ok) {
//Need to throw error here
@ -525,6 +549,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_HEIGHT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.height", &ok);
if (!ok) {
//Need to throw error here
@ -539,6 +564,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_HSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.hspace", &ok);
if (!ok) {
//Need to throw error here
@ -553,6 +579,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -567,6 +594,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_STANDBY:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.standby", &ok);
if (!ok) {
//Need to throw error here
@ -581,6 +609,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_TABINDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.tabindex", &ok);
if (!ok) {
//Need to throw error here
@ -602,6 +631,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -616,6 +646,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_USEMAP:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.usemap", &ok);
if (!ok) {
//Need to throw error here
@ -630,6 +661,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_VSPACE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.vspace", &ok);
if (!ok) {
//Need to throw error here
@ -644,6 +676,7 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOBJECTELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlobjectelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -659,7 +692,6 @@ SetHTMLObjectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLOptGroupElement.h"
@ -61,14 +62,14 @@ GetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLOPTGROUPELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptgroupelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -85,6 +86,7 @@ GetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
case HTMLOPTGROUPELEMENT_LABEL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptgroupelement.label", &ok);
if (!ok) {
//Need to throw error here
@ -102,7 +104,6 @@ GetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -127,14 +128,14 @@ SetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLOPTGROUPELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptgroupelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -151,6 +152,7 @@ SetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
}
case HTMLOPTGROUPELEMENT_LABEL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptgroupelement.label", &ok);
if (!ok) {
//Need to throw error here
@ -166,7 +168,6 @@ SetHTMLOptGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLFormElement.h"
@ -77,14 +78,14 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLOPTIONELEMENT_FORM:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.form", &ok);
if (!ok) {
//Need to throw error here
@ -102,6 +103,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_DEFAULTSELECTED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.defaultselected", &ok);
if (!ok) {
//Need to throw error here
@ -118,6 +120,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_TEXT:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.text", &ok);
if (!ok) {
//Need to throw error here
@ -134,6 +137,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_INDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.index", &ok);
if (!ok) {
//Need to throw error here
@ -150,6 +154,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -166,6 +171,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_LABEL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.label", &ok);
if (!ok) {
//Need to throw error here
@ -182,6 +188,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_SELECTED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.selected", &ok);
if (!ok) {
//Need to throw error here
@ -198,6 +205,7 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.value", &ok);
if (!ok) {
//Need to throw error here
@ -215,7 +223,6 @@ GetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -240,14 +247,14 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLOPTIONELEMENT_DEFAULTSELECTED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.defaultselected", &ok);
if (!ok) {
//Need to throw error here
@ -264,6 +271,7 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_INDEX:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.index", &ok);
if (!ok) {
//Need to throw error here
@ -285,6 +293,7 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_DISABLED:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.disabled", &ok);
if (!ok) {
//Need to throw error here
@ -301,6 +310,7 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_LABEL:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.label", &ok);
if (!ok) {
//Need to throw error here
@ -315,6 +325,7 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLOPTIONELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmloptionelement.value", &ok);
if (!ok) {
//Need to throw error here
@ -330,7 +341,6 @@ SetHTMLOptionElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLParagraphElement.h"
@ -60,14 +61,14 @@ GetHTMLParagraphElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLPARAGRAPHELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparagraphelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLParagraphElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLParagraphElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLPARAGRAPHELEMENT_ALIGN:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparagraphelement.align", &ok);
if (!ok) {
//Need to throw error here
@ -133,7 +133,6 @@ SetHTMLParagraphElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLParamElement.h"
@ -63,14 +64,14 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLPARAMELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparamelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -87,6 +88,7 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLPARAMELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparamelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -103,6 +105,7 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLPARAMELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparamelement.value", &ok);
if (!ok) {
//Need to throw error here
@ -119,6 +122,7 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLPARAMELEMENT_VALUETYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparamelement.valuetype", &ok);
if (!ok) {
//Need to throw error here
@ -136,7 +140,6 @@ GetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -161,14 +164,14 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLPARAMELEMENT_NAME:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparamelement.name", &ok);
if (!ok) {
//Need to throw error here
@ -183,6 +186,7 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLPARAMELEMENT_TYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparamelement.type", &ok);
if (!ok) {
//Need to throw error here
@ -197,6 +201,7 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLPARAMELEMENT_VALUE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparamelement.value", &ok);
if (!ok) {
//Need to throw error here
@ -211,6 +216,7 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
}
case HTMLPARAMELEMENT_VALUETYPE:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlparamelement.valuetype", &ok);
if (!ok) {
//Need to throw error here
@ -226,7 +232,6 @@ SetHTMLParamElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

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

@ -25,6 +25,7 @@
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsIPtr.h"
#include "nsString.h"
#include "nsIDOMHTMLPreElement.h"
@ -60,14 +61,14 @@ GetHTMLPreElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLPREELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlpreelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -85,7 +86,6 @@ GetHTMLPreElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, id, vp);
@ -110,14 +110,14 @@ SetHTMLPreElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (JSVAL_IS_INT(id)) {
nsIScriptContext *scriptCX = (nsIScriptContext *)JS_GetContextPrivate(cx);
nsIScriptSecurityManager *secMan;
PRBool ok = PR_FALSE;
if (NS_OK != scriptCX->GetSecurityManager(&secMan)) {
nsCOMPtr<nsIScriptSecurityManager> secMan;
if (NS_OK != scriptCX->GetSecurityManager(getter_AddRefs(secMan))) {
return JS_FALSE;
}
switch(JSVAL_TO_INT(id)) {
case HTMLPREELEMENT_WIDTH:
{
PRBool ok = PR_FALSE;
secMan->CheckScriptAccess(scriptCX, obj, "htmlpreelement.width", &ok);
if (!ok) {
//Need to throw error here
@ -140,7 +140,6 @@ SetHTMLPreElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);
}
NS_RELEASE(secMan);
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, id, vp);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше