Backing out 2cf18052b8ee to fix orange.

This commit is contained in:
Johnny Stenback 2010-03-22 18:43:13 -07:00
commit 5de9282f0d
5 changed files with 0 additions and 47 deletions

View File

@ -363,8 +363,6 @@ WrapObject(JSContext *cx, JSObject *parent, jsval *vp, XPCWrappedNative* wn)
return JS_TRUE;
}
CheckWindow(wn);
XPCJSRuntime *rt = nsXPConnect::GetRuntimeInstance();
// The parent must be the inner global object for its scope.

View File

@ -1229,8 +1229,6 @@ JSObject *
XPCNativeWrapper::GetNewOrUsed(JSContext *cx, XPCWrappedNative *wrapper,
JSObject *scope, nsIPrincipal *aObjectPrincipal)
{
CheckWindow(wrapper);
if (aObjectPrincipal) {
nsIScriptSecurityManager *ssm = GetSecurityManager();

View File

@ -311,12 +311,6 @@ WrapObject(JSContext *cx, JSObject *scope, jsval v, jsval *vp)
return ThrowException(NS_ERROR_FAILURE, cx);
}
XPCWrappedNative *wn =
XPCWrappedNative::GetWrappedNativeOfJSObject(cx, objToWrap);
if (wn) {
CheckWindow(wn);
}
JSObject *wrapperObj =
JS_NewObjectWithGivenProto(cx, &SJOWClass.base, nsnull, scope);

View File

@ -42,7 +42,6 @@
#include "XPCWrapper.h"
#include "XPCNativeWrapper.h"
#include "nsPIDOMWindow.h"
namespace XPCWrapper {
@ -165,35 +164,6 @@ static JSClass IteratorClass = {
JSCLASS_NO_OPTIONAL_MEMBERS
};
void
CheckWindow(XPCWrappedNative *wn)
{
JSClass *clasp = STOBJ_GET_CLASS(wn->GetFlatJSObject());
// Censor objects that can't be windows.
switch (clasp->name[0]) {
case 'C': // ChromeWindow?
if (clasp->name[1] != 'h') {
return;
}
break;
case 'M': // ModalContentWindow
break;
case 'W': // Window
break;
default:
return;
}
nsCOMPtr<nsPIDOMWindow> pwin(do_QueryWrappedNative(wn));
if (!pwin || pwin->IsInnerWindow()) {
return;
}
pwin->EnsureInnerWindow();
}
JSBool
RewrapObject(JSContext *cx, JSObject *scope, JSObject *obj, WrapperType hint,
jsval *vp)

View File

@ -417,13 +417,6 @@ WrapFunction(JSContext *cx, JSObject *wrapperObj, JSObject *funobj, jsval *v,
: XPCCrossOriginWrapper::WrapFunction(cx, wrapperObj, funobj, v);
}
/**
* Given a JSObject that might represent a Window object, ensures that the
* window object has an inner window.
*/
void
CheckWindow(XPCWrappedNative *wn);
/**
* Given a potentially-wrapped object, creates a wrapper for it.
*/