mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 823225. Move .wrappedJSObject from nsWindowSH::GetProperty to the outer window get hook. r=mrbkap
This commit is contained in:
parent
9e58bd1f8f
commit
71e5c36a75
@ -5169,13 +5169,6 @@ nsWindowSH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
}
|
||||
}
|
||||
|
||||
if (id == sWrappedJSObject_id &&
|
||||
xpc::AccessCheck::isChrome(js::GetContextCompartment(cx))) {
|
||||
obj = JS_ObjectToOuterObject(cx, obj);
|
||||
*vp = OBJECT_TO_JSVAL(obj);
|
||||
return NS_SUCCESS_I_DID_SOMETHING;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -227,6 +227,12 @@
|
||||
#include "nsPISocketTransportService.h"
|
||||
#include "mozilla/dom/AudioContext.h"
|
||||
|
||||
// Apple system headers seem to have a check() macro. <sigh>
|
||||
#ifdef check
|
||||
#undef check
|
||||
#endif // check
|
||||
#include "AccessCheck.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
@ -525,8 +531,10 @@ public:
|
||||
virtual bool isOuterWindow() {
|
||||
return true;
|
||||
}
|
||||
JSString *obj_toString(JSContext *cx, JSObject *wrapper);
|
||||
void finalize(JSFreeOp *fop, JSObject *proxy);
|
||||
virtual JSString *obj_toString(JSContext *cx, JSObject *wrapper) MOZ_OVERRIDE;
|
||||
virtual void finalize(JSFreeOp *fop, JSObject *proxy) MOZ_OVERRIDE;
|
||||
virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver,
|
||||
jsid id, js::Value *vp) MOZ_OVERRIDE;
|
||||
|
||||
static nsOuterWindowProxy singleton;
|
||||
};
|
||||
@ -552,6 +560,19 @@ nsOuterWindowProxy::finalize(JSFreeOp *fop, JSObject *proxy)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsOuterWindowProxy::get(JSContext *cx, JSObject *wrapper, JSObject *receiver,
|
||||
jsid id, js::Value *vp)
|
||||
{
|
||||
if (id == nsDOMClassInfo::sWrappedJSObject_id &&
|
||||
xpc::AccessCheck::isChrome(js::GetContextCompartment(cx))) {
|
||||
*vp = JS::ObjectValue(*wrapper);
|
||||
return true;
|
||||
}
|
||||
|
||||
return js::Wrapper::get(cx, wrapper, receiver, id, vp);
|
||||
}
|
||||
|
||||
nsOuterWindowProxy
|
||||
nsOuterWindowProxy::singleton;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user