mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 677079 - Part y: Move AutoIdVector to jsapi.h; r=evilpie
This commit is contained in:
parent
1633522a7d
commit
9fd69872fe
@ -56,6 +56,7 @@
|
||||
#include "js/Utility.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "jsalloc.h"
|
||||
#include "js/Vector.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#endif
|
||||
@ -1119,6 +1120,19 @@ class AutoValueVector : public AutoVectorRooter<Value>
|
||||
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
class AutoIdVector : public AutoVectorRooter<jsid>
|
||||
{
|
||||
public:
|
||||
explicit AutoIdVector(JSContext *cx
|
||||
JS_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: AutoVectorRooter<jsid>(cx, IDVECTOR)
|
||||
{
|
||||
JS_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
}
|
||||
|
||||
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
} /* namespace JS */
|
||||
|
||||
/************************************************************************/
|
||||
|
@ -52,7 +52,6 @@
|
||||
|
||||
namespace js {
|
||||
|
||||
class AutoIdVector;
|
||||
class PropertyName;
|
||||
class SpecialId;
|
||||
|
||||
|
@ -2086,19 +2086,6 @@ class AutoObjectVector : public AutoVectorRooter<JSObject *>
|
||||
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
class AutoIdVector : public AutoVectorRooter<jsid>
|
||||
{
|
||||
public:
|
||||
explicit AutoIdVector(JSContext *cx
|
||||
JS_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: AutoVectorRooter<jsid>(cx, IDVECTOR)
|
||||
{
|
||||
JS_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
}
|
||||
|
||||
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
class AutoShapeVector : public AutoVectorRooter<const Shape *>
|
||||
{
|
||||
public:
|
||||
|
@ -1310,8 +1310,6 @@ struct WrapperHasher
|
||||
|
||||
typedef HashMap<Value, Value, WrapperHasher, SystemAllocPolicy> WrapperMap;
|
||||
|
||||
class AutoIdVector;
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -50,11 +50,9 @@
|
||||
#include "nsWrapperCacheInlines.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
|
||||
#include "jscntxt.h" // js::AutoIdVector
|
||||
#include "jsatom.h"
|
||||
|
||||
using namespace JS;
|
||||
using js::AutoIdVector;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@ -742,7 +740,7 @@ ListBase<LC>::getOwnPropertyNames(JSContext *cx, JSObject *proxy, AutoIdVector &
|
||||
|
||||
JSObject *expando;
|
||||
if (!xpc::WrapperFactory::IsXrayWrapper(proxy) && (expando = getExpandoObject(proxy)) &&
|
||||
!GetPropertyNames(cx, expando, JSITER_OWNONLY | JSITER_HIDDEN, &props))
|
||||
!js::GetPropertyNames(cx, expando, JSITER_OWNONLY | JSITER_HIDDEN, &props))
|
||||
return false;
|
||||
|
||||
// FIXME: Add named items
|
||||
|
@ -218,9 +218,9 @@ public:
|
||||
JSPropertyDescriptor *desc);
|
||||
bool defineProperty(JSContext *cx, JSObject *proxy, jsid id,
|
||||
JSPropertyDescriptor *desc);
|
||||
bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, js::AutoIdVector &props);
|
||||
bool getOwnPropertyNames(JSContext *cx, JSObject *proxy, JS::AutoIdVector &props);
|
||||
bool delete_(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
|
||||
bool enumerate(JSContext *cx, JSObject *proxy, js::AutoIdVector &props);
|
||||
bool enumerate(JSContext *cx, JSObject *proxy, JS::AutoIdVector &props);
|
||||
bool fix(JSContext *cx, JSObject *proxy, JS::Value *vp);
|
||||
|
||||
bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
|
||||
@ -230,7 +230,7 @@ public:
|
||||
uint32_t index, JS::Value *vp, bool *present);
|
||||
bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
|
||||
JS::Value *vp);
|
||||
bool keys(JSContext *cx, JSObject *proxy, js::AutoIdVector &props);
|
||||
bool keys(JSContext *cx, JSObject *proxy, JS::AutoIdVector &props);
|
||||
bool iterate(JSContext *cx, JSObject *proxy, uintN flags, JS::Value *vp);
|
||||
|
||||
/* Spidermonkey extensions. */
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include "XPCWrapper.h"
|
||||
|
||||
#include "jscntxt.h" // js::AutoIdVector
|
||||
#include "jsapi.h"
|
||||
|
||||
using namespace js;
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include "XPCWrapper.h"
|
||||
#include "xpcprivate.h"
|
||||
|
||||
#include "jscntxt.h" // js::AutoIdVector
|
||||
#include "jsapi.h"
|
||||
|
||||
namespace xpc {
|
||||
|
||||
@ -834,7 +834,7 @@ XrayWrapper<Base>::defineProperty(JSContext *cx, JSObject *wrapper, jsid id,
|
||||
}
|
||||
|
||||
static bool
|
||||
EnumerateNames(JSContext *cx, JSObject *wrapper, uintN flags, js::AutoIdVector &props)
|
||||
EnumerateNames(JSContext *cx, JSObject *wrapper, uintN flags, JS::AutoIdVector &props)
|
||||
{
|
||||
JSObject *holder = GetHolder(wrapper);
|
||||
|
||||
@ -860,7 +860,7 @@ EnumerateNames(JSContext *cx, JSObject *wrapper, uintN flags, js::AutoIdVector &
|
||||
return false;
|
||||
|
||||
// Force all native properties to be materialized onto the wrapped native.
|
||||
js::AutoIdVector wnProps(cx);
|
||||
JS::AutoIdVector wnProps(cx);
|
||||
{
|
||||
JSAutoEnterCompartment ac;
|
||||
if (!ac.enter(cx, wnObject))
|
||||
@ -884,7 +884,7 @@ EnumerateNames(JSContext *cx, JSObject *wrapper, uintN flags, js::AutoIdVector &
|
||||
template <typename Base>
|
||||
bool
|
||||
XrayWrapper<Base>::getOwnPropertyNames(JSContext *cx, JSObject *wrapper,
|
||||
js::AutoIdVector &props)
|
||||
JS::AutoIdVector &props)
|
||||
{
|
||||
return EnumerateNames(cx, wrapper, JSITER_OWNONLY | JSITER_HIDDEN, props);
|
||||
}
|
||||
@ -925,7 +925,7 @@ XrayWrapper<Base>::delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
|
||||
|
||||
template <typename Base>
|
||||
bool
|
||||
XrayWrapper<Base>::enumerate(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props)
|
||||
XrayWrapper<Base>::enumerate(JSContext *cx, JSObject *wrapper, JS::AutoIdVector &props)
|
||||
{
|
||||
return EnumerateNames(cx, wrapper, 0, props);
|
||||
}
|
||||
@ -978,7 +978,7 @@ XrayWrapper<Base>::hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
|
||||
|
||||
template <typename Base>
|
||||
bool
|
||||
XrayWrapper<Base>::keys(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props)
|
||||
XrayWrapper<Base>::keys(JSContext *cx, JSObject *wrapper, JS::AutoIdVector &props)
|
||||
{
|
||||
// Skip our Base if it isn't already ProxyHandler.
|
||||
return ProxyHandler::keys(cx, wrapper, props);
|
||||
@ -1258,7 +1258,7 @@ XrayProxy::defineProperty(JSContext *cx, JSObject *wrapper, jsid id,
|
||||
}
|
||||
|
||||
static bool
|
||||
EnumerateProxyNames(JSContext *cx, JSObject *wrapper, uintN flags, js::AutoIdVector &props)
|
||||
EnumerateProxyNames(JSContext *cx, JSObject *wrapper, uintN flags, JS::AutoIdVector &props)
|
||||
{
|
||||
JSObject *obj = &js::GetProxyPrivate(wrapper).toObject();
|
||||
|
||||
@ -1283,7 +1283,7 @@ EnumerateProxyNames(JSContext *cx, JSObject *wrapper, uintN flags, js::AutoIdVec
|
||||
}
|
||||
|
||||
bool
|
||||
XrayProxy::getOwnPropertyNames(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props)
|
||||
XrayProxy::getOwnPropertyNames(JSContext *cx, JSObject *wrapper, JS::AutoIdVector &props)
|
||||
{
|
||||
return EnumerateProxyNames(cx, wrapper, JSITER_OWNONLY | JSITER_HIDDEN, props);
|
||||
}
|
||||
@ -1318,7 +1318,7 @@ XrayProxy::delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
|
||||
}
|
||||
|
||||
bool
|
||||
XrayProxy::enumerate(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props)
|
||||
XrayProxy::enumerate(JSContext *cx, JSObject *wrapper, JS::AutoIdVector &props)
|
||||
{
|
||||
return EnumerateProxyNames(cx, wrapper, 0, props);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user