Bug 821573 - Stop allowing COWs as native interfaces. r=gabor

This commit is contained in:
Bobby Holley 2014-08-20 12:06:52 -07:00
Родитель 6b92865154
Коммит 6925798616
2 изменённых файлов: 0 добавлений и 23 удалений

Просмотреть файл

@ -908,17 +908,6 @@ XPCConvert::JSObject2NativeInterface(void** dest, HandleObject src,
// around a security wrapper. XBL does this with Xrays from the XBL
// scope - see nsBindingManager::GetBindingImplementation.
JSObject* inner = js::CheckedUnwrap(src, /* stopAtOuter = */ false);
// Hack - For historical reasons, wrapped chrome JS objects have been
// passable as native interfaces. We'd like to fix this, but it
// involves fixing the contacts API and PeerConnection to stop using
// COWs. This needs to happen, but for now just preserve the old
// behavior.
//
// Note that there is an identical hack in getWrapper which should be
// removed if this one is.
if (!inner && MOZ_UNLIKELY(xpc::WrapperFactory::IsCOW(src)))
inner = js::UncheckedUnwrap(src);
if (!inner) {
if (pErr)
*pErr = NS_ERROR_XPC_SECURITY_MANAGER_VETO;

Просмотреть файл

@ -521,18 +521,6 @@ getWrapper(JSContext *cx,
if (js::IsWrapper(obj)) {
JSObject* inner = js::CheckedUnwrap(obj, /* stopAtOuter = */ false);
// Hack - For historical reasons, wrapped chrome JS objects have been
// passable as native interfaces. We'd like to fix this, but it
// involves fixing the contacts API and PeerConnection to stop using
// COWs. This needs to happen, but for now just preserve the old
// behavior.
//
// Note that there is an identical hack in
// XPCConvert::JSObject2NativeInterface which should be removed if this
// one is.
if (!inner && MOZ_UNLIKELY(xpc::WrapperFactory::IsCOW(obj)))
inner = js::UncheckedUnwrap(obj);
// The safe unwrap might have failed if we encountered an object that
// we're not allowed to unwrap. If it didn't fail though, we should be
// done with wrappers.