Source code

Revision control

Other Tools

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 dbg_Source_h
8
#define dbg_Source_h
9
10
#include "jsapi.h"
11
12
#include "NamespaceImports.h" // for Value, HandleObject, CallArgs
13
#include "debugger/Debugger.h" // for DebuggerSourceReferent
14
#include "gc/Rooting.h" // for HandleNativeObject
15
#include "vm/NativeObject.h" // for NativeObject
16
17
namespace js {
18
class GlobalObject;
19
}
20
21
namespace js {
22
23
class DebuggerSource : public NativeObject {
24
public:
25
static const JSClass class_;
26
27
enum {
28
OWNER_SLOT,
29
TEXT_SLOT,
30
RESERVED_SLOTS,
31
};
32
33
static NativeObject* initClass(JSContext* cx, Handle<GlobalObject*> global,
34
HandleObject debugCtor);
35
static DebuggerSource* create(JSContext* cx, HandleObject proto,
36
Handle<DebuggerSourceReferent> referent,
37
HandleNativeObject debugger);
38
39
void trace(JSTracer* trc);
40
41
using ReferentVariant = DebuggerSourceReferent;
42
43
NativeObject* getReferentRawObject() const;
44
DebuggerSourceReferent getReferent() const;
45
46
static DebuggerSource* check(JSContext* cx, HandleValue v);
47
static bool construct(JSContext* cx, unsigned argc, Value* vp);
48
49
struct CallData;
50
51
private:
52
static const JSClassOps classOps_;
53
54
static const JSPropertySpec properties_[];
55
static const JSFunctionSpec methods_[];
56
};
57
58
} /* namespace js */
59
60
#endif /* dbg_Source_h */