WaiveXrayWrapper.h (1896B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 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 __CrossOriginWrapper_h__ 8 #define __CrossOriginWrapper_h__ 9 10 #include "mozilla/Maybe.h" 11 12 #include "js/Wrapper.h" 13 14 namespace xpc { 15 16 class WaiveXrayWrapper : public js::CrossCompartmentWrapper { 17 public: 18 explicit constexpr WaiveXrayWrapper(unsigned flags) 19 : js::CrossCompartmentWrapper(flags) {} 20 21 virtual bool getOwnPropertyDescriptor( 22 JSContext* cx, JS::Handle<JSObject*> wrapper, JS::Handle<jsid> id, 23 JS::MutableHandle<mozilla::Maybe<JS::PropertyDescriptor>> desc) 24 const override; 25 virtual bool getPrototype(JSContext* cx, JS::Handle<JSObject*> wrapper, 26 JS::MutableHandle<JSObject*> protop) const override; 27 virtual bool getPrototypeIfOrdinary( 28 JSContext* cx, JS::Handle<JSObject*> wrapper, bool* isOrdinary, 29 JS::MutableHandle<JSObject*> protop) const override; 30 virtual bool get(JSContext* cx, JS::Handle<JSObject*> wrapper, 31 JS::Handle<JS::Value> receiver, JS::Handle<jsid> id, 32 JS::MutableHandle<JS::Value> vp) const override; 33 virtual bool call(JSContext* cx, JS::Handle<JSObject*> wrapper, 34 const JS::CallArgs& args) const override; 35 virtual bool construct(JSContext* cx, JS::Handle<JSObject*> wrapper, 36 const JS::CallArgs& args) const override; 37 38 virtual bool nativeCall(JSContext* cx, JS::IsAcceptableThis test, 39 JS::NativeImpl impl, 40 const JS::CallArgs& args) const override; 41 42 static const WaiveXrayWrapper singleton; 43 }; 44 45 } // namespace xpc 46 47 #endif