Bug 908530 part 3. Stop including xpcpublic.h in DOMJSProxyHandler.h. r=khuey

This commit is contained in:
Boris Zbarsky 2013-08-23 22:42:40 -04:00
parent 7393f81fff
commit 30987641e2
2 changed files with 16 additions and 16 deletions

View File

@ -9,7 +9,7 @@
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/Likely.h" #include "mozilla/Likely.h"
#include "xpcpublic.h" #include "jsproxy.h"
#include "nsStringGlue.h" #include "nsStringGlue.h"
#define DOM_PROXY_OBJECT_SLOT js::PROXY_PRIVATE_SLOT #define DOM_PROXY_OBJECT_SLOT js::PROXY_PRIVATE_SLOT
@ -26,6 +26,21 @@ enum {
template<typename T> struct Prefable; template<typename T> struct Prefable;
extern int HandlerFamily;
inline void* ProxyFamily() { return &HandlerFamily; }
inline bool IsDOMProxy(JSObject *obj, const js::Class* clasp)
{
MOZ_ASSERT(js::GetObjectClass(obj) == clasp);
return (js::IsObjectProxyClass(clasp) || js::IsFunctionProxyClass(clasp)) &&
js::GetProxyHandler(obj)->family() == ProxyFamily();
}
inline bool IsDOMProxy(JSObject *obj)
{
return IsDOMProxy(obj, js::GetObjectClass(obj));
}
class BaseDOMProxyHandler : public js::BaseProxyHandler class BaseDOMProxyHandler : public js::BaseProxyHandler
{ {
public: public:

View File

@ -447,21 +447,6 @@ SimulateActivityCallback(bool aActive);
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
extern int HandlerFamily;
inline void* ProxyFamily() { return &HandlerFamily; }
inline bool IsDOMProxy(JSObject *obj, const js::Class* clasp)
{
MOZ_ASSERT(js::GetObjectClass(obj) == clasp);
return (js::IsObjectProxyClass(clasp) || js::IsFunctionProxyClass(clasp)) &&
js::GetProxyHandler(obj)->family() == ProxyFamily();
}
inline bool IsDOMProxy(JSObject *obj)
{
return IsDOMProxy(obj, js::GetObjectClass(obj));
}
typedef JSObject* typedef JSObject*
(*DefineInterface)(JSContext *cx, JS::Handle<JSObject*> global, (*DefineInterface)(JSContext *cx, JS::Handle<JSObject*> global,
JS::Handle<jsid> id, bool defineOnGlobal); JS::Handle<jsid> id, bool defineOnGlobal);