diff --git a/browser/types.go b/browser/types.go index 85b6da7..597ba5d 100644 --- a/browser/types.go +++ b/browser/types.go @@ -251,7 +251,8 @@ func (t *PermissionSetting) UnmarshalJSON(buf []byte) error { } // PermissionDescriptor definition of PermissionDescriptor defined in the -// Permissions API: https://w3c.github.io/permissions/#dom-permissiondescriptor. +// Permissions API: +// https://w3c.github.io/permissions/#dictdef-permissiondescriptor. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#type-PermissionDescriptor type PermissionDescriptor struct { diff --git a/cdproto.go b/cdproto.go index ba5ea53..71deab4 100644 --- a/cdproto.go +++ b/cdproto.go @@ -353,7 +353,7 @@ const ( CommandFedCmEnable = fedcm.CommandEnable CommandFedCmDisable = fedcm.CommandDisable CommandFedCmSelectAccount = fedcm.CommandSelectAccount - CommandFedCmClickDialogButton = fedcm.CommandClickDialogButton + CommandFedCmConfirmIdpLogin = fedcm.CommandConfirmIdpLogin CommandFedCmDismissDialog = fedcm.CommandDismissDialog CommandFedCmResetCooldown = fedcm.CommandResetCooldown EventFedCmDialogShown = "FedCm.dialogShown" @@ -1642,7 +1642,7 @@ func UnmarshalMessage(msg *Message) (interface{}, error) { case CommandFedCmSelectAccount: return emptyVal, nil - case CommandFedCmClickDialogButton: + case CommandFedCmConfirmIdpLogin: return emptyVal, nil case CommandFedCmDismissDialog: diff --git a/fedcm/easyjson.go b/fedcm/easyjson.go index 5be7c9c..2bf03cb 100644 --- a/fedcm/easyjson.go +++ b/fedcm/easyjson.go @@ -486,7 +486,7 @@ func (v *DisableParams) UnmarshalJSON(data []byte) error { func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm5(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm6(in *jlexer.Lexer, out *ClickDialogButtonParams) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm6(in *jlexer.Lexer, out *ConfirmIdpLoginParams) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -507,8 +507,6 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm6(in *jlexer.Lexer, out switch key { case "dialogId": out.DialogID = string(in.String()) - case "dialogButton": - (out.DialogButton).UnmarshalEasyJSON(in) default: in.SkipRecursive() } @@ -519,7 +517,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm6(in *jlexer.Lexer, out in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm6(out *jwriter.Writer, in ClickDialogButtonParams) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm6(out *jwriter.Writer, in ConfirmIdpLoginParams) { out.RawByte('{') first := true _ = first @@ -528,35 +526,30 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm6(out *jwriter.Writer, i out.RawString(prefix[1:]) out.String(string(in.DialogID)) } - { - const prefix string = ",\"dialogButton\":" - out.RawString(prefix) - (in.DialogButton).MarshalEasyJSON(out) - } out.RawByte('}') } // MarshalJSON supports json.Marshaler interface -func (v ClickDialogButtonParams) MarshalJSON() ([]byte, error) { +func (v ConfirmIdpLoginParams) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm6(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface -func (v ClickDialogButtonParams) MarshalEasyJSON(w *jwriter.Writer) { +func (v ConfirmIdpLoginParams) MarshalEasyJSON(w *jwriter.Writer) { easyjsonC5a4559bEncodeGithubComChromedpCdprotoFedcm6(w, v) } // UnmarshalJSON supports json.Unmarshaler interface -func (v *ClickDialogButtonParams) UnmarshalJSON(data []byte) error { +func (v *ConfirmIdpLoginParams) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm6(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *ClickDialogButtonParams) UnmarshalEasyJSON(l *jlexer.Lexer) { +func (v *ConfirmIdpLoginParams) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm6(l, v) } func easyjsonC5a4559bDecodeGithubComChromedpCdprotoFedcm7(in *jlexer.Lexer, out *Account) { diff --git a/fedcm/fedcm.go b/fedcm/fedcm.go index 4c8c366..fdd9e1f 100644 --- a/fedcm/fedcm.go +++ b/fedcm/fedcm.go @@ -82,30 +82,29 @@ func (p *SelectAccountParams) Do(ctx context.Context) (err error) { return cdp.Execute(ctx, CommandSelectAccount, p, nil) } -// ClickDialogButtonParams [no description]. -type ClickDialogButtonParams struct { - DialogID string `json:"dialogId"` - DialogButton DialogButton `json:"dialogButton"` +// ConfirmIdpLoginParams only valid if the dialog type is ConfirmIdpLogin. +// Acts as if the user had clicked the continue button. +type ConfirmIdpLoginParams struct { + DialogID string `json:"dialogId"` } -// ClickDialogButton [no description]. +// ConfirmIdpLogin only valid if the dialog type is ConfirmIdpLogin. Acts as +// if the user had clicked the continue button. // -// See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#method-clickDialogButton +// See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#method-confirmIdpLogin // // parameters: // // dialogID -// dialogButton -func ClickDialogButton(dialogID string, dialogButton DialogButton) *ClickDialogButtonParams { - return &ClickDialogButtonParams{ - DialogID: dialogID, - DialogButton: dialogButton, +func ConfirmIdpLogin(dialogID string) *ConfirmIdpLoginParams { + return &ConfirmIdpLoginParams{ + DialogID: dialogID, } } -// Do executes FedCm.clickDialogButton against the provided context. -func (p *ClickDialogButtonParams) Do(ctx context.Context) (err error) { - return cdp.Execute(ctx, CommandClickDialogButton, p, nil) +// Do executes FedCm.confirmIdpLogin against the provided context. +func (p *ConfirmIdpLoginParams) Do(ctx context.Context) (err error) { + return cdp.Execute(ctx, CommandConfirmIdpLogin, p, nil) } // DismissDialogParams [no description]. @@ -157,10 +156,10 @@ func (p *ResetCooldownParams) Do(ctx context.Context) (err error) { // Command names. const ( - CommandEnable = "FedCm.enable" - CommandDisable = "FedCm.disable" - CommandSelectAccount = "FedCm.selectAccount" - CommandClickDialogButton = "FedCm.clickDialogButton" - CommandDismissDialog = "FedCm.dismissDialog" - CommandResetCooldown = "FedCm.resetCooldown" + CommandEnable = "FedCm.enable" + CommandDisable = "FedCm.disable" + CommandSelectAccount = "FedCm.selectAccount" + CommandConfirmIdpLogin = "FedCm.confirmIdpLogin" + CommandDismissDialog = "FedCm.dismissDialog" + CommandResetCooldown = "FedCm.resetCooldown" ) diff --git a/fedcm/types.go b/fedcm/types.go index a5ed1f2..d0251a1 100644 --- a/fedcm/types.go +++ b/fedcm/types.go @@ -56,7 +56,8 @@ func (t *LoginState) UnmarshalJSON(buf []byte) error { return easyjson.Unmarshal(buf, t) } -// DialogType the types of FedCM dialogs. +// DialogType whether the dialog shown is an account chooser or an auto +// re-authentication dialog. // // See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-DialogType type DialogType string @@ -104,48 +105,6 @@ func (t *DialogType) UnmarshalJSON(buf []byte) error { return easyjson.Unmarshal(buf, t) } -// DialogButton the buttons on the FedCM dialog. -// -// See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-DialogButton -type DialogButton string - -// String returns the DialogButton as string value. -func (t DialogButton) String() string { - return string(t) -} - -// DialogButton values. -const ( - DialogButtonConfirmIdpLoginContinue DialogButton = "ConfirmIdpLoginContinue" -) - -// MarshalEasyJSON satisfies easyjson.Marshaler. -func (t DialogButton) MarshalEasyJSON(out *jwriter.Writer) { - out.String(string(t)) -} - -// MarshalJSON satisfies json.Marshaler. -func (t DialogButton) MarshalJSON() ([]byte, error) { - return easyjson.Marshal(t) -} - -// UnmarshalEasyJSON satisfies easyjson.Unmarshaler. -func (t *DialogButton) UnmarshalEasyJSON(in *jlexer.Lexer) { - v := in.String() - switch DialogButton(v) { - case DialogButtonConfirmIdpLoginContinue: - *t = DialogButtonConfirmIdpLoginContinue - - default: - in.AddError(fmt.Errorf("unknown DialogButton value: %v", v)) - } -} - -// UnmarshalJSON satisfies json.Unmarshaler. -func (t *DialogButton) UnmarshalJSON(buf []byte) error { - return easyjson.Unmarshal(buf, t) -} - // Account corresponds to IdentityRequestAccount. // // See: https://chromedevtools.github.io/devtools-protocol/tot/FedCm#type-Account diff --git a/page/types.go b/page/types.go index aee7d9c..c708fd0 100644 --- a/page/types.go +++ b/page/types.go @@ -111,7 +111,6 @@ const ( PermissionsPolicyFeatureUnload PermissionsPolicyFeature = "unload" PermissionsPolicyFeatureUsb PermissionsPolicyFeature = "usb" PermissionsPolicyFeatureVerticalScroll PermissionsPolicyFeature = "vertical-scroll" - PermissionsPolicyFeatureWebPrinting PermissionsPolicyFeature = "web-printing" PermissionsPolicyFeatureWebShare PermissionsPolicyFeature = "web-share" PermissionsPolicyFeatureWindowManagement PermissionsPolicyFeature = "window-management" PermissionsPolicyFeatureWindowPlacement PermissionsPolicyFeature = "window-placement" @@ -282,8 +281,6 @@ func (t *PermissionsPolicyFeature) UnmarshalEasyJSON(in *jlexer.Lexer) { *t = PermissionsPolicyFeatureUsb case PermissionsPolicyFeatureVerticalScroll: *t = PermissionsPolicyFeatureVerticalScroll - case PermissionsPolicyFeatureWebPrinting: - *t = PermissionsPolicyFeatureWebPrinting case PermissionsPolicyFeatureWebShare: *t = PermissionsPolicyFeatureWebShare case PermissionsPolicyFeatureWindowManagement: diff --git a/preload/easyjson.go b/preload/easyjson.go index f295f30..6affaaf 100644 --- a/preload/easyjson.go +++ b/preload/easyjson.go @@ -127,87 +127,7 @@ func (v *RuleSet) UnmarshalJSON(data []byte) error { func (v *RuleSet) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload1(in *jlexer.Lexer, out *PrerenderMismatchedHeaders) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "headerName": - out.HeaderName = string(in.String()) - case "initialValue": - out.InitialValue = string(in.String()) - case "activationValue": - out.ActivationValue = string(in.String()) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload1(out *jwriter.Writer, in PrerenderMismatchedHeaders) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"headerName\":" - out.RawString(prefix[1:]) - out.String(string(in.HeaderName)) - } - if in.InitialValue != "" { - const prefix string = ",\"initialValue\":" - out.RawString(prefix) - out.String(string(in.InitialValue)) - } - if in.ActivationValue != "" { - const prefix string = ",\"activationValue\":" - out.RawString(prefix) - out.String(string(in.ActivationValue)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v PrerenderMismatchedHeaders) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload1(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v PrerenderMismatchedHeaders) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload1(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *PrerenderMismatchedHeaders) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload1(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *PrerenderMismatchedHeaders) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload1(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(in *jlexer.Lexer, out *IngAttemptSource) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload1(in *jlexer.Lexer, out *IngAttemptSource) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -292,7 +212,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(in *jlexer.Lexer, ou in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(out *jwriter.Writer, in IngAttemptSource) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload1(out *jwriter.Writer, in IngAttemptSource) { out.RawByte('{') first := true _ = first @@ -343,27 +263,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v IngAttemptSource) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload1(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v IngAttemptSource) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload1(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *IngAttemptSource) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload1(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *IngAttemptSource) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload1(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(in *jlexer.Lexer, out *IngAttemptKey) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(in *jlexer.Lexer, out *IngAttemptKey) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -400,7 +320,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(in *jlexer.Lexer, ou in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(out *jwriter.Writer, in IngAttemptKey) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(out *jwriter.Writer, in IngAttemptKey) { out.RawByte('{') first := true _ = first @@ -430,27 +350,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v IngAttemptKey) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v IngAttemptKey) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *IngAttemptKey) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *IngAttemptKey) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(in *jlexer.Lexer, out *EventRuleSetUpdated) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(in *jlexer.Lexer, out *EventRuleSetUpdated) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -489,7 +409,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(in *jlexer.Lexer, ou in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(out *jwriter.Writer, in EventRuleSetUpdated) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(out *jwriter.Writer, in EventRuleSetUpdated) { out.RawByte('{') first := true _ = first @@ -508,27 +428,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v EventRuleSetUpdated) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v EventRuleSetUpdated) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *EventRuleSetUpdated) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *EventRuleSetUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(in *jlexer.Lexer, out *EventRuleSetRemoved) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(in *jlexer.Lexer, out *EventRuleSetRemoved) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -559,7 +479,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(in *jlexer.Lexer, ou in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(out *jwriter.Writer, in EventRuleSetRemoved) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(out *jwriter.Writer, in EventRuleSetRemoved) { out.RawByte('{') first := true _ = first @@ -574,27 +494,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v EventRuleSetRemoved) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v EventRuleSetRemoved) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *EventRuleSetRemoved) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *EventRuleSetRemoved) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(in *jlexer.Lexer, out *EventPrerenderStatusUpdated) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(in *jlexer.Lexer, out *EventPrerenderStatusUpdated) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -629,37 +549,6 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(in *jlexer.Lexer, ou (out.PrerenderStatus).UnmarshalEasyJSON(in) case "disallowedMojoInterface": out.DisallowedMojoInterface = string(in.String()) - case "mismatchedHeaders": - if in.IsNull() { - in.Skip() - out.MismatchedHeaders = nil - } else { - in.Delim('[') - if out.MismatchedHeaders == nil { - if !in.IsDelim(']') { - out.MismatchedHeaders = make([]*PrerenderMismatchedHeaders, 0, 8) - } else { - out.MismatchedHeaders = []*PrerenderMismatchedHeaders{} - } - } else { - out.MismatchedHeaders = (out.MismatchedHeaders)[:0] - } - for !in.IsDelim(']') { - var v7 *PrerenderMismatchedHeaders - if in.IsNull() { - in.Skip() - v7 = nil - } else { - if v7 == nil { - v7 = new(PrerenderMismatchedHeaders) - } - (*v7).UnmarshalEasyJSON(in) - } - out.MismatchedHeaders = append(out.MismatchedHeaders, v7) - in.WantComma() - } - in.Delim(']') - } default: in.SkipRecursive() } @@ -670,7 +559,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(in *jlexer.Lexer, ou in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(out *jwriter.Writer, in EventPrerenderStatusUpdated) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(out *jwriter.Writer, in EventPrerenderStatusUpdated) { out.RawByte('{') first := true _ = first @@ -698,51 +587,33 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(out *jwriter.Writer, out.RawString(prefix) out.String(string(in.DisallowedMojoInterface)) } - if len(in.MismatchedHeaders) != 0 { - const prefix string = ",\"mismatchedHeaders\":" - out.RawString(prefix) - { - out.RawByte('[') - for v8, v9 := range in.MismatchedHeaders { - if v8 > 0 { - out.RawByte(',') - } - if v9 == nil { - out.RawString("null") - } else { - (*v9).MarshalEasyJSON(out) - } - } - out.RawByte(']') - } - } out.RawByte('}') } // MarshalJSON supports json.Marshaler interface func (v EventPrerenderStatusUpdated) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v EventPrerenderStatusUpdated) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *EventPrerenderStatusUpdated) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *EventPrerenderStatusUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(in *jlexer.Lexer, out *EventPreloadingAttemptSourcesUpdated) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(in *jlexer.Lexer, out *EventPreloadingAttemptSourcesUpdated) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -779,17 +650,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(in *jlexer.Lexer, ou out.PreloadingAttemptSources = (out.PreloadingAttemptSources)[:0] } for !in.IsDelim(']') { - var v10 *IngAttemptSource + var v7 *IngAttemptSource if in.IsNull() { in.Skip() - v10 = nil + v7 = nil } else { - if v10 == nil { - v10 = new(IngAttemptSource) + if v7 == nil { + v7 = new(IngAttemptSource) } - (*v10).UnmarshalEasyJSON(in) + (*v7).UnmarshalEasyJSON(in) } - out.PreloadingAttemptSources = append(out.PreloadingAttemptSources, v10) + out.PreloadingAttemptSources = append(out.PreloadingAttemptSources, v7) in.WantComma() } in.Delim(']') @@ -804,7 +675,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(in *jlexer.Lexer, ou in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(out *jwriter.Writer, in EventPreloadingAttemptSourcesUpdated) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(out *jwriter.Writer, in EventPreloadingAttemptSourcesUpdated) { out.RawByte('{') first := true _ = first @@ -820,14 +691,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(out *jwriter.Writer, out.RawString("null") } else { out.RawByte('[') - for v11, v12 := range in.PreloadingAttemptSources { - if v11 > 0 { + for v8, v9 := range in.PreloadingAttemptSources { + if v8 > 0 { out.RawByte(',') } - if v12 == nil { + if v9 == nil { out.RawString("null") } else { - (*v12).MarshalEasyJSON(out) + (*v9).MarshalEasyJSON(out) } } out.RawByte(']') @@ -839,27 +710,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v EventPreloadingAttemptSourcesUpdated) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v EventPreloadingAttemptSourcesUpdated) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *EventPreloadingAttemptSourcesUpdated) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *EventPreloadingAttemptSourcesUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(in *jlexer.Lexer, out *EventPreloadEnabledStateUpdated) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(in *jlexer.Lexer, out *EventPreloadEnabledStateUpdated) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -898,7 +769,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(in *jlexer.Lexer, ou in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(out *jwriter.Writer, in EventPreloadEnabledStateUpdated) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(out *jwriter.Writer, in EventPreloadEnabledStateUpdated) { out.RawByte('{') first := true _ = first @@ -933,27 +804,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v EventPreloadEnabledStateUpdated) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v EventPreloadEnabledStateUpdated) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *EventPreloadEnabledStateUpdated) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *EventPreloadEnabledStateUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(in *jlexer.Lexer, out *EventPrefetchStatusUpdated) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(in *jlexer.Lexer, out *EventPrefetchStatusUpdated) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1002,7 +873,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(in *jlexer.Lexer, ou in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(out *jwriter.Writer, in EventPrefetchStatusUpdated) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(out *jwriter.Writer, in EventPrefetchStatusUpdated) { out.RawByte('{') first := true _ = first @@ -1046,27 +917,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v EventPrefetchStatusUpdated) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v EventPrefetchStatusUpdated) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *EventPrefetchStatusUpdated) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *EventPrefetchStatusUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(in *jlexer.Lexer, out *EnableParams) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(in *jlexer.Lexer, out *EnableParams) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1095,7 +966,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(in *jlexer.Lexer, o in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(out *jwriter.Writer, in EnableParams) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(out *jwriter.Writer, in EnableParams) { out.RawByte('{') first := true _ = first @@ -1105,27 +976,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(out *jwriter.Writer // MarshalJSON supports json.Marshaler interface func (v EnableParams) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *EnableParams) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload11(in *jlexer.Lexer, out *DisableParams) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(in *jlexer.Lexer, out *DisableParams) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1154,7 +1025,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload11(in *jlexer.Lexer, o in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload11(out *jwriter.Writer, in DisableParams) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(out *jwriter.Writer, in DisableParams) { out.RawByte('{') first := true _ = first @@ -1164,23 +1035,23 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload11(out *jwriter.Writer // MarshalJSON supports json.Marshaler interface func (v DisableParams) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload11(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload11(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *DisableParams) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload11(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload11(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(l, v) } diff --git a/preload/events.go b/preload/events.go index e630060..ff84efb 100644 --- a/preload/events.go +++ b/preload/events.go @@ -50,11 +50,10 @@ type EventPrefetchStatusUpdated struct { // // See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#event-prerenderStatusUpdated type EventPrerenderStatusUpdated struct { - Key *IngAttemptKey `json:"key"` - Status IngStatus `json:"status"` - PrerenderStatus PrerenderFinalStatus `json:"prerenderStatus,omitempty"` - DisallowedMojoInterface string `json:"disallowedMojoInterface,omitempty"` // This is used to give users more information about the name of Mojo interface that is incompatible with prerender and has caused the cancellation of the attempt. - MismatchedHeaders []*PrerenderMismatchedHeaders `json:"mismatchedHeaders,omitempty"` + Key *IngAttemptKey `json:"key"` + Status IngStatus `json:"status"` + PrerenderStatus PrerenderFinalStatus `json:"prerenderStatus,omitempty"` + DisallowedMojoInterface string `json:"disallowedMojoInterface,omitempty"` // This is used to give users more information about the name of Mojo interface that is incompatible with prerender and has caused the cancellation of the attempt. } // EventPreloadingAttemptSourcesUpdated send a list of sources for all diff --git a/preload/types.go b/preload/types.go index 003852f..c5b3b1f 100644 --- a/preload/types.go +++ b/preload/types.go @@ -622,13 +622,3 @@ func (t *PrefetchStatus) UnmarshalEasyJSON(in *jlexer.Lexer) { func (t *PrefetchStatus) UnmarshalJSON(buf []byte) error { return easyjson.Unmarshal(buf, t) } - -// PrerenderMismatchedHeaders information of headers to be displayed when the -// header mismatch occurred. -// -// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-PrerenderMismatchedHeaders -type PrerenderMismatchedHeaders struct { - HeaderName string `json:"headerName"` - InitialValue string `json:"initialValue,omitempty"` - ActivationValue string `json:"activationValue,omitempty"` -} diff --git a/serviceworker/easyjson.go b/serviceworker/easyjson.go index e7b6b6d..6863c36 100644 --- a/serviceworker/easyjson.go +++ b/serviceworker/easyjson.go @@ -76,8 +76,6 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoServiceworker(in *jlexer.Lexe } case "targetId": out.TargetID = target.ID(in.String()) - case "routerRules": - out.RouterRules = string(in.String()) default: in.SkipRecursive() } @@ -146,11 +144,6 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoServiceworker(out *jwriter.Wr out.RawString(prefix) out.String(string(in.TargetID)) } - if in.RouterRules != "" { - const prefix string = ",\"routerRules\":" - out.RawString(prefix) - out.String(string(in.RouterRules)) - } out.RawByte('}') } diff --git a/serviceworker/types.go b/serviceworker/types.go index f765259..bc77f61 100644 --- a/serviceworker/types.go +++ b/serviceworker/types.go @@ -151,7 +151,6 @@ type Version struct { ScriptResponseTime float64 `json:"scriptResponseTime,omitempty"` // The time at which the response headers of the main script were received from the server. For cached script it is the last time the cache entry was validated. ControlledClients []target.ID `json:"controlledClients,omitempty"` TargetID target.ID `json:"targetId,omitempty"` - RouterRules string `json:"routerRules,omitempty"` } // ErrorMessage serviceWorker error message. diff --git a/storage/easyjson.go b/storage/easyjson.go index feceb5b..541e829 100644 --- a/storage/easyjson.go +++ b/storage/easyjson.go @@ -5113,124 +5113,7 @@ func (v *Bucket) UnmarshalJSON(data []byte) error { func (v *Bucket) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage60(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage61(in *jlexer.Lexer, out *AttributionReportingTriggerSpec) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "triggerData": - if in.IsNull() { - in.Skip() - out.TriggerData = nil - } else { - in.Delim('[') - if out.TriggerData == nil { - if !in.IsDelim(']') { - out.TriggerData = make([]float64, 0, 8) - } else { - out.TriggerData = []float64{} - } - } else { - out.TriggerData = (out.TriggerData)[:0] - } - for !in.IsDelim(']') { - var v34 float64 - v34 = float64(in.Float64()) - out.TriggerData = append(out.TriggerData, v34) - in.WantComma() - } - in.Delim(']') - } - case "eventReportWindows": - if in.IsNull() { - in.Skip() - out.EventReportWindows = nil - } else { - if out.EventReportWindows == nil { - out.EventReportWindows = new(AttributionReportingEventReportWindows) - } - (*out.EventReportWindows).UnmarshalEasyJSON(in) - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage61(out *jwriter.Writer, in AttributionReportingTriggerSpec) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"triggerData\":" - out.RawString(prefix[1:]) - if in.TriggerData == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { - out.RawString("null") - } else { - out.RawByte('[') - for v35, v36 := range in.TriggerData { - if v35 > 0 { - out.RawByte(',') - } - out.Float64(float64(v36)) - } - out.RawByte(']') - } - } - { - const prefix string = ",\"eventReportWindows\":" - out.RawString(prefix) - if in.EventReportWindows == nil { - out.RawString("null") - } else { - (*in.EventReportWindows).MarshalEasyJSON(out) - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v AttributionReportingTriggerSpec) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage61(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v AttributionReportingTriggerSpec) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage61(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *AttributionReportingTriggerSpec) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage61(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *AttributionReportingTriggerSpec) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage61(l, v) -} -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(in *jlexer.Lexer, out *AttributionReportingSourceRegistration) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage61(in *jlexer.Lexer, out *AttributionReportingSourceRegistration) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5261,36 +5144,15 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(in *jlexer.Lexer, o } case "expiry": out.Expiry = int64(in.Int64()) - case "triggerSpecs": + case "eventReportWindows": if in.IsNull() { in.Skip() - out.TriggerSpecs = nil + out.EventReportWindows = nil } else { - in.Delim('[') - if out.TriggerSpecs == nil { - if !in.IsDelim(']') { - out.TriggerSpecs = make([]*AttributionReportingTriggerSpec, 0, 8) - } else { - out.TriggerSpecs = []*AttributionReportingTriggerSpec{} - } - } else { - out.TriggerSpecs = (out.TriggerSpecs)[:0] - } - for !in.IsDelim(']') { - var v37 *AttributionReportingTriggerSpec - if in.IsNull() { - in.Skip() - v37 = nil - } else { - if v37 == nil { - v37 = new(AttributionReportingTriggerSpec) - } - (*v37).UnmarshalEasyJSON(in) - } - out.TriggerSpecs = append(out.TriggerSpecs, v37) - in.WantComma() + if out.EventReportWindows == nil { + out.EventReportWindows = new(AttributionReportingEventReportWindows) } - in.Delim(']') + (*out.EventReportWindows).UnmarshalEasyJSON(in) } case "aggregatableReportWindow": out.AggregatableReportWindow = int64(in.Int64()) @@ -5316,9 +5178,9 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(in *jlexer.Lexer, o out.DestinationSites = (out.DestinationSites)[:0] } for !in.IsDelim(']') { - var v38 string - v38 = string(in.String()) - out.DestinationSites = append(out.DestinationSites, v38) + var v34 string + v34 = string(in.String()) + out.DestinationSites = append(out.DestinationSites, v34) in.WantComma() } in.Delim(']') @@ -5343,17 +5205,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(in *jlexer.Lexer, o out.FilterData = (out.FilterData)[:0] } for !in.IsDelim(']') { - var v39 *AttributionReportingFilterDataEntry + var v35 *AttributionReportingFilterDataEntry if in.IsNull() { in.Skip() - v39 = nil + v35 = nil } else { - if v39 == nil { - v39 = new(AttributionReportingFilterDataEntry) + if v35 == nil { + v35 = new(AttributionReportingFilterDataEntry) } - (*v39).UnmarshalEasyJSON(in) + (*v35).UnmarshalEasyJSON(in) } - out.FilterData = append(out.FilterData, v39) + out.FilterData = append(out.FilterData, v35) in.WantComma() } in.Delim(']') @@ -5374,17 +5236,17 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(in *jlexer.Lexer, o out.AggregationKeys = (out.AggregationKeys)[:0] } for !in.IsDelim(']') { - var v40 *AttributionReportingAggregationKeysEntry + var v36 *AttributionReportingAggregationKeysEntry if in.IsNull() { in.Skip() - v40 = nil + v36 = nil } else { - if v40 == nil { - v40 = new(AttributionReportingAggregationKeysEntry) + if v36 == nil { + v36 = new(AttributionReportingAggregationKeysEntry) } - (*v40).UnmarshalEasyJSON(in) + (*v36).UnmarshalEasyJSON(in) } - out.AggregationKeys = append(out.AggregationKeys, v40) + out.AggregationKeys = append(out.AggregationKeys, v36) in.WantComma() } in.Delim(']') @@ -5403,7 +5265,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(in *jlexer.Lexer, o in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(out *jwriter.Writer, in AttributionReportingSourceRegistration) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage61(out *jwriter.Writer, in AttributionReportingSourceRegistration) { out.RawByte('{') first := true _ = first @@ -5422,23 +5284,12 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(out *jwriter.Writer out.Int64(int64(in.Expiry)) } { - const prefix string = ",\"triggerSpecs\":" + const prefix string = ",\"eventReportWindows\":" out.RawString(prefix) - if in.TriggerSpecs == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + if in.EventReportWindows == nil { out.RawString("null") } else { - out.RawByte('[') - for v41, v42 := range in.TriggerSpecs { - if v41 > 0 { - out.RawByte(',') - } - if v42 == nil { - out.RawString("null") - } else { - (*v42).MarshalEasyJSON(out) - } - } - out.RawByte(']') + (*in.EventReportWindows).MarshalEasyJSON(out) } } { @@ -5468,11 +5319,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(out *jwriter.Writer out.RawString("null") } else { out.RawByte('[') - for v43, v44 := range in.DestinationSites { - if v43 > 0 { + for v37, v38 := range in.DestinationSites { + if v37 > 0 { out.RawByte(',') } - out.String(string(v44)) + out.String(string(v38)) } out.RawByte(']') } @@ -5494,14 +5345,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(out *jwriter.Writer out.RawString("null") } else { out.RawByte('[') - for v45, v46 := range in.FilterData { - if v45 > 0 { + for v39, v40 := range in.FilterData { + if v39 > 0 { out.RawByte(',') } - if v46 == nil { + if v40 == nil { out.RawString("null") } else { - (*v46).MarshalEasyJSON(out) + (*v40).MarshalEasyJSON(out) } } out.RawByte(']') @@ -5514,14 +5365,14 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(out *jwriter.Writer out.RawString("null") } else { out.RawByte('[') - for v47, v48 := range in.AggregationKeys { - if v47 > 0 { + for v41, v42 := range in.AggregationKeys { + if v41 > 0 { out.RawByte(',') } - if v48 == nil { + if v42 == nil { out.RawString("null") } else { - (*v48).MarshalEasyJSON(out) + (*v42).MarshalEasyJSON(out) } } out.RawByte(']') @@ -5543,27 +5394,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(out *jwriter.Writer // MarshalJSON supports json.Marshaler interface func (v AttributionReportingSourceRegistration) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage61(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v AttributionReportingSourceRegistration) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage61(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *AttributionReportingSourceRegistration) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage61(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *AttributionReportingSourceRegistration) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage61(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage63(in *jlexer.Lexer, out *AttributionReportingFilterDataEntry) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(in *jlexer.Lexer, out *AttributionReportingFilterDataEntry) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5600,9 +5451,9 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage63(in *jlexer.Lexer, o out.Values = (out.Values)[:0] } for !in.IsDelim(']') { - var v49 string - v49 = string(in.String()) - out.Values = append(out.Values, v49) + var v43 string + v43 = string(in.String()) + out.Values = append(out.Values, v43) in.WantComma() } in.Delim(']') @@ -5617,7 +5468,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage63(in *jlexer.Lexer, o in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage63(out *jwriter.Writer, in AttributionReportingFilterDataEntry) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(out *jwriter.Writer, in AttributionReportingFilterDataEntry) { out.RawByte('{') first := true _ = first @@ -5633,11 +5484,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage63(out *jwriter.Writer out.RawString("null") } else { out.RawByte('[') - for v50, v51 := range in.Values { - if v50 > 0 { + for v44, v45 := range in.Values { + if v44 > 0 { out.RawByte(',') } - out.String(string(v51)) + out.String(string(v45)) } out.RawByte(']') } @@ -5648,27 +5499,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage63(out *jwriter.Writer // MarshalJSON supports json.Marshaler interface func (v AttributionReportingFilterDataEntry) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage63(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v AttributionReportingFilterDataEntry) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage63(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage62(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *AttributionReportingFilterDataEntry) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage63(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *AttributionReportingFilterDataEntry) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage63(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage62(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage64(in *jlexer.Lexer, out *AttributionReportingEventReportWindows) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage63(in *jlexer.Lexer, out *AttributionReportingEventReportWindows) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5705,9 +5556,9 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage64(in *jlexer.Lexer, o out.Ends = (out.Ends)[:0] } for !in.IsDelim(']') { - var v52 int64 - v52 = int64(in.Int64()) - out.Ends = append(out.Ends, v52) + var v46 int64 + v46 = int64(in.Int64()) + out.Ends = append(out.Ends, v46) in.WantComma() } in.Delim(']') @@ -5722,7 +5573,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage64(in *jlexer.Lexer, o in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage64(out *jwriter.Writer, in AttributionReportingEventReportWindows) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage63(out *jwriter.Writer, in AttributionReportingEventReportWindows) { out.RawByte('{') first := true _ = first @@ -5738,11 +5589,11 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage64(out *jwriter.Writer out.RawString("null") } else { out.RawByte('[') - for v53, v54 := range in.Ends { - if v53 > 0 { + for v47, v48 := range in.Ends { + if v47 > 0 { out.RawByte(',') } - out.Int64(int64(v54)) + out.Int64(int64(v48)) } out.RawByte(']') } @@ -5753,27 +5604,27 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage64(out *jwriter.Writer // MarshalJSON supports json.Marshaler interface func (v AttributionReportingEventReportWindows) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage64(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage63(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v AttributionReportingEventReportWindows) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage64(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage63(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *AttributionReportingEventReportWindows) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage64(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage63(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *AttributionReportingEventReportWindows) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage64(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage63(l, v) } -func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage65(in *jlexer.Lexer, out *AttributionReportingAggregationKeysEntry) { +func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage64(in *jlexer.Lexer, out *AttributionReportingAggregationKeysEntry) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5806,7 +5657,7 @@ func easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage65(in *jlexer.Lexer, o in.Consumed() } } -func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage65(out *jwriter.Writer, in AttributionReportingAggregationKeysEntry) { +func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage64(out *jwriter.Writer, in AttributionReportingAggregationKeysEntry) { out.RawByte('{') first := true _ = first @@ -5826,23 +5677,23 @@ func easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage65(out *jwriter.Writer // MarshalJSON supports json.Marshaler interface func (v AttributionReportingAggregationKeysEntry) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage65(&w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage64(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v AttributionReportingAggregationKeysEntry) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage65(w, v) + easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage64(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *AttributionReportingAggregationKeysEntry) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage65(&r, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage64(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *AttributionReportingAggregationKeysEntry) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage65(l, v) + easyjsonC5a4559bDecodeGithubComChromedpCdprotoStorage64(l, v) } diff --git a/storage/types.go b/storage/types.go index ef5622c..fb56380 100644 --- a/storage/types.go +++ b/storage/types.go @@ -512,14 +512,6 @@ type AttributionReportingEventReportWindows struct { Ends []int64 `json:"ends"` // duration in seconds } -// AttributionReportingTriggerSpec [no description]. -// -// See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#type-AttributionReportingTriggerSpec -type AttributionReportingTriggerSpec struct { - TriggerData []float64 `json:"triggerData"` // number instead of integer because not all uint32 can be represented by int - EventReportWindows *AttributionReportingEventReportWindows `json:"eventReportWindows"` -} - // AttributionReportingTriggerDataMatching [no description]. // // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#type-AttributionReportingTriggerDataMatching @@ -571,7 +563,7 @@ func (t *AttributionReportingTriggerDataMatching) UnmarshalJSON(buf []byte) erro type AttributionReportingSourceRegistration struct { Time *cdp.TimeSinceEpoch `json:"time"` Expiry int64 `json:"expiry"` // duration in seconds - TriggerSpecs []*AttributionReportingTriggerSpec `json:"triggerSpecs"` + EventReportWindows *AttributionReportingEventReportWindows `json:"eventReportWindows"` AggregatableReportWindow int64 `json:"aggregatableReportWindow"` // duration in seconds Type AttributionReportingSourceType `json:"type"` SourceOrigin string `json:"sourceOrigin"`