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 18e33f4b17
commit e7f14418b2
2 changed files with 16 additions and 16 deletions

View File

@ -9,7 +9,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/Likely.h"
#include "xpcpublic.h"
#include "jsproxy.h"
#include "nsStringGlue.h"
#define DOM_PROXY_OBJECT_SLOT js::PROXY_PRIVATE_SLOT
@ -26,6 +26,21 @@ enum {
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
{
public:

View File

@ -447,21 +447,6 @@ SimulateActivityCallback(bool aActive);
namespace mozilla {
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*
(*DefineInterface)(JSContext *cx, JS::Handle<JSObject*> global,
JS::Handle<jsid> id, bool defineOnGlobal);