|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* vim: set ts=8 sts=4 et sw=4 tw=99: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef __FilteringWrapper_h__ |
|
8 #define __FilteringWrapper_h__ |
|
9 |
|
10 #include "mozilla/Attributes.h" |
|
11 #include "jswrapper.h" |
|
12 #include "js/CallNonGenericMethod.h" |
|
13 |
|
14 struct JSPropertyDescriptor; |
|
15 |
|
16 namespace JS { |
|
17 class AutoIdVector; |
|
18 } |
|
19 |
|
20 namespace xpc { |
|
21 |
|
22 template <typename Base, typename Policy> |
|
23 class FilteringWrapper : public Base { |
|
24 public: |
|
25 FilteringWrapper(unsigned flags); |
|
26 virtual ~FilteringWrapper(); |
|
27 |
|
28 virtual bool getPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper, |
|
29 JS::Handle<jsid> id, |
|
30 JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; |
|
31 virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::Handle<JSObject*> wrapper, |
|
32 JS::Handle<jsid> id, |
|
33 JS::MutableHandle<JSPropertyDescriptor> desc) MOZ_OVERRIDE; |
|
34 virtual bool getOwnPropertyNames(JSContext *cx, JS::Handle<JSObject*> wrapper, |
|
35 JS::AutoIdVector &props) MOZ_OVERRIDE; |
|
36 virtual bool enumerate(JSContext *cx, JS::Handle<JSObject*> wrapper, |
|
37 JS::AutoIdVector &props) MOZ_OVERRIDE; |
|
38 virtual bool keys(JSContext *cx, JS::Handle<JSObject*> wrapper, |
|
39 JS::AutoIdVector &props) MOZ_OVERRIDE; |
|
40 virtual bool iterate(JSContext *cx, JS::Handle<JSObject*> wrapper, unsigned flags, |
|
41 JS::MutableHandle<JS::Value> vp) MOZ_OVERRIDE; |
|
42 virtual bool nativeCall(JSContext *cx, JS::IsAcceptableThis test, JS::NativeImpl impl, |
|
43 JS::CallArgs args) MOZ_OVERRIDE; |
|
44 |
|
45 virtual bool defaultValue(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint, JS::MutableHandleValue vp) MOZ_OVERRIDE; |
|
46 |
|
47 virtual bool enter(JSContext *cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id, |
|
48 js::Wrapper::Action act, bool *bp) MOZ_OVERRIDE; |
|
49 |
|
50 static FilteringWrapper singleton; |
|
51 }; |
|
52 |
|
53 } |
|
54 |
|
55 #endif /* __FilteringWrapper_h__ */ |