michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* vim: set ts=8 sts=4 et sw=4 tw=99: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __FilteringWrapper_h__ michael@0: #define __FilteringWrapper_h__ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "jswrapper.h" michael@0: #include "js/CallNonGenericMethod.h" michael@0: michael@0: struct JSPropertyDescriptor; michael@0: michael@0: namespace JS { michael@0: class AutoIdVector; michael@0: } michael@0: michael@0: namespace xpc { michael@0: michael@0: template michael@0: class FilteringWrapper : public Base { michael@0: public: michael@0: FilteringWrapper(unsigned flags); michael@0: virtual ~FilteringWrapper(); michael@0: michael@0: virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle wrapper, michael@0: JS::Handle id, michael@0: JS::MutableHandle desc) MOZ_OVERRIDE; michael@0: virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle wrapper, michael@0: JS::Handle id, michael@0: JS::MutableHandle desc) MOZ_OVERRIDE; michael@0: virtual bool getOwnPropertyNames(JSContext *cx, JS::Handle wrapper, michael@0: JS::AutoIdVector &props) MOZ_OVERRIDE; michael@0: virtual bool enumerate(JSContext *cx, JS::Handle wrapper, michael@0: JS::AutoIdVector &props) MOZ_OVERRIDE; michael@0: virtual bool keys(JSContext *cx, JS::Handle wrapper, michael@0: JS::AutoIdVector &props) MOZ_OVERRIDE; michael@0: virtual bool iterate(JSContext *cx, JS::Handle wrapper, unsigned flags, michael@0: JS::MutableHandle vp) MOZ_OVERRIDE; michael@0: virtual bool nativeCall(JSContext *cx, JS::IsAcceptableThis test, JS::NativeImpl impl, michael@0: JS::CallArgs args) MOZ_OVERRIDE; michael@0: michael@0: virtual bool defaultValue(JSContext *cx, JS::Handle obj, JSType hint, JS::MutableHandleValue vp) MOZ_OVERRIDE; michael@0: michael@0: virtual bool enter(JSContext *cx, JS::Handle wrapper, JS::Handle id, michael@0: js::Wrapper::Action act, bool *bp) MOZ_OVERRIDE; michael@0: michael@0: static FilteringWrapper singleton; michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif /* __FilteringWrapper_h__ */