Bug 1396613 - Update rust glue with new objectMoved hook signature r=fitzgen

This commit is contained in:
Jon Coppeard 2017-09-19 12:31:31 +01:00
parent 8bd8591183
commit ff71be3b98
2 changed files with 9 additions and 19 deletions

View File

@ -133,7 +133,8 @@ pub struct ProxyTraps {
pub finalize: pub finalize:
::std::option::Option<unsafe extern "C" fn(fop: *mut JSFreeOp, proxy: *mut JSObject)>, ::std::option::Option<unsafe extern "C" fn(fop: *mut JSFreeOp, proxy: *mut JSObject)>,
pub objectMoved: pub objectMoved:
::std::option::Option<unsafe extern "C" fn(proxy: *mut JSObject, old: *const JSObject)>, ::std::option::Option<unsafe extern "C" fn(proxy: *mut JSObject,
old: *mut JSObject) -> usize>,
pub isCallable: ::std::option::Option<unsafe extern "C" fn(obj: *mut JSObject) -> bool>, pub isCallable: ::std::option::Option<unsafe extern "C" fn(obj: *mut JSObject) -> bool>,
pub isConstructor: ::std::option::Option<unsafe extern "C" fn(obj: *mut JSObject) -> bool>, pub isConstructor: ::std::option::Option<unsafe extern "C" fn(obj: *mut JSObject) -> bool>,
} }

View File

@ -85,7 +85,7 @@ struct ProxyTraps {
bool (*defaultValue)(JSContext *cx, JS::HandleObject obj, JSType hint, JS::MutableHandleValue vp); bool (*defaultValue)(JSContext *cx, JS::HandleObject obj, JSType hint, JS::MutableHandleValue vp);
void (*trace)(JSTracer *trc, JSObject *proxy); void (*trace)(JSTracer *trc, JSObject *proxy);
void (*finalize)(JSFreeOp *fop, JSObject *proxy); void (*finalize)(JSFreeOp *fop, JSObject *proxy);
void (*objectMoved)(JSObject *proxy, const JSObject *old); size_t (*objectMoved)(JSObject *proxy, JSObject *old);
bool (*isCallable)(JSObject *obj); bool (*isCallable)(JSObject *obj);
bool (*isConstructor)(JSObject *obj); bool (*isConstructor)(JSObject *obj);
@ -226,12 +226,11 @@ static int HandlerFamily;
: _base::finalize(fop, proxy); \ : _base::finalize(fop, proxy); \
} \ } \
\ \
virtual void objectMoved(JSObject* proxy, \ virtual size_t objectMoved(JSObject* proxy, JSObject *old) const override \
const JSObject *old) const override \
{ \ { \
mTraps.objectMoved \ return mTraps.objectMoved \
? mTraps.objectMoved(proxy, old) \ ? mTraps.objectMoved(proxy, old) \
: _base::objectMoved(proxy, old); \ : _base::objectMoved(proxy, old); \
} \ } \
\ \
virtual bool isCallable(JSObject* obj) const override \ virtual bool isCallable(JSObject* obj) const override \
@ -568,19 +567,9 @@ WrapperNew(JSContext* aCx, JS::HandleObject aObj, const void* aHandler,
return js::Wrapper::New(aCx, aObj, (const js::Wrapper*)aHandler, options); return js::Wrapper::New(aCx, aObj, (const js::Wrapper*)aHandler, options);
} }
void WindowProxyObjectMoved(JSObject*, const JSObject*) const js::Class WindowProxyClass = PROXY_CLASS_DEF(
{
abort();
}
static const js::ClassExtension WindowProxyClassExtension = PROXY_MAKE_EXT(
WindowProxyObjectMoved
);
const js::Class WindowProxyClass = PROXY_CLASS_WITH_EXT(
"Proxy", "Proxy",
JSCLASS_HAS_RESERVED_SLOTS(1), /* additional class flags */ JSCLASS_HAS_RESERVED_SLOTS(1)); /* additional class flags */
&WindowProxyClassExtension);
const js::Class* const js::Class*
GetWindowProxyClass() GetWindowProxyClass()