mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Backed out changeset 2c6403818106 (bug 1027402) for bustage on a CLOSED TREE
This commit is contained in:
parent
cbe01cdaa8
commit
e4f5e9f3a3
@ -15,9 +15,9 @@ namespace dom {
|
||||
class WindowNamedPropertiesHandler : public BaseDOMProxyHandler
|
||||
{
|
||||
public:
|
||||
WindowNamedPropertiesHandler()
|
||||
: BaseDOMProxyHandler(nullptr, /* hasPrototype = */ true)
|
||||
WindowNamedPropertiesHandler() : BaseDOMProxyHandler(nullptr)
|
||||
{
|
||||
setHasPrototype(true);
|
||||
}
|
||||
virtual bool
|
||||
preventExtensions(JSContext* aCx, JS::Handle<JSObject*> aProxy) MOZ_OVERRIDE
|
||||
|
@ -38,8 +38,8 @@ inline bool IsDOMProxy(JSObject *obj)
|
||||
class BaseDOMProxyHandler : public js::BaseProxyHandler
|
||||
{
|
||||
public:
|
||||
BaseDOMProxyHandler(const void* aProxyFamily, bool aHasPrototype = false)
|
||||
: js::BaseProxyHandler(aProxyFamily, aHasPrototype)
|
||||
BaseDOMProxyHandler(const void* aProxyFamily)
|
||||
: js::BaseProxyHandler(aProxyFamily)
|
||||
{}
|
||||
|
||||
// Implementations of traps that can be implemented in terms of
|
||||
|
@ -79,10 +79,10 @@ js::assertEnteredPolicy(JSContext *cx, JSObject *proxy, jsid id,
|
||||
}
|
||||
#endif
|
||||
|
||||
BaseProxyHandler::BaseProxyHandler(const void *family, bool hasPrototype, bool hasSecurityPolicy)
|
||||
BaseProxyHandler::BaseProxyHandler(const void *family)
|
||||
: mFamily(family),
|
||||
mHasPrototype(hasPrototype),
|
||||
mHasSecurityPolicy(hasSecurityPolicy)
|
||||
mHasPrototype(false),
|
||||
mHasSecurityPolicy(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -538,9 +538,8 @@ DirectProxyHandler::weakmapKeyDelegate(JSObject *proxy)
|
||||
return UncheckedUnwrap(proxy);
|
||||
}
|
||||
|
||||
DirectProxyHandler::DirectProxyHandler(const void *family, bool hasPrototype,
|
||||
bool hasSecurityPolicy)
|
||||
: BaseProxyHandler(family, hasPrototype, hasSecurityPolicy)
|
||||
DirectProxyHandler::DirectProxyHandler(const void *family)
|
||||
: BaseProxyHandler(family)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -116,9 +116,13 @@ class JS_FRIEND_API(BaseProxyHandler)
|
||||
*/
|
||||
bool mHasSecurityPolicy;
|
||||
|
||||
protected:
|
||||
// Subclasses may set this in their constructor.
|
||||
void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; }
|
||||
void setHasSecurityPolicy(bool aHasPolicy) { mHasSecurityPolicy = aHasPolicy; }
|
||||
|
||||
public:
|
||||
explicit BaseProxyHandler(const void *family, bool hasPrototype = false,
|
||||
bool hasSecurityPolicy = false);
|
||||
explicit BaseProxyHandler(const void *family);
|
||||
virtual ~BaseProxyHandler();
|
||||
|
||||
bool hasPrototype() {
|
||||
@ -237,8 +241,7 @@ class JS_FRIEND_API(BaseProxyHandler)
|
||||
class JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler
|
||||
{
|
||||
public:
|
||||
explicit DirectProxyHandler(const void *family, bool hasPrototype = false,
|
||||
bool hasSecurityPolicy = false);
|
||||
explicit DirectProxyHandler(const void *family);
|
||||
|
||||
/* ES5 Harmony fundamental proxy traps. */
|
||||
virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;
|
||||
|
@ -127,10 +127,10 @@ js::IsCrossCompartmentWrapper(JSObject *obj)
|
||||
!!(Wrapper::wrapperHandler(obj)->flags() & Wrapper::CROSS_COMPARTMENT);
|
||||
}
|
||||
|
||||
Wrapper::Wrapper(unsigned flags, bool hasPrototype, bool hasSecurityPolicy)
|
||||
: DirectProxyHandler(&sWrapperFamily, hasPrototype, hasSecurityPolicy),
|
||||
mFlags(flags)
|
||||
Wrapper::Wrapper(unsigned flags, bool hasPrototype) : DirectProxyHandler(&sWrapperFamily)
|
||||
, mFlags(flags)
|
||||
{
|
||||
setHasPrototype(hasPrototype);
|
||||
}
|
||||
|
||||
Wrapper::~Wrapper()
|
||||
@ -170,9 +170,8 @@ ErrorCopier::~ErrorCopier()
|
||||
|
||||
/* Cross compartment wrappers. */
|
||||
|
||||
CrossCompartmentWrapper::CrossCompartmentWrapper(unsigned flags, bool hasPrototype,
|
||||
bool hasSecurityPolicy)
|
||||
: Wrapper(CROSS_COMPARTMENT | flags, hasPrototype, hasSecurityPolicy)
|
||||
CrossCompartmentWrapper::CrossCompartmentWrapper(unsigned flags, bool hasPrototype)
|
||||
: Wrapper(CROSS_COMPARTMENT | flags, hasPrototype)
|
||||
{
|
||||
}
|
||||
|
||||
@ -608,9 +607,10 @@ CrossCompartmentWrapper CrossCompartmentWrapper::singleton(0u);
|
||||
/* Security wrappers. */
|
||||
|
||||
template <class Base>
|
||||
SecurityWrapper<Base>::SecurityWrapper(unsigned flags, bool hasPrototype)
|
||||
: Base(flags, hasPrototype, /* hasSecurityPolicy = */ true)
|
||||
SecurityWrapper<Base>::SecurityWrapper(unsigned flags)
|
||||
: Base(flags)
|
||||
{
|
||||
BaseProxyHandler::setHasSecurityPolicy(true);
|
||||
}
|
||||
|
||||
template <class Base>
|
||||
|
@ -81,7 +81,7 @@ class JS_FRIEND_API(Wrapper) : public DirectProxyHandler
|
||||
return mFlags;
|
||||
}
|
||||
|
||||
explicit Wrapper(unsigned flags, bool hasPrototype = false, bool hasSecurityPolicy = false);
|
||||
explicit Wrapper(unsigned flags, bool hasPrototype = false);
|
||||
|
||||
virtual ~Wrapper();
|
||||
|
||||
@ -103,8 +103,7 @@ WrapperOptions::proto() const
|
||||
class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper
|
||||
{
|
||||
public:
|
||||
explicit CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false,
|
||||
bool hasSecurityPolicy = false);
|
||||
explicit CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false);
|
||||
|
||||
virtual ~CrossCompartmentWrapper();
|
||||
|
||||
@ -168,7 +167,7 @@ template <class Base>
|
||||
class JS_FRIEND_API(SecurityWrapper) : public Base
|
||||
{
|
||||
public:
|
||||
explicit SecurityWrapper(unsigned flags, bool hasPrototype = false);
|
||||
explicit SecurityWrapper(unsigned flags);
|
||||
|
||||
virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;
|
||||
virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;
|
||||
|
@ -1986,8 +1986,9 @@ DOMXrayTraits::createHolder(JSContext *cx, JSObject *wrapper)
|
||||
|
||||
template <typename Base, typename Traits>
|
||||
XrayWrapper<Base, Traits>::XrayWrapper(unsigned flags)
|
||||
: Base(flags | WrapperFactory::IS_XRAY_WRAPPER_FLAG, /* hasPrototype = */ Traits::HasPrototype)
|
||||
: Base(flags | WrapperFactory::IS_XRAY_WRAPPER_FLAG)
|
||||
{
|
||||
Base::setHasPrototype(Traits::HasPrototype);
|
||||
}
|
||||
|
||||
template <typename Base, typename Traits>
|
||||
|
Loading…
Reference in New Issue
Block a user