Update chromedp to fix console errors (#1521)

This commit is contained in:
peolic
2021-06-23 01:05:58 +03:00
committed by GitHub
parent ae3400a9b1
commit be2fe1de26
526 changed files with 55061 additions and 30300 deletions

View File

@@ -29,7 +29,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing(in *jlexer.Lexer, out
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -278,7 +278,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing1(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -304,6 +304,10 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing1(in *jlexer.Lexer, ou
}
(*out.TraceConfig).UnmarshalEasyJSON(in)
}
case "perfettoConfig":
out.PerfettoConfig = string(in.String())
case "tracingBackend":
(out.TracingBackend).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
@@ -364,6 +368,26 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTracing1(out *jwriter.Writer,
}
(*in.TraceConfig).MarshalEasyJSON(out)
}
if in.PerfettoConfig != "" {
const prefix string = ",\"perfettoConfig\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(in.PerfettoConfig))
}
if in.TracingBackend != "" {
const prefix string = ",\"tracingBackend\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
(in.TracingBackend).MarshalEasyJSON(out)
}
out.RawByte('}')
}
@@ -401,7 +425,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing2(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -480,7 +504,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing3(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -490,6 +514,8 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing3(in *jlexer.Lexer, ou
switch key {
case "deterministic":
out.Deterministic = bool(in.Bool())
case "levelOfDetail":
(out.LevelOfDetail).UnmarshalEasyJSON(in)
default:
in.SkipRecursive()
}
@@ -510,6 +536,16 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoTracing3(out *jwriter.Writer,
out.RawString(prefix[1:])
out.Bool(bool(in.Deterministic))
}
if in.LevelOfDetail != "" {
const prefix string = ",\"levelOfDetail\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
(in.LevelOfDetail).MarshalEasyJSON(out)
}
out.RawByte('}')
}
@@ -547,7 +583,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing4(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -613,7 +649,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing5(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -672,7 +708,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing6(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -769,7 +805,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing7(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -828,7 +864,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing8(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -915,7 +951,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing9(in *jlexer.Lexer, ou
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1013,7 +1049,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing10(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()
@@ -1104,7 +1140,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoTracing11(in *jlexer.Lexer, o
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
key := in.UnsafeFieldName(false)
in.WantColon()
if in.IsNull() {
in.Skip()

View File

@@ -81,7 +81,8 @@ func (p *RecordClockSyncMarkerParams) Do(ctx context.Context) (err error) {
// RequestMemoryDumpParams request a global memory dump.
type RequestMemoryDumpParams struct {
Deterministic bool `json:"deterministic,omitempty"` // Enables more deterministic results by forcing garbage collection
Deterministic bool `json:"deterministic,omitempty"` // Enables more deterministic results by forcing garbage collection
LevelOfDetail MemoryDumpLevelOfDetail `json:"levelOfDetail,omitempty"` // Specifies level of details in memory dump. Defaults to "detailed".
}
// RequestMemoryDump request a global memory dump.
@@ -100,6 +101,13 @@ func (p RequestMemoryDumpParams) WithDeterministic(deterministic bool) *RequestM
return &p
}
// WithLevelOfDetail specifies level of details in memory dump. Defaults to
// "detailed".
func (p RequestMemoryDumpParams) WithLevelOfDetail(levelOfDetail MemoryDumpLevelOfDetail) *RequestMemoryDumpParams {
p.LevelOfDetail = levelOfDetail
return &p
}
// RequestMemoryDumpReturns return values.
type RequestMemoryDumpReturns struct {
DumpGUID string `json:"dumpGuid,omitempty"` // GUID of the resulting global memory dump.
@@ -129,6 +137,8 @@ type StartParams struct {
StreamFormat StreamFormat `json:"streamFormat,omitempty"` // Trace data format to use. This only applies when using ReturnAsStream transfer mode (defaults to json).
StreamCompression StreamCompression `json:"streamCompression,omitempty"` // Compression format to use. This only applies when using ReturnAsStream transfer mode (defaults to none)
TraceConfig *TraceConfig `json:"traceConfig,omitempty"`
PerfettoConfig string `json:"perfettoConfig,omitempty"` // Base64-encoded serialized perfetto.protos.TraceConfig protobuf message When specified, the parameters categories, options, traceConfig are ignored.
TracingBackend Backend `json:"tracingBackend,omitempty"` // Backend type (defaults to auto)
}
// Start start trace events collection.
@@ -174,6 +184,20 @@ func (p StartParams) WithTraceConfig(traceConfig *TraceConfig) *StartParams {
return &p
}
// WithPerfettoConfig base64-encoded serialized perfetto.protos.TraceConfig
// protobuf message When specified, the parameters categories, options,
// traceConfig are ignored.
func (p StartParams) WithPerfettoConfig(perfettoConfig string) *StartParams {
p.PerfettoConfig = perfettoConfig
return &p
}
// WithTracingBackend backend type (defaults to auto).
func (p StartParams) WithTracingBackend(tracingBackend Backend) *StartParams {
p.TracingBackend = tracingBackend
return &p
}
// Do executes Tracing.start against the provided context.
func (p *StartParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStart, p, nil)

View File

@@ -120,6 +120,106 @@ func (t *StreamCompression) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// MemoryDumpLevelOfDetail details exposed when memory request explicitly
// declared. Keep consistent with memory_dump_request_args.h and
// memory_instrumentation.mojom.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#type-MemoryDumpLevelOfDetail
type MemoryDumpLevelOfDetail string
// String returns the MemoryDumpLevelOfDetail as string value.
func (t MemoryDumpLevelOfDetail) String() string {
return string(t)
}
// MemoryDumpLevelOfDetail values.
const (
MemoryDumpLevelOfDetailBackground MemoryDumpLevelOfDetail = "background"
MemoryDumpLevelOfDetailLight MemoryDumpLevelOfDetail = "light"
MemoryDumpLevelOfDetailDetailed MemoryDumpLevelOfDetail = "detailed"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t MemoryDumpLevelOfDetail) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t MemoryDumpLevelOfDetail) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *MemoryDumpLevelOfDetail) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch MemoryDumpLevelOfDetail(in.String()) {
case MemoryDumpLevelOfDetailBackground:
*t = MemoryDumpLevelOfDetailBackground
case MemoryDumpLevelOfDetailLight:
*t = MemoryDumpLevelOfDetailLight
case MemoryDumpLevelOfDetailDetailed:
*t = MemoryDumpLevelOfDetailDetailed
default:
in.AddError(errors.New("unknown MemoryDumpLevelOfDetail value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *MemoryDumpLevelOfDetail) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// Backend backend type to use for tracing. chrome uses the Chrome-integrated
// tracing service and is supported on all platforms. system is only supported
// on Chrome OS and uses the Perfetto system tracing service. auto chooses
// system when the perfettoConfig provided to Tracing.start specifies at least
// one non-Chrome data source; otherwise uses chrome.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#type-TracingBackend
type Backend string
// String returns the Backend as string value.
func (t Backend) String() string {
return string(t)
}
// Backend values.
const (
BackendAuto Backend = "auto"
BackendChrome Backend = "chrome"
BackendSystem Backend = "system"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t Backend) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t Backend) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *Backend) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch Backend(in.String()) {
case BackendAuto:
*t = BackendAuto
case BackendChrome:
*t = BackendChrome
case BackendSystem:
*t = BackendSystem
default:
in.AddError(errors.New("unknown Backend value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *Backend) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// RecordMode controls how the trace buffer stores data.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#type-TraceConfig