js/xpconnect/wrappers/FilteringWrapper.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/xpconnect/wrappers/FilteringWrapper.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* vim: set ts=8 sts=4 et sw=4 tw=99: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef __FilteringWrapper_h__
    1.11 +#define __FilteringWrapper_h__
    1.12 +
    1.13 +#include "mozilla/Attributes.h"
    1.14 +#include "jswrapper.h"
    1.15 +#include "js/CallNonGenericMethod.h"
    1.16 +
    1.17 +struct JSPropertyDescriptor;
    1.18 +
    1.19 +namespace JS {
    1.20 +class AutoIdVector;
    1.21 +}
    1.22 +
    1.23 +namespace xpc {
    1.24 +
    1.25 +template <typename Base, typename Policy>
    1.26 +class FilteringWrapper : public Base {
    1.27 +  public:
    1.28 +    FilteringWrapper(unsigned flags);
    1.29 +    virtual ~FilteringWrapper();
    1.30 +
    1.31 +    virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper,
    1.32 +                                       JS::Handle<jsid> id,
    1.33 +                                       JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE;
    1.34 +    virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper,
    1.35 +                                          JS::Handle<jsid> id,
    1.36 +                                          JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE;
    1.37 +    virtual bool getOwnPropertyNames(JSContext *cx, JS::Handle<JSObject*> wrapper,
    1.38 +                                     JS::AutoIdVector &props) MOZ_OVERRIDE;
    1.39 +    virtual bool enumerate(JSContext *cx, JS::Handle<JSObject*> wrapper,
    1.40 +                           JS::AutoIdVector &props) MOZ_OVERRIDE;
    1.41 +    virtual bool keys(JSContext *cx, JS::Handle<JSObject*> wrapper,
    1.42 +                      JS::AutoIdVector &props) MOZ_OVERRIDE;
    1.43 +    virtual bool iterate(JSContext *cx, JS::Handle<JSObject*> wrapper, unsigned flags,
    1.44 +                         JS::MutableHandle<JS::Value> vp) MOZ_OVERRIDE;
    1.45 +    virtual bool nativeCall(JSContext *cx, JS::IsAcceptableThis test, JS::NativeImpl impl,
    1.46 +                            JS::CallArgs args) MOZ_OVERRIDE;
    1.47 +
    1.48 +    virtual bool defaultValue(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint, JS::MutableHandleValue vp) MOZ_OVERRIDE;
    1.49 +
    1.50 +    virtual bool enter(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id,
    1.51 +                       js::Wrapper::Action act, bool *bp) MOZ_OVERRIDE;
    1.52 +
    1.53 +    static FilteringWrapper singleton;
    1.54 +};
    1.55 +
    1.56 +}
    1.57 +
    1.58 +#endif /* __FilteringWrapper_h__ */

mercurial