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/. */
7 #ifndef __CrossOriginWrapper_h__
8 #define __CrossOriginWrapper_h__
10 #include "mozilla/Attributes.h"
12 #include "jswrapper.h"
16 class WaiveXrayWrapper
: public js::CrossCompartmentWrapper
{
18 explicit MOZ_CONSTEXPR
WaiveXrayWrapper(unsigned flags
) : js::CrossCompartmentWrapper(flags
) { }
20 virtual bool getPropertyDescriptor(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
,
22 JS::MutableHandle
<JSPropertyDescriptor
> desc
) const MOZ_OVERRIDE
;
23 virtual bool getOwnPropertyDescriptor(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
,
25 JS::MutableHandle
<JSPropertyDescriptor
> desc
) const MOZ_OVERRIDE
;
26 virtual bool get(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
, JS::Handle
<JSObject
*> receiver
,
27 JS::Handle
<jsid
> id
, JS::MutableHandle
<JS::Value
> vp
) const MOZ_OVERRIDE
;
28 virtual bool iterate(JSContext
* cx
, JS::Handle
<JSObject
*> proxy
, unsigned flags
,
29 JS::MutableHandle
<JS::Value
> vp
) const MOZ_OVERRIDE
;
32 virtual bool call(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
,
33 const JS::CallArgs
& args
) const MOZ_OVERRIDE
;
34 virtual bool construct(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
,
35 const JS::CallArgs
& args
) const MOZ_OVERRIDE
;
37 virtual bool nativeCall(JSContext
* cx
, JS::IsAcceptableThis test
,
38 JS::NativeImpl impl
, JS::CallArgs args
) const MOZ_OVERRIDE
;
40 virtual bool getPrototypeOf(JSContext
* cx
, JS::Handle
<JSObject
*> wrapper
,
41 JS::MutableHandle
<JSObject
*> protop
) const MOZ_OVERRIDE
;
43 static const WaiveXrayWrapper singleton
;