Temporarily removing all timestamp types

This commit is contained in:
Kenneth Shaw 2017-07-01 15:55:35 +07:00
parent 547875a8f2
commit f27ba717b1
18 changed files with 403 additions and 700 deletions

View File

@ -7,9 +7,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"time"
"github.com/knq/sysutil"
"github.com/mailru/easyjson" "github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer" "github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter" "github.com/mailru/easyjson/jwriter"
@ -1503,31 +1501,11 @@ func (t LoaderID) String() string {
} }
// Timestamp number of seconds since epoch. // Timestamp number of seconds since epoch.
type Timestamp time.Time type Timestamp float64
// Time returns the Timestamp as time.Time value. // Float64 returns the Timestamp as float64 value.
func (t Timestamp) Time() time.Time { func (t Timestamp) Float64() float64 {
return time.Time(t) return float64(t)
}
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t Timestamp) MarshalEasyJSON(out *jwriter.Writer) {
out.Float64(float64(time.Time(t).Sub(sysutil.BootTime())) / float64(time.Second))
}
// MarshalJSON satisfies json.Marshaler.
func (t Timestamp) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *Timestamp) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = Timestamp(sysutil.BootTime().Add(time.Duration(in.Float64() * float64(time.Second))))
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *Timestamp) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
} }
// NodeID unique DOM node identifier. // NodeID unique DOM node identifier.

View File

@ -4,7 +4,6 @@ package heapprofiler
import ( import (
json "encoding/json" json "encoding/json"
cdp "github.com/knq/chromedp/cdp"
runtime "github.com/knq/chromedp/cdp/runtime" runtime "github.com/knq/chromedp/cdp/runtime"
easyjson "github.com/mailru/easyjson" easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer" jlexer "github.com/mailru/easyjson/jlexer"
@ -1125,15 +1124,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpHeapprofiler14(in *jlexer.Lexe
case "lastSeenObjectId": case "lastSeenObjectId":
out.LastSeenObjectID = int64(in.Int64()) out.LastSeenObjectID = int64(in.Int64())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = float64(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -1156,17 +1147,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpHeapprofiler14(out *jwriter.Wr
out.RawString("\"lastSeenObjectId\":") out.RawString("\"lastSeenObjectId\":")
out.Int64(int64(in.LastSeenObjectID)) out.Int64(int64(in.LastSeenObjectID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
out.RawByte('}') out.RawByte('}')
} }

View File

@ -28,7 +28,7 @@ type EventReportHeapSnapshotProgress struct {
// lastSeenObjectId event. // lastSeenObjectId event.
type EventLastSeenObjectID struct { type EventLastSeenObjectID struct {
LastSeenObjectID int64 `json:"lastSeenObjectId,omitempty"` LastSeenObjectID int64 `json:"lastSeenObjectId,omitempty"`
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` Timestamp float64 `json:"timestamp,omitempty"`
} }
// EventHeapStatsUpdate if heap objects tracking has been started then // EventHeapStatsUpdate if heap objects tracking has been started then

View File

@ -4,7 +4,6 @@ package log
import ( import (
json "encoding/json" json "encoding/json"
cdp "github.com/knq/chromedp/cdp"
network "github.com/knq/chromedp/cdp/network" network "github.com/knq/chromedp/cdp/network"
runtime "github.com/knq/chromedp/cdp/runtime" runtime "github.com/knq/chromedp/cdp/runtime"
easyjson "github.com/mailru/easyjson" easyjson "github.com/mailru/easyjson"
@ -376,15 +375,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpLog4(in *jlexer.Lexer, out *En
case "text": case "text":
out.Text = string(in.String()) out.Text = string(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = runtime.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "url": case "url":
out.URL = string(in.String()) out.URL = string(in.String())
case "lineNumber": case "lineNumber":
@ -441,17 +432,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpLog4(out *jwriter.Writer, in E
out.RawString("\"text\":") out.RawString("\"text\":")
out.String(string(in.Text)) out.String(string(in.Text))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.URL != "" { if in.URL != "" {
if !first { if !first {

View File

@ -1,11 +1,8 @@
package log package log
// AUTOGENERATED. DO NOT EDIT.
import ( import (
"errors" "errors"
cdp "github.com/knq/chromedp/cdp"
"github.com/knq/chromedp/cdp/network" "github.com/knq/chromedp/cdp/network"
"github.com/knq/chromedp/cdp/runtime" "github.com/knq/chromedp/cdp/runtime"
"github.com/mailru/easyjson" "github.com/mailru/easyjson"
@ -13,12 +10,14 @@ import (
"github.com/mailru/easyjson/jwriter" "github.com/mailru/easyjson/jwriter"
) )
// AUTOGENERATED. DO NOT EDIT.
// Entry log entry. // Entry log entry.
type Entry struct { type Entry struct {
Source Source `json:"source,omitempty"` // Log entry source. Source Source `json:"source,omitempty"` // Log entry source.
Level Level `json:"level,omitempty"` // Log entry severity. Level Level `json:"level,omitempty"` // Log entry severity.
Text string `json:"text,omitempty"` // Logged text. Text string `json:"text,omitempty"` // Logged text.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp when this entry was added. Timestamp runtime.Timestamp `json:"timestamp,omitempty"` // Timestamp when this entry was added.
URL string `json:"url,omitempty"` // URL of the resource if known. URL string `json:"url,omitempty"` // URL of the resource if known.
LineNumber int64 `json:"lineNumber,omitempty"` // Line number in the resource. LineNumber int64 `json:"lineNumber,omitempty"` // Line number in the resource.
StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript stack trace. StackTrace *runtime.StackTrace `json:"stackTrace,omitempty"` // JavaScript stack trace.

View File

@ -460,15 +460,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork3(in *jlexer.Lexer, out
case "logId": case "logId":
out.LogID = string(in.String()) out.LogID = string(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "hashAlgorithm": case "hashAlgorithm":
out.HashAlgorithm = string(in.String()) out.HashAlgorithm = string(in.String())
case "signatureAlgorithm": case "signatureAlgorithm":
@ -521,17 +513,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork3(out *jwriter.Writer,
out.RawString("\"logId\":") out.RawString("\"logId\":")
out.String(string(in.LogID)) out.String(string(in.LogID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.HashAlgorithm != "" { if in.HashAlgorithm != "" {
if !first { if !first {
@ -942,15 +930,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork8(in *jlexer.Lexer, out
case "sameSite": case "sameSite":
(out.SameSite).UnmarshalEasyJSON(in) (out.SameSite).UnmarshalEasyJSON(in)
case "expirationDate": case "expirationDate":
if in.IsNull() { out.ExpirationDate = cdp.Timestamp(in.Float64())
in.Skip()
out.ExpirationDate = nil
} else {
if out.ExpirationDate == nil {
out.ExpirationDate = new(cdp.Timestamp)
}
(*out.ExpirationDate).UnmarshalEasyJSON(in)
}
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -1023,17 +1003,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork8(out *jwriter.Writer,
out.RawString("\"sameSite\":") out.RawString("\"sameSite\":")
(in.SameSite).MarshalEasyJSON(out) (in.SameSite).MarshalEasyJSON(out)
} }
if in.ExpirationDate != nil { if in.ExpirationDate != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"expirationDate\":") out.RawString("\"expirationDate\":")
if in.ExpirationDate == nil { out.Float64(float64(in.ExpirationDate))
out.RawString("null")
} else {
(*in.ExpirationDate).MarshalEasyJSON(out)
}
} }
out.RawByte('}') out.RawByte('}')
} }
@ -1353,25 +1329,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork12(in *jlexer.Lexer, ou
case "issuer": case "issuer":
out.Issuer = string(in.String()) out.Issuer = string(in.String())
case "validFrom": case "validFrom":
if in.IsNull() { out.ValidFrom = cdp.Timestamp(in.Float64())
in.Skip()
out.ValidFrom = nil
} else {
if out.ValidFrom == nil {
out.ValidFrom = new(cdp.Timestamp)
}
(*out.ValidFrom).UnmarshalEasyJSON(in)
}
case "validTo": case "validTo":
if in.IsNull() { out.ValidTo = cdp.Timestamp(in.Float64())
in.Skip()
out.ValidTo = nil
} else {
if out.ValidTo == nil {
out.ValidTo = new(cdp.Timestamp)
}
(*out.ValidTo).UnmarshalEasyJSON(in)
}
case "signedCertificateTimestampList": case "signedCertificateTimestampList":
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
@ -1500,29 +1460,21 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork12(out *jwriter.Writer,
out.RawString("\"issuer\":") out.RawString("\"issuer\":")
out.String(string(in.Issuer)) out.String(string(in.Issuer))
} }
if in.ValidFrom != nil { if in.ValidFrom != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"validFrom\":") out.RawString("\"validFrom\":")
if in.ValidFrom == nil { out.Float64(float64(in.ValidFrom))
out.RawString("null")
} else {
(*in.ValidFrom).MarshalEasyJSON(out)
} }
} if in.ValidTo != 0 {
if in.ValidTo != nil {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"validTo\":") out.RawString("\"validTo\":")
if in.ValidTo == nil { out.Float64(float64(in.ValidTo))
out.RawString("null")
} else {
(*in.ValidTo).MarshalEasyJSON(out)
}
} }
if len(in.SignedCertificateTimestampList) != 0 { if len(in.SignedCertificateTimestampList) != 0 {
if !first { if !first {
@ -3239,25 +3191,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork26(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "wallTime": case "wallTime":
if in.IsNull() { out.WallTime = cdp.Timestamp(in.Float64())
in.Skip()
out.WallTime = nil
} else {
if out.WallTime == nil {
out.WallTime = new(cdp.Timestamp)
}
(*out.WallTime).UnmarshalEasyJSON(in)
}
case "request": case "request":
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
@ -3290,29 +3226,21 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork26(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
} }
} if in.WallTime != 0 {
if in.WallTime != nil {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"wallTime\":") out.RawString("\"wallTime\":")
if in.WallTime == nil { out.Float64(float64(in.WallTime))
out.RawString("null")
} else {
(*in.WallTime).MarshalEasyJSON(out)
}
} }
if in.Request != nil { if in.Request != nil {
if !first { if !first {
@ -3374,15 +3302,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork27(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "response": case "response":
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
@ -3415,17 +3335,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork27(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.Response != nil { if in.Response != nil {
if !first { if !first {
@ -3487,15 +3403,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork28(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "response": case "response":
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
@ -3528,17 +3436,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork28(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.Response != nil { if in.Response != nil {
if !first { if !first {
@ -3600,15 +3504,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork29(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "response": case "response":
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
@ -3641,17 +3537,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork29(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.Response != nil { if in.Response != nil {
if !first { if !first {
@ -3713,15 +3605,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork30(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "errorMessage": case "errorMessage":
out.ErrorMessage = string(in.String()) out.ErrorMessage = string(in.String())
default: default:
@ -3746,17 +3630,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork30(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.ErrorMessage != "" { if in.ErrorMessage != "" {
if !first { if !first {
@ -3915,15 +3795,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork32(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -3946,17 +3818,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork32(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
out.RawByte('}') out.RawByte('}')
} }
@ -4010,15 +3878,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork33(in *jlexer.Lexer, ou
case "loaderId": case "loaderId":
out.LoaderID = cdp.LoaderID(in.String()) out.LoaderID = cdp.LoaderID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "type": case "type":
(out.Type).UnmarshalEasyJSON(in) (out.Type).UnmarshalEasyJSON(in)
case "response": case "response":
@ -4069,17 +3929,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork33(out *jwriter.Writer,
out.RawString("\"loaderId\":") out.RawString("\"loaderId\":")
out.String(string(in.LoaderID)) out.String(string(in.LoaderID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.Type != "" { if in.Type != "" {
if !first { if !first {
@ -4151,15 +4007,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork34(in *jlexer.Lexer, ou
case "newPriority": case "newPriority":
(out.NewPriority).UnmarshalEasyJSON(in) (out.NewPriority).UnmarshalEasyJSON(in)
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -4190,17 +4038,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork34(out *jwriter.Writer,
out.RawString("\"newPriority\":") out.RawString("\"newPriority\":")
(in.NewPriority).MarshalEasyJSON(out) (in.NewPriority).MarshalEasyJSON(out)
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
out.RawByte('}') out.RawByte('}')
} }
@ -4266,25 +4110,9 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork35(in *jlexer.Lexer, ou
(*out.Request).UnmarshalEasyJSON(in) (*out.Request).UnmarshalEasyJSON(in)
} }
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "wallTime": case "wallTime":
if in.IsNull() { out.WallTime = cdp.Timestamp(in.Float64())
in.Skip()
out.WallTime = nil
} else {
if out.WallTime == nil {
out.WallTime = new(cdp.Timestamp)
}
(*out.WallTime).UnmarshalEasyJSON(in)
}
case "initiator": case "initiator":
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
@ -4365,29 +4193,21 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork35(out *jwriter.Writer,
(*in.Request).MarshalEasyJSON(out) (*in.Request).MarshalEasyJSON(out)
} }
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
} }
} if in.WallTime != 0 {
if in.WallTime != nil {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"wallTime\":") out.RawString("\"wallTime\":")
if in.WallTime == nil { out.Float64(float64(in.WallTime))
out.RawString("null")
} else {
(*in.WallTime).MarshalEasyJSON(out)
}
} }
if in.Initiator != nil { if in.Initiator != nil {
if !first { if !first {
@ -4736,15 +4556,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork38(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "encodedDataLength": case "encodedDataLength":
out.EncodedDataLength = float64(in.Float64()) out.EncodedDataLength = float64(in.Float64())
default: default:
@ -4769,17 +4581,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork38(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.EncodedDataLength != 0 { if in.EncodedDataLength != 0 {
if !first { if !first {
@ -4837,15 +4645,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork39(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "type": case "type":
(out.Type).UnmarshalEasyJSON(in) (out.Type).UnmarshalEasyJSON(in)
case "errorText": case "errorText":
@ -4876,17 +4676,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork39(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.Type != "" { if in.Type != "" {
if !first { if !first {
@ -4968,15 +4764,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork40(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "eventName": case "eventName":
out.EventName = string(in.String()) out.EventName = string(in.String())
case "eventId": case "eventId":
@ -5005,17 +4793,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork40(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.EventName != "" { if in.EventName != "" {
if !first { if !first {
@ -5089,15 +4873,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpNetwork41(in *jlexer.Lexer, ou
case "requestId": case "requestId":
out.RequestID = RequestID(in.String()) out.RequestID = RequestID(in.String())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = cdp.Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "dataLength": case "dataLength":
out.DataLength = int64(in.Int64()) out.DataLength = int64(in.Int64())
case "encodedDataLength": case "encodedDataLength":
@ -5124,17 +4900,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpNetwork41(out *jwriter.Writer,
out.RawString("\"requestId\":") out.RawString("\"requestId\":")
out.String(string(in.RequestID)) out.String(string(in.RequestID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.DataLength != 0 { if in.DataLength != 0 {
if !first { if !first {

View File

@ -12,7 +12,7 @@ import (
type EventResourceChangedPriority struct { type EventResourceChangedPriority struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
NewPriority ResourcePriority `json:"newPriority,omitempty"` // New priority NewPriority ResourcePriority `json:"newPriority,omitempty"` // New priority
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
} }
// EventRequestWillBeSent fired when page is about to send HTTP request. // EventRequestWillBeSent fired when page is about to send HTTP request.
@ -22,8 +22,8 @@ type EventRequestWillBeSent struct {
LoaderID cdp.LoaderID `json:"loaderId,omitempty"` // Loader identifier. LoaderID cdp.LoaderID `json:"loaderId,omitempty"` // Loader identifier.
DocumentURL string `json:"documentURL,omitempty"` // URL of the document this request is loaded for. DocumentURL string `json:"documentURL,omitempty"` // URL of the document this request is loaded for.
Request *Request `json:"request,omitempty"` // Request data. Request *Request `json:"request,omitempty"` // Request data.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
WallTime *cdp.Timestamp `json:"wallTime,omitempty"` // UTC Timestamp. WallTime cdp.Timestamp `json:"wallTime,omitempty"` // UTC Timestamp.
Initiator *Initiator `json:"initiator,omitempty"` // Request initiator. Initiator *Initiator `json:"initiator,omitempty"` // Request initiator.
RedirectResponse *Response `json:"redirectResponse,omitempty"` // Redirect response data. RedirectResponse *Response `json:"redirectResponse,omitempty"` // Redirect response data.
Type page.ResourceType `json:"type,omitempty"` // Type of this resource. Type page.ResourceType `json:"type,omitempty"` // Type of this resource.
@ -39,7 +39,7 @@ type EventResponseReceived struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame identifier. FrameID cdp.FrameID `json:"frameId,omitempty"` // Frame identifier.
LoaderID cdp.LoaderID `json:"loaderId,omitempty"` // Loader identifier. LoaderID cdp.LoaderID `json:"loaderId,omitempty"` // Loader identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
Type page.ResourceType `json:"type,omitempty"` // Resource type. Type page.ResourceType `json:"type,omitempty"` // Resource type.
Response *Response `json:"response,omitempty"` // Response data. Response *Response `json:"response,omitempty"` // Response data.
} }
@ -47,7 +47,7 @@ type EventResponseReceived struct {
// EventDataReceived fired when data chunk was received over the network. // EventDataReceived fired when data chunk was received over the network.
type EventDataReceived struct { type EventDataReceived struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
DataLength int64 `json:"dataLength,omitempty"` // Data chunk length. DataLength int64 `json:"dataLength,omitempty"` // Data chunk length.
EncodedDataLength int64 `json:"encodedDataLength,omitempty"` // Actual bytes received (might be less than dataLength for compressed encodings). EncodedDataLength int64 `json:"encodedDataLength,omitempty"` // Actual bytes received (might be less than dataLength for compressed encodings).
} }
@ -55,14 +55,14 @@ type EventDataReceived struct {
// EventLoadingFinished fired when HTTP request has finished loading. // EventLoadingFinished fired when HTTP request has finished loading.
type EventLoadingFinished struct { type EventLoadingFinished struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
EncodedDataLength float64 `json:"encodedDataLength,omitempty"` // Total number of bytes received for this request. EncodedDataLength float64 `json:"encodedDataLength,omitempty"` // Total number of bytes received for this request.
} }
// EventLoadingFailed fired when HTTP request has failed to load. // EventLoadingFailed fired when HTTP request has failed to load.
type EventLoadingFailed struct { type EventLoadingFailed struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
Type page.ResourceType `json:"type,omitempty"` // Resource type. Type page.ResourceType `json:"type,omitempty"` // Resource type.
ErrorText string `json:"errorText,omitempty"` // User friendly error message. ErrorText string `json:"errorText,omitempty"` // User friendly error message.
Canceled bool `json:"canceled,omitempty"` // True if loading was canceled. Canceled bool `json:"canceled,omitempty"` // True if loading was canceled.
@ -73,8 +73,8 @@ type EventLoadingFailed struct {
// initiate handshake. // initiate handshake.
type EventWebSocketWillSendHandshakeRequest struct { type EventWebSocketWillSendHandshakeRequest struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
WallTime *cdp.Timestamp `json:"wallTime,omitempty"` // UTC Timestamp. WallTime cdp.Timestamp `json:"wallTime,omitempty"` // UTC Timestamp.
Request *WebSocketRequest `json:"request,omitempty"` // WebSocket request data. Request *WebSocketRequest `json:"request,omitempty"` // WebSocket request data.
} }
@ -82,7 +82,7 @@ type EventWebSocketWillSendHandshakeRequest struct {
// response becomes available. // response becomes available.
type EventWebSocketHandshakeResponseReceived struct { type EventWebSocketHandshakeResponseReceived struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
Response *WebSocketResponse `json:"response,omitempty"` // WebSocket response data. Response *WebSocketResponse `json:"response,omitempty"` // WebSocket response data.
} }
@ -96,27 +96,27 @@ type EventWebSocketCreated struct {
// EventWebSocketClosed fired when WebSocket is closed. // EventWebSocketClosed fired when WebSocket is closed.
type EventWebSocketClosed struct { type EventWebSocketClosed struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
} }
// EventWebSocketFrameReceived fired when WebSocket frame is received. // EventWebSocketFrameReceived fired when WebSocket frame is received.
type EventWebSocketFrameReceived struct { type EventWebSocketFrameReceived struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
Response *WebSocketFrame `json:"response,omitempty"` // WebSocket response data. Response *WebSocketFrame `json:"response,omitempty"` // WebSocket response data.
} }
// EventWebSocketFrameError fired when WebSocket frame error occurs. // EventWebSocketFrameError fired when WebSocket frame error occurs.
type EventWebSocketFrameError struct { type EventWebSocketFrameError struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
ErrorMessage string `json:"errorMessage,omitempty"` // WebSocket frame error message. ErrorMessage string `json:"errorMessage,omitempty"` // WebSocket frame error message.
} }
// EventWebSocketFrameSent fired when WebSocket frame is sent. // EventWebSocketFrameSent fired when WebSocket frame is sent.
type EventWebSocketFrameSent struct { type EventWebSocketFrameSent struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
Response *WebSocketFrame `json:"response,omitempty"` // WebSocket response data. Response *WebSocketFrame `json:"response,omitempty"` // WebSocket response data.
} }
@ -124,7 +124,7 @@ type EventWebSocketFrameSent struct {
// received. // received.
type EventEventSourceMessageReceived struct { type EventEventSourceMessageReceived struct {
RequestID RequestID `json:"requestId,omitempty"` // Request identifier. RequestID RequestID `json:"requestId,omitempty"` // Request identifier.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp.
EventName string `json:"eventName,omitempty"` // Message type. EventName string `json:"eventName,omitempty"` // Message type.
EventID string `json:"eventId,omitempty"` // Message identifier. EventID string `json:"eventId,omitempty"` // Message identifier.
Data string `json:"data,omitempty"` // Message content. Data string `json:"data,omitempty"` // Message content.

View File

@ -407,7 +407,7 @@ type SetCookieParams struct {
Secure bool `json:"secure,omitempty"` // Defaults ot false. Secure bool `json:"secure,omitempty"` // Defaults ot false.
HTTPOnly bool `json:"httpOnly,omitempty"` // Defaults to false. HTTPOnly bool `json:"httpOnly,omitempty"` // Defaults to false.
SameSite CookieSameSite `json:"sameSite,omitempty"` // Defaults to browser default behavior. SameSite CookieSameSite `json:"sameSite,omitempty"` // Defaults to browser default behavior.
ExpirationDate *cdp.Timestamp `json:"expirationDate,omitempty"` // If omitted, the cookie becomes a session cookie. ExpirationDate cdp.Timestamp `json:"expirationDate,omitempty"` // If omitted, the cookie becomes a session cookie.
} }
// SetCookie sets a cookie with the given cookie data; may overwrite // SetCookie sets a cookie with the given cookie data; may overwrite
@ -456,7 +456,7 @@ func (p SetCookieParams) WithSameSite(sameSite CookieSameSite) *SetCookieParams
} }
// WithExpirationDate if omitted, the cookie becomes a session cookie. // WithExpirationDate if omitted, the cookie becomes a session cookie.
func (p SetCookieParams) WithExpirationDate(expirationDate *cdp.Timestamp) *SetCookieParams { func (p SetCookieParams) WithExpirationDate(expirationDate cdp.Timestamp) *SetCookieParams {
p.ExpirationDate = expirationDate p.ExpirationDate = expirationDate
return &p return &p
} }

View File

@ -301,7 +301,7 @@ type SignedCertificateTimestamp struct {
Origin string `json:"origin,omitempty"` // Origin. Origin string `json:"origin,omitempty"` // Origin.
LogDescription string `json:"logDescription,omitempty"` // Log name / description. LogDescription string `json:"logDescription,omitempty"` // Log name / description.
LogID string `json:"logId,omitempty"` // Log ID. LogID string `json:"logId,omitempty"` // Log ID.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Issuance date. Timestamp cdp.Timestamp `json:"timestamp,omitempty"` // Issuance date.
HashAlgorithm string `json:"hashAlgorithm,omitempty"` // Hash algorithm. HashAlgorithm string `json:"hashAlgorithm,omitempty"` // Hash algorithm.
SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Signature algorithm. SignatureAlgorithm string `json:"signatureAlgorithm,omitempty"` // Signature algorithm.
SignatureData string `json:"signatureData,omitempty"` // Signature data. SignatureData string `json:"signatureData,omitempty"` // Signature data.
@ -318,8 +318,8 @@ type SecurityDetails struct {
SubjectName string `json:"subjectName,omitempty"` // Certificate subject name. SubjectName string `json:"subjectName,omitempty"` // Certificate subject name.
SanList []string `json:"sanList,omitempty"` // Subject Alternative Name (SAN) DNS names and IP addresses. SanList []string `json:"sanList,omitempty"` // Subject Alternative Name (SAN) DNS names and IP addresses.
Issuer string `json:"issuer,omitempty"` // Name of the issuing CA. Issuer string `json:"issuer,omitempty"` // Name of the issuing CA.
ValidFrom *cdp.Timestamp `json:"validFrom,omitempty"` // Certificate valid from date. ValidFrom cdp.Timestamp `json:"validFrom,omitempty"` // Certificate valid from date.
ValidTo *cdp.Timestamp `json:"validTo,omitempty"` // Certificate valid to (expiration) date ValidTo cdp.Timestamp `json:"validTo,omitempty"` // Certificate valid to (expiration) date
SignedCertificateTimestampList []*SignedCertificateTimestamp `json:"signedCertificateTimestampList,omitempty"` // List of signed certificate timestamps (SCTs). SignedCertificateTimestampList []*SignedCertificateTimestamp `json:"signedCertificateTimestampList,omitempty"` // List of signed certificate timestamps (SCTs).
} }

View File

@ -834,15 +834,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPage9(in *jlexer.Lexer, out *S
case "scrollOffsetY": case "scrollOffsetY":
out.ScrollOffsetY = float64(in.Float64()) out.ScrollOffsetY = float64(in.Float64())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = float64(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -905,17 +897,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPage9(out *jwriter.Writer, in
out.RawString("\"scrollOffsetY\":") out.RawString("\"scrollOffsetY\":")
out.Float64(float64(in.ScrollOffsetY)) out.Float64(float64(in.ScrollOffsetY))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
out.RawByte('}') out.RawByte('}')
} }
@ -3103,15 +3091,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPage34(in *jlexer.Lexer, out *
case "mimeType": case "mimeType":
out.MimeType = string(in.String()) out.MimeType = string(in.String())
case "lastModified": case "lastModified":
if in.IsNull() { out.LastModified = cdp.Timestamp(in.Float64())
in.Skip()
out.LastModified = nil
} else {
if out.LastModified == nil {
out.LastModified = new(cdp.Timestamp)
}
(*out.LastModified).UnmarshalEasyJSON(in)
}
case "contentSize": case "contentSize":
out.ContentSize = float64(in.Float64()) out.ContentSize = float64(in.Float64())
case "failed": case "failed":
@ -3156,17 +3136,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPage34(out *jwriter.Writer, in
out.RawString("\"mimeType\":") out.RawString("\"mimeType\":")
out.String(string(in.MimeType)) out.String(string(in.MimeType))
} }
if in.LastModified != nil { if in.LastModified != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"lastModified\":") out.RawString("\"lastModified\":")
if in.LastModified == nil { out.Float64(float64(in.LastModified))
out.RawString("null")
} else {
(*in.LastModified).MarshalEasyJSON(out)
}
} }
if in.ContentSize != 0 { if in.ContentSize != 0 {
if !first { if !first {
@ -3507,15 +3483,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPage38(in *jlexer.Lexer, out *
} }
switch key { switch key {
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = float64(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -3530,17 +3498,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPage38(out *jwriter.Writer, in
out.RawByte('{') out.RawByte('{')
first := true first := true
_ = first _ = first
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
out.RawByte('}') out.RawByte('}')
} }
@ -4450,15 +4414,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPage51(in *jlexer.Lexer, out *
} }
switch key { switch key {
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = float64(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
default: default:
in.SkipRecursive() in.SkipRecursive()
} }
@ -4473,17 +4429,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPage51(out *jwriter.Writer, in
out.RawByte('{') out.RawByte('{')
first := true first := true
_ = first _ = first
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
out.RawByte('}') out.RawByte('}')
} }

View File

@ -9,12 +9,12 @@ import (
// EventDomContentEventFired [no description]. // EventDomContentEventFired [no description].
type EventDomContentEventFired struct { type EventDomContentEventFired struct {
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` Timestamp float64 `json:"timestamp,omitempty"`
} }
// EventLoadEventFired [no description]. // EventLoadEventFired [no description].
type EventLoadEventFired struct { type EventLoadEventFired struct {
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` Timestamp float64 `json:"timestamp,omitempty"`
} }
// EventFrameAttached fired when frame has been attached to its parent. // EventFrameAttached fired when frame has been attached to its parent.

View File

@ -91,7 +91,7 @@ type FrameResource struct {
URL string `json:"url,omitempty"` // Resource URL. URL string `json:"url,omitempty"` // Resource URL.
Type ResourceType `json:"type,omitempty"` // Type of this resource. Type ResourceType `json:"type,omitempty"` // Type of this resource.
MimeType string `json:"mimeType,omitempty"` // Resource mimeType as determined by the browser. MimeType string `json:"mimeType,omitempty"` // Resource mimeType as determined by the browser.
LastModified *cdp.Timestamp `json:"lastModified,omitempty"` // last-modified timestamp as reported by server. LastModified cdp.Timestamp `json:"lastModified,omitempty"` // last-modified timestamp as reported by server.
ContentSize float64 `json:"contentSize,omitempty"` // Resource content size. ContentSize float64 `json:"contentSize,omitempty"` // Resource content size.
Failed bool `json:"failed,omitempty"` // True if the resource failed to load. Failed bool `json:"failed,omitempty"` // True if the resource failed to load.
Canceled bool `json:"canceled,omitempty"` // True if the resource was canceled during loading. Canceled bool `json:"canceled,omitempty"` // True if the resource was canceled during loading.
@ -202,7 +202,7 @@ type ScreencastFrameMetadata struct {
DeviceHeight float64 `json:"deviceHeight,omitempty"` // Device screen height in DIP. DeviceHeight float64 `json:"deviceHeight,omitempty"` // Device screen height in DIP.
ScrollOffsetX float64 `json:"scrollOffsetX,omitempty"` // Position of horizontal scroll in CSS pixels. ScrollOffsetX float64 `json:"scrollOffsetX,omitempty"` // Position of horizontal scroll in CSS pixels.
ScrollOffsetY float64 `json:"scrollOffsetY,omitempty"` // Position of vertical scroll in CSS pixels. ScrollOffsetY float64 `json:"scrollOffsetY,omitempty"` // Position of vertical scroll in CSS pixels.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Frame swap timestamp. Timestamp float64 `json:"timestamp,omitempty"` // Frame swap timestamp.
} }
// DialogType javascript dialog type. // DialogType javascript dialog type.

View File

@ -4,7 +4,6 @@ package runtime
import ( import (
json "encoding/json" json "encoding/json"
cdp "github.com/knq/chromedp/cdp"
easyjson "github.com/mailru/easyjson" easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer" jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter" jwriter "github.com/mailru/easyjson/jwriter"
@ -2362,15 +2361,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpRuntime20(in *jlexer.Lexer, ou
} }
switch key { switch key {
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "exceptionDetails": case "exceptionDetails":
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
@ -2395,17 +2386,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpRuntime20(out *jwriter.Writer,
out.RawByte('{') out.RawByte('{')
first := true first := true
_ = first _ = first
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.ExceptionDetails != nil { if in.ExceptionDetails != nil {
if !first { if !first {
@ -2579,15 +2566,7 @@ func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpRuntime22(in *jlexer.Lexer, ou
case "executionContextId": case "executionContextId":
out.ExecutionContextID = ExecutionContextID(in.Int64()) out.ExecutionContextID = ExecutionContextID(in.Int64())
case "timestamp": case "timestamp":
if in.IsNull() { out.Timestamp = Timestamp(in.Float64())
in.Skip()
out.Timestamp = nil
} else {
if out.Timestamp == nil {
out.Timestamp = new(cdp.Timestamp)
}
(*out.Timestamp).UnmarshalEasyJSON(in)
}
case "stackTrace": case "stackTrace":
if in.IsNull() { if in.IsNull() {
in.Skip() in.Skip()
@ -2653,17 +2632,13 @@ func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpRuntime22(out *jwriter.Writer,
out.RawString("\"executionContextId\":") out.RawString("\"executionContextId\":")
out.Int64(int64(in.ExecutionContextID)) out.Int64(int64(in.ExecutionContextID))
} }
if in.Timestamp != nil { if in.Timestamp != 0 {
if !first { if !first {
out.RawByte(',') out.RawByte(',')
} }
first = false first = false
out.RawString("\"timestamp\":") out.RawString("\"timestamp\":")
if in.Timestamp == nil { out.Float64(float64(in.Timestamp))
out.RawString("null")
} else {
(*in.Timestamp).MarshalEasyJSON(out)
}
} }
if in.StackTrace != nil { if in.StackTrace != nil {
if !first { if !first {

View File

@ -23,7 +23,7 @@ type EventExecutionContextsCleared struct{}
// EventExceptionThrown issued when exception was thrown and unhandled. // EventExceptionThrown issued when exception was thrown and unhandled.
type EventExceptionThrown struct { type EventExceptionThrown struct {
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Timestamp of the exception. Timestamp Timestamp `json:"timestamp,omitempty"` // Timestamp of the exception.
ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"` ExceptionDetails *ExceptionDetails `json:"exceptionDetails,omitempty"`
} }
@ -38,7 +38,7 @@ type EventConsoleAPICalled struct {
Type APIType `json:"type,omitempty"` // Type of the call. Type APIType `json:"type,omitempty"` // Type of the call.
Args []*RemoteObject `json:"args,omitempty"` // Call arguments. Args []*RemoteObject `json:"args,omitempty"` // Call arguments.
ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Identifier of the context where the call was made. ExecutionContextID ExecutionContextID `json:"executionContextId,omitempty"` // Identifier of the context where the call was made.
Timestamp *cdp.Timestamp `json:"timestamp,omitempty"` // Call timestamp. Timestamp Timestamp `json:"timestamp,omitempty"` // Call timestamp.
StackTrace *StackTrace `json:"stackTrace,omitempty"` // Stack trace captured when the call was made. StackTrace *StackTrace `json:"stackTrace,omitempty"` // Stack trace captured when the call was made.
Context string `json:"context,omitempty"` // Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. Context string `json:"context,omitempty"` // Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context.
} }

View File

@ -189,6 +189,14 @@ func (e *ExceptionDetails) Error() string {
return fmt.Sprintf("encountered exception '%s' (%d:%d)", e.Text, e.LineNumber, e.ColumnNumber) return fmt.Sprintf("encountered exception '%s' (%d:%d)", e.Text, e.LineNumber, e.ColumnNumber)
} }
// Timestamp number of milliseconds since epoch.
type Timestamp float64
// Float64 returns the Timestamp as float64 value.
func (t Timestamp) Float64() float64 {
return float64(t)
}
// CallFrame stack entry for runtime errors and assertions. // CallFrame stack entry for runtime errors and assertions.
type CallFrame struct { type CallFrame struct {
FunctionName string `json:"functionName,omitempty"` // JavaScript function name. FunctionName string `json:"functionName,omitempty"` // JavaScript function name.

View File

@ -12,9 +12,8 @@
// - add 'Inspector.Message' type as a object with id (integer), method (MethodType), params (interface{}), error (MessageError). // - add 'Inspector.Message' type as a object with id (integer), method (MethodType), params (interface{}), error (MessageError).
// - add 'Inspector.DetachReason' type and change event 'Inspector.detached''s parameter reason's type. // - add 'Inspector.DetachReason' type and change event 'Inspector.detached''s parameter reason's type.
// - add 'Inspector.ErrorType' type. // - add 'Inspector.ErrorType' type.
// - change 'Runtime.Timestamp' to 'Network.Timestamp'.
// - change any object property or command/event parameter named 'timestamp' // - change any object property or command/event parameter named 'timestamp'
// or has $ref to Network/Runtime.Timestamp to type 'Network.Timestamp'. // that doesn't have a $ref defined to 'Runtime.Timestamp'.
// - convert object properties and event/command parameters that are enums into independent types. // - convert object properties and event/command parameters that are enums into independent types.
// - change '*.modifiers' parameters to type Input.Modifier. // - change '*.modifiers' parameters to type Input.Modifier.
// - add 'DOM.NodeType' type and convert "nodeType" parameters to it. // - add 'DOM.NodeType' type and convert "nodeType" parameters to it.
@ -34,6 +33,7 @@ package fixup
import ( import (
"fmt" "fmt"
"log"
"strings" "strings"
"github.com/knq/chromedp/cmd/chromedp-gen/internal" "github.com/knq/chromedp/cmd/chromedp-gen/internal"
@ -330,10 +330,10 @@ func FixDomains(domains []*internal.Domain) {
case internal.DomainNetwork: case internal.DomainNetwork:
for _, t := range d.Types { for _, t := range d.Types {
// change Timestamp to TypeTimestamp and add extra unmarshaling template // change Timestamp to TypeTimestamp and add extra unmarshaling template
if t.ID == "Timestamp" { /*if t.ID == "Timestamp" {
t.Type = internal.TypeTimestamp t.Type = internal.TypeTimestamp
t.Extra += templates.ExtraTimestampTemplate(t, d) t.Extra = templates.ExtraTimestampTemplate(t, d)
} }*/
// change Headers to be a map[string]interface{} // change Headers to be a map[string]interface{}
if t.ID == "Headers" { if t.ID == "Headers" {
@ -346,8 +346,9 @@ func FixDomains(domains []*internal.Domain) {
var types []*internal.Type var types []*internal.Type
for _, t := range d.Types { for _, t := range d.Types {
switch t.ID { switch t.ID {
case "Timestamp": /*case "Timestamp":
continue t.Type = internal.TypeTimestamp
t.Extra += templates.ExtraBootstampTemplate(t, d)*/
case "ExceptionDetails": case "ExceptionDetails":
t.Extra += templates.ExtraExceptionDetailsTemplate() t.Extra += templates.ExtraExceptionDetailsTemplate()
@ -438,13 +439,15 @@ func convertObjectProperties(params []*internal.Type, d *internal.Domain, name s
case p.Enum != nil: case p.Enum != nil:
r = append(r, fixupEnumParameter(name, p, d)) r = append(r, fixupEnumParameter(name, p, d))
case (p.Name == "timestamp" || p.Ref == "Network.Timestamp" || p.Ref == "Timestamp") && d.Domain != internal.DomainInput: case p.Name == "timestamp":
r = append(r, &internal.Type{ log.Printf(">>> %s.%s.%s", d.Domain, name, p.Name)
r = append(r, p)
/*r = append(r, &internal.Type{
Name: p.Name, Name: p.Name,
Ref: "Network.Timestamp", Ref: "Runtime.Timestamp",
Description: p.Description, Description: p.Description,
Optional: p.Optional, Optional: p.Optional,
}) })*/
case p.Name == "modifiers": case p.Name == "modifiers":
r = append(r, &internal.Type{ r = append(r, &internal.Type{

View File

@ -6,10 +6,14 @@
// defines its JSON unmarshaling. // defines its JSON unmarshaling.
{% func ExtraTimestampTemplate(t *internal.Type, d *internal.Domain) %}{%code {% func ExtraTimestampTemplate(t *internal.Type, d *internal.Domain) %}{%code
typ := t.IDorName() typ := t.IDorName()
bootstamp := false
%} %}
// MarshalEasyJSON satisfies easyjson.Marshaler. // MarshalEasyJSON satisfies easyjson.Marshaler.
func (t {%s= typ %}) MarshalEasyJSON(out *jwriter.Writer) { func (t {%s= typ %}) MarshalEasyJSON(out *jwriter.Writer) {
out.Float64(float64(time.Time(t).Sub(sysutil.BootTime()))/float64(time.Second)) {% if bootstamp %}
out.Float64(float64(time.Time(t).Sub(sysutil.BootTime()))/float64(time.Second)){% else %}
out.Float64(float64(time.Time(t))/float64(time.Second))
{% endif %}
} }
// MarshalJSON satisfies json.Marshaler. // MarshalJSON satisfies json.Marshaler.
@ -19,7 +23,10 @@ func (t {%s= typ %}) MarshalJSON() ([]byte, error) {
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. // UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *{%s= typ %}) UnmarshalEasyJSON(in *jlexer.Lexer) { func (t *{%s= typ %}) UnmarshalEasyJSON(in *jlexer.Lexer) {
*t = {%s= typ %}(sysutil.BootTime().Add(time.Duration(in.Float64()*float64(time.Second)))) {% if bootstamp %}
*t = {%s= typ %}(sysutil.BootTime().Add(time.Duration(in.Float64()*float64(time.Second)))){% else %}
*t = {%s= typ %}(time.Duration(in.Float64()*float64(time.Second)))
{% endif %}
} }
// UnmarshalJSON satisfies json.Unmarshaler. // UnmarshalJSON satisfies json.Unmarshaler.

View File

@ -29,83 +29,118 @@ var (
func StreamExtraTimestampTemplate(qw422016 *qt422016.Writer, t *internal.Type, d *internal.Domain) { func StreamExtraTimestampTemplate(qw422016 *qt422016.Writer, t *internal.Type, d *internal.Domain) {
//line templates/extra.qtpl:8 //line templates/extra.qtpl:8
typ := t.IDorName() typ := t.IDorName()
bootstamp := false
//line templates/extra.qtpl:9 //line templates/extra.qtpl:10
qw422016.N().S(` qw422016.N().S(`
// MarshalEasyJSON satisfies easyjson.Marshaler. // MarshalEasyJSON satisfies easyjson.Marshaler.
func (t `) func (t `)
//line templates/extra.qtpl:11 //line templates/extra.qtpl:12
qw422016.N().S(typ) qw422016.N().S(typ)
//line templates/extra.qtpl:11 //line templates/extra.qtpl:12
qw422016.N().S(`) MarshalEasyJSON(out *jwriter.Writer) { qw422016.N().S(`) MarshalEasyJSON(out *jwriter.Writer) {
out.Float64(float64(time.Time(t).Sub(sysutil.BootTime()))/float64(time.Second)) `)
//line templates/extra.qtpl:13
if bootstamp {
//line templates/extra.qtpl:13
qw422016.N().S(`
out.Float64(float64(time.Time(t).Sub(sysutil.BootTime()))/float64(time.Second))`)
//line templates/extra.qtpl:14
} else {
//line templates/extra.qtpl:14
qw422016.N().S(`
out.Float64(float64(time.Time(t))/float64(time.Second))
`)
//line templates/extra.qtpl:16
}
//line templates/extra.qtpl:16
qw422016.N().S(`
} }
// MarshalJSON satisfies json.Marshaler. // MarshalJSON satisfies json.Marshaler.
func (t `) func (t `)
//line templates/extra.qtpl:16 //line templates/extra.qtpl:20
qw422016.N().S(typ) qw422016.N().S(typ)
//line templates/extra.qtpl:16 //line templates/extra.qtpl:20
qw422016.N().S(`) MarshalJSON() ([]byte, error) { qw422016.N().S(`) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t) return easyjson.Marshal(t)
} }
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. // UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *`) func (t *`)
//line templates/extra.qtpl:21 //line templates/extra.qtpl:25
qw422016.N().S(typ) qw422016.N().S(typ)
//line templates/extra.qtpl:21 //line templates/extra.qtpl:25
qw422016.N().S(`) UnmarshalEasyJSON(in *jlexer.Lexer) { qw422016.N().S(`) UnmarshalEasyJSON(in *jlexer.Lexer) {
`)
//line templates/extra.qtpl:26
if bootstamp {
//line templates/extra.qtpl:26
qw422016.N().S(`
*t = `) *t = `)
//line templates/extra.qtpl:22 //line templates/extra.qtpl:27
qw422016.N().S(typ) qw422016.N().S(typ)
//line templates/extra.qtpl:22 //line templates/extra.qtpl:27
qw422016.N().S(`(sysutil.BootTime().Add(time.Duration(in.Float64()*float64(time.Second)))) qw422016.N().S(`(sysutil.BootTime().Add(time.Duration(in.Float64()*float64(time.Second))))`)
//line templates/extra.qtpl:27
} else {
//line templates/extra.qtpl:27
qw422016.N().S(`
*t = `)
//line templates/extra.qtpl:28
qw422016.N().S(typ)
//line templates/extra.qtpl:28
qw422016.N().S(`(time.Duration(in.Float64()*float64(time.Second)))
`)
//line templates/extra.qtpl:29
}
//line templates/extra.qtpl:29
qw422016.N().S(`
} }
// UnmarshalJSON satisfies json.Unmarshaler. // UnmarshalJSON satisfies json.Unmarshaler.
func (t *`) func (t *`)
//line templates/extra.qtpl:26 //line templates/extra.qtpl:33
qw422016.N().S(typ) qw422016.N().S(typ)
//line templates/extra.qtpl:26 //line templates/extra.qtpl:33
qw422016.N().S(`) UnmarshalJSON(buf []byte) error { qw422016.N().S(`) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t) return easyjson.Unmarshal(buf, t)
} }
`) `)
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
} }
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
func WriteExtraTimestampTemplate(qq422016 qtio422016.Writer, t *internal.Type, d *internal.Domain) { func WriteExtraTimestampTemplate(qq422016 qtio422016.Writer, t *internal.Type, d *internal.Domain) {
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
StreamExtraTimestampTemplate(qw422016, t, d) StreamExtraTimestampTemplate(qw422016, t, d)
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
} }
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
func ExtraTimestampTemplate(t *internal.Type, d *internal.Domain) string { func ExtraTimestampTemplate(t *internal.Type, d *internal.Domain) string {
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
WriteExtraTimestampTemplate(qb422016, t, d) WriteExtraTimestampTemplate(qb422016, t, d)
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
return qs422016 return qs422016
//line templates/extra.qtpl:29 //line templates/extra.qtpl:36
} }
// ExtraFrameTemplate is a special template for the Page.Frame type, adding FrameState. // ExtraFrameTemplate is a special template for the Page.Frame type, adding FrameState.
//line templates/extra.qtpl:32 //line templates/extra.qtpl:39
func StreamExtraFrameTemplate(qw422016 *qt422016.Writer) { func StreamExtraFrameTemplate(qw422016 *qt422016.Writer) {
//line templates/extra.qtpl:32 //line templates/extra.qtpl:39
qw422016.N().S(` qw422016.N().S(`
// FrameState is the state of a Frame. // FrameState is the state of a Frame.
type FrameState uint16 type FrameState uint16
@ -144,40 +179,40 @@ func (fs FrameState) String() string {
// EmptyFrameID is the "non-existent" frame id. // EmptyFrameID is the "non-existent" frame id.
const EmptyFrameID = FrameID("") const EmptyFrameID = FrameID("")
`) `)
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
} }
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
func WriteExtraFrameTemplate(qq422016 qtio422016.Writer) { func WriteExtraFrameTemplate(qq422016 qtio422016.Writer) {
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
StreamExtraFrameTemplate(qw422016) StreamExtraFrameTemplate(qw422016)
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
} }
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
func ExtraFrameTemplate() string { func ExtraFrameTemplate() string {
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
WriteExtraFrameTemplate(qb422016) WriteExtraFrameTemplate(qb422016)
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
return qs422016 return qs422016
//line templates/extra.qtpl:69 //line templates/extra.qtpl:76
} }
// ExtraNodeTemplate is a special template for the DOM.Node type, adding NodeState. // ExtraNodeTemplate is a special template for the DOM.Node type, adding NodeState.
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
func StreamExtraNodeTemplate(qw422016 *qt422016.Writer) { func StreamExtraNodeTemplate(qw422016 *qt422016.Writer) {
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
qw422016.N().S(` qw422016.N().S(`
// AttributeValue returns the named attribute for the node. // AttributeValue returns the named attribute for the node.
func (n *Node) AttributeValue(name string) string { func (n *Node) AttributeValue(name string) string {
@ -211,21 +246,21 @@ func (n *Node) xpath(stopAtDocument, stopAtID bool) string {
case stopAtID && id != "": case stopAtID && id != "":
p = "/" p = "/"
pos = `) pos = `)
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
qw422016.N().S("`") qw422016.N().S("`")
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
qw422016.N().S(`[@id='`) qw422016.N().S(`[@id='`)
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
qw422016.N().S("`") qw422016.N().S("`")
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
qw422016.N().S(`+id+`) qw422016.N().S(`+id+`)
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
qw422016.N().S("`") qw422016.N().S("`")
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
qw422016.N().S(`']`) qw422016.N().S(`']`)
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
qw422016.N().S("`") qw422016.N().S("`")
//line templates/extra.qtpl:72 //line templates/extra.qtpl:79
qw422016.N().S(` qw422016.N().S(`
case n.Parent != nil: case n.Parent != nil:
@ -309,136 +344,136 @@ func (ns NodeState) String() string {
// EmptyNodeID is the "non-existent" node id. // EmptyNodeID is the "non-existent" node id.
const EmptyNodeID = NodeID(0) const EmptyNodeID = NodeID(0)
`) `)
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
} }
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
func WriteExtraNodeTemplate(qq422016 qtio422016.Writer) { func WriteExtraNodeTemplate(qq422016 qtio422016.Writer) {
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
StreamExtraNodeTemplate(qw422016) StreamExtraNodeTemplate(qw422016)
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
} }
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
func ExtraNodeTemplate() string { func ExtraNodeTemplate() string {
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
WriteExtraNodeTemplate(qb422016) WriteExtraNodeTemplate(qb422016)
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
return qs422016 return qs422016
//line templates/extra.qtpl:186 //line templates/extra.qtpl:193
} }
// ExtraFixStringUnmarshaler is a template that forces values to be parsed properly. // ExtraFixStringUnmarshaler is a template that forces values to be parsed properly.
//line templates/extra.qtpl:189 //line templates/extra.qtpl:196
func StreamExtraFixStringUnmarshaler(qw422016 *qt422016.Writer, typ, parseFunc, extra string) { func StreamExtraFixStringUnmarshaler(qw422016 *qt422016.Writer, typ, parseFunc, extra string) {
//line templates/extra.qtpl:189 //line templates/extra.qtpl:196
qw422016.N().S(` qw422016.N().S(`
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. // UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *`) func (t *`)
//line templates/extra.qtpl:191 //line templates/extra.qtpl:198
qw422016.N().S(typ) qw422016.N().S(typ)
//line templates/extra.qtpl:191 //line templates/extra.qtpl:198
qw422016.N().S(`) UnmarshalEasyJSON(in *jlexer.Lexer) { qw422016.N().S(`) UnmarshalEasyJSON(in *jlexer.Lexer) {
buf := in.Raw() buf := in.Raw()
if l := len(buf); l > 2 && buf[0] == '"' && buf[l-1] == '"' { if l := len(buf); l > 2 && buf[0] == '"' && buf[l-1] == '"' {
buf = buf[1:l-1] buf = buf[1:l-1]
} }
`) `)
//line templates/extra.qtpl:196 //line templates/extra.qtpl:203
if parseFunc != "" { if parseFunc != "" {
//line templates/extra.qtpl:196 //line templates/extra.qtpl:203
qw422016.N().S(` qw422016.N().S(`
v, err := strconv.`) v, err := strconv.`)
//line templates/extra.qtpl:197 //line templates/extra.qtpl:204
qw422016.N().S(parseFunc) qw422016.N().S(parseFunc)
//line templates/extra.qtpl:197 //line templates/extra.qtpl:204
qw422016.N().S(`(string(buf)`) qw422016.N().S(`(string(buf)`)
//line templates/extra.qtpl:197 //line templates/extra.qtpl:204
qw422016.N().S(extra) qw422016.N().S(extra)
//line templates/extra.qtpl:197 //line templates/extra.qtpl:204
qw422016.N().S(`) qw422016.N().S(`)
if err != nil { if err != nil {
in.AddError(err) in.AddError(err)
} }
`) `)
//line templates/extra.qtpl:201 //line templates/extra.qtpl:208
} }
//line templates/extra.qtpl:201 //line templates/extra.qtpl:208
qw422016.N().S(` qw422016.N().S(`
*t = `) *t = `)
//line templates/extra.qtpl:202 //line templates/extra.qtpl:209
qw422016.N().S(typ) qw422016.N().S(typ)
//line templates/extra.qtpl:202 //line templates/extra.qtpl:209
qw422016.N().S(`(`) qw422016.N().S(`(`)
//line templates/extra.qtpl:202 //line templates/extra.qtpl:209
if parseFunc != "" { if parseFunc != "" {
//line templates/extra.qtpl:202 //line templates/extra.qtpl:209
qw422016.N().S(`v`) qw422016.N().S(`v`)
//line templates/extra.qtpl:202 //line templates/extra.qtpl:209
} else { } else {
//line templates/extra.qtpl:202 //line templates/extra.qtpl:209
qw422016.N().S(`buf`) qw422016.N().S(`buf`)
//line templates/extra.qtpl:202 //line templates/extra.qtpl:209
} }
//line templates/extra.qtpl:202 //line templates/extra.qtpl:209
qw422016.N().S(`) qw422016.N().S(`)
} }
// UnmarshalJSON satisfies json.Unmarshaler. // UnmarshalJSON satisfies json.Unmarshaler.
func (t *`) func (t *`)
//line templates/extra.qtpl:206 //line templates/extra.qtpl:213
qw422016.N().S(typ) qw422016.N().S(typ)
//line templates/extra.qtpl:206 //line templates/extra.qtpl:213
qw422016.N().S(`) UnmarshalJSON(buf []byte) error { qw422016.N().S(`) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t) return easyjson.Unmarshal(buf, t)
} }
`) `)
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
} }
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
func WriteExtraFixStringUnmarshaler(qq422016 qtio422016.Writer, typ, parseFunc, extra string) { func WriteExtraFixStringUnmarshaler(qq422016 qtio422016.Writer, typ, parseFunc, extra string) {
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
StreamExtraFixStringUnmarshaler(qw422016, typ, parseFunc, extra) StreamExtraFixStringUnmarshaler(qw422016, typ, parseFunc, extra)
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
} }
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
func ExtraFixStringUnmarshaler(typ, parseFunc, extra string) string { func ExtraFixStringUnmarshaler(typ, parseFunc, extra string) string {
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
WriteExtraFixStringUnmarshaler(qb422016, typ, parseFunc, extra) WriteExtraFixStringUnmarshaler(qb422016, typ, parseFunc, extra)
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
return qs422016 return qs422016
//line templates/extra.qtpl:209 //line templates/extra.qtpl:216
} }
// ExtraExceptionDetailsTemplate is a special template for the Runtime.ExceptionDetails type that // ExtraExceptionDetailsTemplate is a special template for the Runtime.ExceptionDetails type that
// defines the standard error interface. // defines the standard error interface.
//line templates/extra.qtpl:213 //line templates/extra.qtpl:220
func StreamExtraExceptionDetailsTemplate(qw422016 *qt422016.Writer) { func StreamExtraExceptionDetailsTemplate(qw422016 *qt422016.Writer) {
//line templates/extra.qtpl:213 //line templates/extra.qtpl:220
qw422016.N().S(` qw422016.N().S(`
// Error satisfies the error interface. // Error satisfies the error interface.
func (e *ExceptionDetails) Error() string { func (e *ExceptionDetails) Error() string {
@ -447,41 +482,41 @@ func (e *ExceptionDetails) Error() string {
return fmt.Sprintf("encountered exception '%s' (%d:%d)", e.Text, e.LineNumber, e.ColumnNumber) return fmt.Sprintf("encountered exception '%s' (%d:%d)", e.Text, e.LineNumber, e.ColumnNumber)
} }
`) `)
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
} }
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
func WriteExtraExceptionDetailsTemplate(qq422016 qtio422016.Writer) { func WriteExtraExceptionDetailsTemplate(qq422016 qtio422016.Writer) {
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
StreamExtraExceptionDetailsTemplate(qw422016) StreamExtraExceptionDetailsTemplate(qw422016)
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
} }
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
func ExtraExceptionDetailsTemplate() string { func ExtraExceptionDetailsTemplate() string {
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
WriteExtraExceptionDetailsTemplate(qb422016) WriteExtraExceptionDetailsTemplate(qb422016)
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
return qs422016 return qs422016
//line templates/extra.qtpl:220 //line templates/extra.qtpl:227
} }
// ExtraCDPTypes is the template for additional internal type // ExtraCDPTypes is the template for additional internal type
// declarations. // declarations.
//line templates/extra.qtpl:224 //line templates/extra.qtpl:231
func StreamExtraCDPTypes(qw422016 *qt422016.Writer) { func StreamExtraCDPTypes(qw422016 *qt422016.Writer) {
//line templates/extra.qtpl:224 //line templates/extra.qtpl:231
qw422016.N().S(` qw422016.N().S(`
// Error satisfies the error interface. // Error satisfies the error interface.
@ -515,40 +550,40 @@ type Handler interface {
Release(<-chan interface{}) Release(<-chan interface{})
} }
`) `)
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
} }
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
func WriteExtraCDPTypes(qq422016 qtio422016.Writer) { func WriteExtraCDPTypes(qq422016 qtio422016.Writer) {
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
StreamExtraCDPTypes(qw422016) StreamExtraCDPTypes(qw422016)
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
} }
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
func ExtraCDPTypes() string { func ExtraCDPTypes() string {
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
WriteExtraCDPTypes(qb422016) WriteExtraCDPTypes(qb422016)
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
return qs422016 return qs422016
//line templates/extra.qtpl:256 //line templates/extra.qtpl:263
} }
// ExtraUtilTemplate generates the decode func for the Message type. // ExtraUtilTemplate generates the decode func for the Message type.
//line templates/extra.qtpl:259 //line templates/extra.qtpl:266
func StreamExtraUtilTemplate(qw422016 *qt422016.Writer, domains []*internal.Domain) { func StreamExtraUtilTemplate(qw422016 *qt422016.Writer, domains []*internal.Domain) {
//line templates/extra.qtpl:259 //line templates/extra.qtpl:266
qw422016.N().S(` qw422016.N().S(`
type empty struct{} type empty struct{}
var emptyVal = &empty{} var emptyVal = &empty{}
@ -557,66 +592,66 @@ var emptyVal = &empty{}
func UnmarshalMessage(msg *cdp.Message) (interface{}, error) { func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
var v easyjson.Unmarshaler var v easyjson.Unmarshaler
switch msg.Method {`) switch msg.Method {`)
//line templates/extra.qtpl:266 //line templates/extra.qtpl:273
for _, d := range domains { for _, d := range domains {
//line templates/extra.qtpl:266 //line templates/extra.qtpl:273
for _, c := range d.Commands { for _, c := range d.Commands {
//line templates/extra.qtpl:266 //line templates/extra.qtpl:273
qw422016.N().S(` qw422016.N().S(`
case cdp.`) case cdp.`)
//line templates/extra.qtpl:267 //line templates/extra.qtpl:274
qw422016.N().S(c.CommandMethodType(d)) qw422016.N().S(c.CommandMethodType(d))
//line templates/extra.qtpl:267 //line templates/extra.qtpl:274
qw422016.N().S(`:`) qw422016.N().S(`:`)
//line templates/extra.qtpl:267 //line templates/extra.qtpl:274
if len(c.Returns) == 0 { if len(c.Returns) == 0 {
//line templates/extra.qtpl:267 //line templates/extra.qtpl:274
qw422016.N().S(` qw422016.N().S(`
return emptyVal, nil`) return emptyVal, nil`)
//line templates/extra.qtpl:268 //line templates/extra.qtpl:275
} else { } else {
//line templates/extra.qtpl:268 //line templates/extra.qtpl:275
qw422016.N().S(` qw422016.N().S(`
v = new(`) v = new(`)
//line templates/extra.qtpl:269 //line templates/extra.qtpl:276
qw422016.N().S(d.PackageRefName()) qw422016.N().S(d.PackageRefName())
//line templates/extra.qtpl:269 //line templates/extra.qtpl:276
qw422016.N().S(`.`) qw422016.N().S(`.`)
//line templates/extra.qtpl:269 //line templates/extra.qtpl:276
qw422016.N().S(c.CommandReturnsType()) qw422016.N().S(c.CommandReturnsType())
//line templates/extra.qtpl:269 //line templates/extra.qtpl:276
qw422016.N().S(`)`) qw422016.N().S(`)`)
//line templates/extra.qtpl:269 //line templates/extra.qtpl:276
} }
//line templates/extra.qtpl:269 //line templates/extra.qtpl:276
qw422016.N().S(` qw422016.N().S(`
`) `)
//line templates/extra.qtpl:270 //line templates/extra.qtpl:277
} }
//line templates/extra.qtpl:270 //line templates/extra.qtpl:277
for _, e := range d.Events { for _, e := range d.Events {
//line templates/extra.qtpl:270 //line templates/extra.qtpl:277
qw422016.N().S(` qw422016.N().S(`
case cdp.`) case cdp.`)
//line templates/extra.qtpl:271 //line templates/extra.qtpl:278
qw422016.N().S(e.EventMethodType(d)) qw422016.N().S(e.EventMethodType(d))
//line templates/extra.qtpl:271 //line templates/extra.qtpl:278
qw422016.N().S(`: qw422016.N().S(`:
v = new(`) v = new(`)
//line templates/extra.qtpl:272 //line templates/extra.qtpl:279
qw422016.N().S(d.PackageRefName()) qw422016.N().S(d.PackageRefName())
//line templates/extra.qtpl:272 //line templates/extra.qtpl:279
qw422016.N().S(`.`) qw422016.N().S(`.`)
//line templates/extra.qtpl:272 //line templates/extra.qtpl:279
qw422016.N().S(e.EventType()) qw422016.N().S(e.EventType())
//line templates/extra.qtpl:272 //line templates/extra.qtpl:279
qw422016.N().S(`) qw422016.N().S(`)
`) `)
//line templates/extra.qtpl:273 //line templates/extra.qtpl:280
} }
//line templates/extra.qtpl:273 //line templates/extra.qtpl:280
} }
//line templates/extra.qtpl:273 //line templates/extra.qtpl:280
qw422016.N().S(`} qw422016.N().S(`}
var buf easyjson.RawMessage var buf easyjson.RawMessage
@ -639,69 +674,69 @@ func UnmarshalMessage(msg *cdp.Message) (interface{}, error) {
return v, nil return v, nil
} }
`) `)
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
} }
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
func WriteExtraUtilTemplate(qq422016 qtio422016.Writer, domains []*internal.Domain) { func WriteExtraUtilTemplate(qq422016 qtio422016.Writer, domains []*internal.Domain) {
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
StreamExtraUtilTemplate(qw422016, domains) StreamExtraUtilTemplate(qw422016, domains)
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
} }
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
func ExtraUtilTemplate(domains []*internal.Domain) string { func ExtraUtilTemplate(domains []*internal.Domain) string {
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
WriteExtraUtilTemplate(qb422016, domains) WriteExtraUtilTemplate(qb422016, domains)
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
return qs422016 return qs422016
//line templates/extra.qtpl:294 //line templates/extra.qtpl:301
} }
//line templates/extra.qtpl:296 //line templates/extra.qtpl:303
func StreamExtraMethodTypeDomainDecoder(qw422016 *qt422016.Writer) { func StreamExtraMethodTypeDomainDecoder(qw422016 *qt422016.Writer) {
//line templates/extra.qtpl:296 //line templates/extra.qtpl:303
qw422016.N().S(` qw422016.N().S(`
// Domain returns the Chrome Debugging Protocol domain of the event or command. // Domain returns the Chrome Debugging Protocol domain of the event or command.
func (t MethodType) Domain() string { func (t MethodType) Domain() string {
return string(t[:strings.IndexByte(string(t), '.')]) return string(t[:strings.IndexByte(string(t), '.')])
} }
`) `)
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
} }
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
func WriteExtraMethodTypeDomainDecoder(qq422016 qtio422016.Writer) { func WriteExtraMethodTypeDomainDecoder(qq422016 qtio422016.Writer) {
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
StreamExtraMethodTypeDomainDecoder(qw422016) StreamExtraMethodTypeDomainDecoder(qw422016)
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
} }
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
func ExtraMethodTypeDomainDecoder() string { func ExtraMethodTypeDomainDecoder() string {
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
WriteExtraMethodTypeDomainDecoder(qb422016) WriteExtraMethodTypeDomainDecoder(qb422016)
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
return qs422016 return qs422016
//line templates/extra.qtpl:301 //line templates/extra.qtpl:308
} }