-
Notifications
You must be signed in to change notification settings - Fork 48
/
event.go
138 lines (125 loc) · 7.59 KB
/
event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Code generated by cdpgen. DO NOT EDIT.
package debugger
import (
"encoding/json"
"github.com/mafredri/cdp/protocol/runtime"
"github.com/mafredri/cdp/rpcc"
)
// BreakpointResolvedClient is a client for BreakpointResolved events. Fired
// when breakpoint is resolved to an actual script and location.
type BreakpointResolvedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*BreakpointResolvedReply, error)
rpcc.Stream
}
// BreakpointResolvedReply is the reply for BreakpointResolved events.
type BreakpointResolvedReply struct {
BreakpointID BreakpointID `json:"breakpointId"` // Breakpoint unique identifier.
Location Location `json:"location"` // Actual breakpoint location.
}
// PausedClient is a client for Paused events. Fired when the virtual machine
// stopped on breakpoint or exception or any other stop criteria.
type PausedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*PausedReply, error)
rpcc.Stream
}
// PausedReply is the reply for Paused events.
type PausedReply struct {
CallFrames []CallFrame `json:"callFrames"` // Call stack the virtual machine stopped on.
// Reason Pause reason.
//
// Values: "ambiguous", "assert", "debugCommand", "DOM", "EventListener", "exception", "instrumentation", "OOM", "other", "promiseRejection", "XHR".
Reason string `json:"reason"`
Data json.RawMessage `json:"data,omitempty"` // Object containing break-specific auxiliary properties.
HitBreakpoints []string `json:"hitBreakpoints,omitempty"` // Hit breakpoints IDs
AsyncStackTrace *runtime.StackTrace `json:"asyncStackTrace,omitempty"` // Async stack trace, if any.
// AsyncStackTraceID Async stack trace, if any.
//
// Note: This property is experimental.
AsyncStackTraceID *runtime.StackTraceID `json:"asyncStackTraceId,omitempty"`
// AsyncCallStackTraceID Just scheduled async call will have this
// stack trace as parent stack during async execution. This field is
// available only after `Debugger.stepInto` call with `breakOnAsynCall`
// flag.
//
// Note: This property is experimental.
AsyncCallStackTraceID *runtime.StackTraceID `json:"asyncCallStackTraceId,omitempty"`
}
// ResumedClient is a client for Resumed events. Fired when the virtual
// machine resumed execution.
type ResumedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ResumedReply, error)
rpcc.Stream
}
// ResumedReply is the reply for Resumed events.
type ResumedReply struct {
}
// ScriptFailedToParseClient is a client for ScriptFailedToParse events. Fired
// when virtual machine fails to parse the script.
type ScriptFailedToParseClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ScriptFailedToParseReply, error)
rpcc.Stream
}
// ScriptFailedToParseReply is the reply for ScriptFailedToParse events.
type ScriptFailedToParseReply struct {
ScriptID runtime.ScriptID `json:"scriptId"` // Identifier of the script parsed.
URL string `json:"url"` // URL or name of the script parsed (if any).
StartLine int `json:"startLine"` // Line offset of the script within the resource with given URL (for script tags).
StartColumn int `json:"startColumn"` // Column offset of the script within the resource with given URL.
EndLine int `json:"endLine"` // Last line of the script.
EndColumn int `json:"endColumn"` // Length of the last line of the script.
ExecutionContextID runtime.ExecutionContextID `json:"executionContextId"` // Specifies script creation context.
Hash string `json:"hash"` // Content hash of the script.
ExecutionContextAuxData json.RawMessage `json:"executionContextAuxData,omitempty"` // Embedder-specific auxiliary data.
SourceMapURL *string `json:"sourceMapURL,omitempty"` // URL of source map associated with script (if any).
HasSourceURL *bool `json:"hasSourceURL,omitempty"` // True, if this script has sourceURL.
IsModule *bool `json:"isModule,omitempty"` // True, if this script is ES6 module.
Length *int `json:"length,omitempty"` // This script length.
// StackTrace JavaScript top stack frame of where the script parsed
// event was triggered if available.
//
// Note: This property is experimental.
StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"`
}
// ScriptParsedClient is a client for ScriptParsed events. Fired when virtual
// machine parses script. This event is also fired for all known and
// uncollected scripts upon enabling debugger.
type ScriptParsedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ScriptParsedReply, error)
rpcc.Stream
}
// ScriptParsedReply is the reply for ScriptParsed events.
type ScriptParsedReply struct {
ScriptID runtime.ScriptID `json:"scriptId"` // Identifier of the script parsed.
URL string `json:"url"` // URL or name of the script parsed (if any).
StartLine int `json:"startLine"` // Line offset of the script within the resource with given URL (for script tags).
StartColumn int `json:"startColumn"` // Column offset of the script within the resource with given URL.
EndLine int `json:"endLine"` // Last line of the script.
EndColumn int `json:"endColumn"` // Length of the last line of the script.
ExecutionContextID runtime.ExecutionContextID `json:"executionContextId"` // Specifies script creation context.
Hash string `json:"hash"` // Content hash of the script.
ExecutionContextAuxData json.RawMessage `json:"executionContextAuxData,omitempty"` // Embedder-specific auxiliary data.
// IsLiveEdit True, if this script is generated as a result of the
// live edit operation.
//
// Note: This property is experimental.
IsLiveEdit *bool `json:"isLiveEdit,omitempty"`
SourceMapURL *string `json:"sourceMapURL,omitempty"` // URL of source map associated with script (if any).
HasSourceURL *bool `json:"hasSourceURL,omitempty"` // True, if this script has sourceURL.
IsModule *bool `json:"isModule,omitempty"` // True, if this script is ES6 module.
Length *int `json:"length,omitempty"` // This script length.
// StackTrace JavaScript top stack frame of where the script parsed
// event was triggered if available.
//
// Note: This property is experimental.
StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"`
}