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/. */
7 #ifndef __CrossOriginWrapper_h__
8 #define __CrossOriginWrapper_h__
10 #include "mozilla/Attributes.h"
11 #include "mozilla/Maybe.h"
13 #include "js/Wrapper.h"
17 class WaiveXrayWrapper
: public js::CrossCompartmentWrapper
{
19 explicit constexpr WaiveXrayWrapper(unsigned flags
)
20 : js::CrossCompartmentWrapper(flags
) {}
22 virtual bool getOwnPropertyDescriptor(
23 JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
, JS::Handle
<jsid
> id
,
24 JS::MutableHandle
<mozilla::Maybe
<JS::PropertyDescriptor
>> desc
)
26 virtual bool getPrototype(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
,
27 JS::MutableHandle
<JSObject
*> protop
) const override
;
28 virtual bool getPrototypeIfOrdinary(
29 JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
, bool* isOrdinary
,
30 JS::MutableHandle
<JSObject
*> protop
) const override
;
31 virtual bool get(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
,
32 JS::Handle
<JS::Value
> receiver
, JS::Handle
<jsid
> id
,
33 JS::MutableHandle
<JS::Value
> vp
) const override
;
34 virtual bool call(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
,
35 const JS::CallArgs
& args
) const override
;
36 virtual bool construct(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
,
37 const JS::CallArgs
& args
) const override
;
39 virtual bool nativeCall(JSContext
* cx
, JS::IsAcceptableThis test
,
41 const JS::CallArgs
& args
) const override
;
43 static const WaiveXrayWrapper singleton
;