Bug 1034682 - Remove nonsensical sandboxProto waiving in the wantXrays case. r=peterv
authorBobby Holley <bobbyholley@gmail.com>
Fri, 11 Jul 2014 15:56:27 -0700
changeset 215618 cc85d728482e18b3126f4ae3e7adf4a052af787d
parent 215617 c3b1dd01c50fe4831c1982e0e07472498ee27821
child 215619 ee683f7998c16c55deadb9d49282cdbb634ae1b0
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1034682, 611401
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1034682 - Remove nonsensical sandboxProto waiving in the wantXrays case. r=peterv This doesn't make sense. wantXrays means that the WrapperFactory machinery gives us Xrays in the same-origin case. When it's false, we don't have Xrays to same-origin objects to begin with, so the waive is useless. Its only observable effect comes in the situation of privileged (i.e. nsEP) sandboxes with a less-privileged sandboxPrototype. And I see no reason why these things should get a waived prototype. It looks like this was added in 2010 for the Web Console in bug 611401. None of that is applicable anymore.
js/xpconnect/src/Sandbox.cpp
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -903,23 +903,16 @@ xpc::CreateSandboxObject(JSContext *cx, 
     {
         JSAutoCompartment ac(cx, sandbox);
 
         if (options.proto) {
             bool ok = JS_WrapObject(cx, &options.proto);
             if (!ok)
                 return NS_ERROR_XPC_UNEXPECTED;
 
-            if (xpc::WrapperFactory::IsXrayWrapper(options.proto) && !options.wantXrays) {
-                RootedValue v(cx, ObjectValue(*options.proto));
-                if (!xpc::WrapperFactory::WaiveXrayAndWrap(cx, &v))
-                    return NS_ERROR_FAILURE;
-                options.proto = &v.toObject();
-            }
-
             // Now check what sort of thing we've got in |proto|
             JSObject *unwrappedProto = js::UncheckedUnwrap(options.proto, false);
             const js::Class *unwrappedClass = js::GetObjectClass(unwrappedProto);
             if (IS_WN_CLASS(unwrappedClass) ||
                 mozilla::dom::IsDOMClass(Jsvalify(unwrappedClass))) {
                 // Wrap it up in a proxy that will do the right thing in terms
                 // of this-binding for methods.
                 RootedValue priv(cx, ObjectValue(*options.proto));