From 568cab6121bd5a3fb676ca2c7c7cd63af54d909e Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Sat, 18 Mar 2017 23:48:19 +0700 Subject: [PATCH] Updating to latest protocol.json --- cdp/debugger/easyjson.go | 44 ++++++++++++++++++++++++++++++++++ cdp/debugger/events.go | 2 ++ cmd/chromedp-gen/protocol.json | 14 +++++++++++ 3 files changed, 60 insertions(+) diff --git a/cdp/debugger/easyjson.go b/cdp/debugger/easyjson.go index 3405aa6..baae41a 100644 --- a/cdp/debugger/easyjson.go +++ b/cdp/debugger/easyjson.go @@ -2899,6 +2899,16 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpDebugger32(in *jlexer.Lexer, o out.IsModule = bool(in.Bool()) case "length": out.Length = int64(in.Int64()) + case "stackTrace": + if in.IsNull() { + in.Skip() + out.StackTrace = nil + } else { + if out.StackTrace == nil { + out.StackTrace = new(runtime.StackTrace) + } + (*out.StackTrace).UnmarshalEasyJSON(in) + } default: in.SkipRecursive() } @@ -3025,6 +3035,18 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpDebugger32(out *jwriter.Writer out.RawString("\"length\":") out.Int64(int64(in.Length)) } + if in.StackTrace != nil { + if !first { + out.RawByte(',') + } + first = false + out.RawString("\"stackTrace\":") + if in.StackTrace == nil { + out.RawString("null") + } else { + (*in.StackTrace).MarshalEasyJSON(out) + } + } out.RawByte('}') } @@ -3096,6 +3118,16 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpDebugger33(in *jlexer.Lexer, o out.IsModule = bool(in.Bool()) case "length": out.Length = int64(in.Int64()) + case "stackTrace": + if in.IsNull() { + in.Skip() + out.StackTrace = nil + } else { + if out.StackTrace == nil { + out.StackTrace = new(runtime.StackTrace) + } + (*out.StackTrace).UnmarshalEasyJSON(in) + } default: in.SkipRecursive() } @@ -3214,6 +3246,18 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpDebugger33(out *jwriter.Writer out.RawString("\"length\":") out.Int64(int64(in.Length)) } + if in.StackTrace != nil { + if !first { + out.RawByte(',') + } + first = false + out.RawString("\"stackTrace\":") + if in.StackTrace == nil { + out.RawString("null") + } else { + (*in.StackTrace).MarshalEasyJSON(out) + } + } out.RawByte('}') } diff --git a/cdp/debugger/events.go b/cdp/debugger/events.go index 08c6883..169637b 100644 --- a/cdp/debugger/events.go +++ b/cdp/debugger/events.go @@ -25,6 +25,7 @@ type EventScriptParsed struct { HasSourceURL bool `json:"hasSourceURL,omitempty"` // True, if this script has sourceURL. IsModule bool `json:"isModule,omitempty"` // True, if this script is ES6 module. Length int64 `json:"length,omitempty"` // This script length. + StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript top stack frame of where the script parsed event was triggered if available. } // EventScriptFailedToParse fired when virtual machine fails to parse the @@ -43,6 +44,7 @@ type EventScriptFailedToParse struct { HasSourceURL bool `json:"hasSourceURL,omitempty"` // True, if this script has sourceURL. IsModule bool `json:"isModule,omitempty"` // True, if this script is ES6 module. Length int64 `json:"length,omitempty"` // This script length. + StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript top stack frame of where the script parsed event was triggered if available. } // EventBreakpointResolved fired when breakpoint is resolved to an actual diff --git a/cmd/chromedp-gen/protocol.json b/cmd/chromedp-gen/protocol.json index b79479e..57edb63 100644 --- a/cmd/chromedp-gen/protocol.json +++ b/cmd/chromedp-gen/protocol.json @@ -12014,6 +12014,13 @@ "optional": true, "description": "This script length.", "experimental": true + }, + { + "name": "stackTrace", + "$ref": "Runtime.StackTrace", + "optional": true, + "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", + "experimental": true } ], "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger." @@ -12093,6 +12100,13 @@ "optional": true, "description": "This script length.", "experimental": true + }, + { + "name": "stackTrace", + "$ref": "Runtime.StackTrace", + "optional": true, + "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", + "experimental": true } ], "description": "Fired when virtual machine fails to parse the script."