Bug 843829 - Apply transitive waivers for nativeCall. r=mrbkap
☠☠ backed out by e60919ded783 ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Tue, 02 Apr 2013 18:51:20 -0700
changeset 127130 2e889cd77a48
parent 127129 97d16e7beb27
child 127131 57652d8f0827
push id117
push usertomi.aarnio@nokia.com
push dateWed, 03 Apr 2013 12:07:07 +0000
reviewersmrbkap
bugs843829
milestone23.0a1
Bug 843829 - Apply transitive waivers for nativeCall. r=mrbkap
js/xpconnect/wrappers/WaiveXrayWrapper.cpp
js/xpconnect/wrappers/WaiveXrayWrapper.h
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.cpp
+++ b/js/xpconnect/wrappers/WaiveXrayWrapper.cpp
@@ -80,9 +80,19 @@ WaiveXrayWrapper::call(JSContext *cx, JS
 bool
 WaiveXrayWrapper::construct(JSContext *cx, JS::Handle<JSObject*> wrapper,
                               unsigned argc, js::Value *argv, JS::MutableHandle<JS::Value> rval)
 {
     return CrossCompartmentWrapper::construct(cx, wrapper, argc, argv, rval) &&
            WrapperFactory::WaiveXrayAndWrap(cx, rval.address());
 }
 
+// NB: This is important as the other side of a handshake with FieldGetter. See
+// nsXBLProtoImplField.cpp.
+bool
+WaiveXrayWrapper::nativeCall(JSContext *cx, JS::IsAcceptableThis test,
+                             JS::NativeImpl impl, JS::CallArgs args)
+{
+    return CrossCompartmentWrapper::nativeCall(cx, test, impl, args) &&
+           WrapperFactory::WaiveXrayAndWrap(cx, args.rval().address());
 }
+
+}
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.h
+++ b/js/xpconnect/wrappers/WaiveXrayWrapper.h
@@ -31,14 +31,17 @@ class WaiveXrayWrapper : public js::Cros
                      JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp) MOZ_OVERRIDE;
 
     virtual bool call(JSContext *cx, JS::Handle<JSObject*> wrapper, unsigned argc,
                       js::Value *vp) MOZ_OVERRIDE;
     virtual bool construct(JSContext *cx, JS::Handle<JSObject*> wrapper,
                            unsigned argc, js::Value *argv,
                            JS::MutableHandle<JS::Value> rval) MOZ_OVERRIDE;
 
+    virtual bool nativeCall(JSContext *cx, JS::IsAcceptableThis test,
+                            JS::NativeImpl impl, JS::CallArgs args) MOZ_OVERRIDE;
+
     static WaiveXrayWrapper singleton;
 };
 
 }
 
 #endif