|
Lines 1222-1239
NewSafeGetterOrSetterThunk(JSContext *cx
Link Here
|
| 1222 |
if(JS_ObjectIsFunction(cx, unsafe_gsobj)) |
1222 |
if(JS_ObjectIsFunction(cx, unsafe_gsobj)) |
| 1223 |
{ |
1223 |
{ |
| 1224 |
JSFunction *unsafe_gsfun = |
1224 |
JSFunction *unsafe_gsfun = |
| 1225 |
(JSFunction *) JS_GetPrivate(cx, unsafe_gsobj); |
1225 |
(JSFunction *) JS_GetPrivate(cx, unsafe_gsobj); |
| 1226 |
if(unsafe_gsfun->native == XPC_WN_Safe_GetterSetterThunkNative) |
1226 |
if(unsafe_gsfun->native == XPC_WN_Safe_GetterSetterThunkNative) |
| 1227 |
return gsop; |
1227 |
return gsop; |
| 1228 |
} |
1228 |
} |
| 1229 |
|
1229 |
|
| 1230 |
// Make a thunk to check cross-trust-domain access before calling gsop. |
1230 |
// Make a thunk to check cross-trust-domain access before calling gsop. |
|
|
1231 |
attrs &= ~JSFUN_BOUND_METHOD; |
| 1231 |
JSFunction *safe_gsfun = JS_NewFunction(cx, |
1232 |
JSFunction *safe_gsfun = JS_NewFunction(cx, |
| 1232 |
XPC_WN_Safe_GetterSetterThunkNative, |
1233 |
XPC_WN_Safe_GetterSetterThunkNative, |
| 1233 |
nargs, attrs, obj, NULL); |
1234 |
nargs, attrs, obj, NULL); |
| 1234 |
if(!safe_gsfun) |
1235 |
if(!safe_gsfun) |
| 1235 |
return NULL; |
1236 |
return NULL; |
| 1236 |
|
1237 |
|
| 1237 |
JSObject *safe_gsobj = JS_GetFunctionObject(safe_gsfun); |
1238 |
JSObject *safe_gsobj = JS_GetFunctionObject(safe_gsfun); |
| 1238 |
|
1239 |
|
| 1239 |
// The only clean way to get id and unsafe_gsobj through is via permanent, |
1240 |
// The only clean way to get id and unsafe_gsobj through is via permanent, |