-
Notifications
You must be signed in to change notification settings - Fork 54
/
types.go
624 lines (568 loc) · 33 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
package preload
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"fmt"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/network"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
)
// RuleSetID unique id.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-RuleSetId
type RuleSetID string
// String returns the RuleSetID as string value.
func (t RuleSetID) String() string {
return string(t)
}
// RuleSet corresponds to SpeculationRuleSet.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-RuleSet
type RuleSet struct {
ID RuleSetID `json:"id"`
LoaderID cdp.LoaderID `json:"loaderId"` // Identifies a document which the rule set is associated with.
SourceText string `json:"sourceText"` // Source text of JSON representing the rule set. If it comes from <script> tag, it is the textContent of the node. Note that it is a JSON for valid case. See also: - https://wicg.github.io/nav-speculation/speculation-rules.html - https://github.com/WICG/nav-speculation/blob/main/triggers.md
BackendNodeID cdp.BackendNodeID `json:"backendNodeId,omitempty"` // A speculation rule set is either added through an inline <script> tag or through an external resource via the 'Speculation-Rules' HTTP header. For the first case, we include the BackendNodeId of the relevant <script> tag. For the second case, we include the external URL where the rule set was loaded from, and also RequestId if Network domain is enabled. See also: - https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-script - https://wicg.github.io/nav-speculation/speculation-rules.html#speculation-rules-header
URL string `json:"url,omitempty"`
RequestID network.RequestID `json:"requestId,omitempty"`
ErrorType RuleSetErrorType `json:"errorType,omitempty"` // Error information errorMessage is null iff errorType is null.
}
// RuleSetErrorType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-RuleSetErrorType
type RuleSetErrorType string
// String returns the RuleSetErrorType as string value.
func (t RuleSetErrorType) String() string {
return string(t)
}
// RuleSetErrorType values.
const (
RuleSetErrorTypeSourceIsNotJSONObject RuleSetErrorType = "SourceIsNotJsonObject"
RuleSetErrorTypeInvalidRulesSkipped RuleSetErrorType = "InvalidRulesSkipped"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t RuleSetErrorType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t RuleSetErrorType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *RuleSetErrorType) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch RuleSetErrorType(v) {
case RuleSetErrorTypeSourceIsNotJSONObject:
*t = RuleSetErrorTypeSourceIsNotJSONObject
case RuleSetErrorTypeInvalidRulesSkipped:
*t = RuleSetErrorTypeInvalidRulesSkipped
default:
in.AddError(fmt.Errorf("unknown RuleSetErrorType value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *RuleSetErrorType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// SpeculationAction the type of preloading attempted. It corresponds to
// mojom::SpeculationAction (although PrefetchWithSubresources is omitted as it
// isn't being used by clients).
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-SpeculationAction
type SpeculationAction string
// String returns the SpeculationAction as string value.
func (t SpeculationAction) String() string {
return string(t)
}
// SpeculationAction values.
const (
SpeculationActionPrefetch SpeculationAction = "Prefetch"
SpeculationActionPrerender SpeculationAction = "Prerender"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t SpeculationAction) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t SpeculationAction) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *SpeculationAction) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch SpeculationAction(v) {
case SpeculationActionPrefetch:
*t = SpeculationActionPrefetch
case SpeculationActionPrerender:
*t = SpeculationActionPrerender
default:
in.AddError(fmt.Errorf("unknown SpeculationAction value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *SpeculationAction) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// SpeculationTargetHint corresponds to mojom::SpeculationTargetHint. See
// https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-SpeculationTargetHint
type SpeculationTargetHint string
// String returns the SpeculationTargetHint as string value.
func (t SpeculationTargetHint) String() string {
return string(t)
}
// SpeculationTargetHint values.
const (
SpeculationTargetHintBlank SpeculationTargetHint = "Blank"
SpeculationTargetHintSelf SpeculationTargetHint = "Self"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t SpeculationTargetHint) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t SpeculationTargetHint) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *SpeculationTargetHint) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch SpeculationTargetHint(v) {
case SpeculationTargetHintBlank:
*t = SpeculationTargetHintBlank
case SpeculationTargetHintSelf:
*t = SpeculationTargetHintSelf
default:
in.AddError(fmt.Errorf("unknown SpeculationTargetHint value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *SpeculationTargetHint) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// IngAttemptKey a key that identifies a preloading attempt. The url used is
// the url specified by the trigger (i.e. the initial URL), and not the final
// url that is navigated to. For example, prerendering allows same-origin main
// frame navigations during the attempt, but the attempt is still keyed with the
// initial URL.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-PreloadingAttemptKey
type IngAttemptKey struct {
LoaderID cdp.LoaderID `json:"loaderId"`
Action SpeculationAction `json:"action"`
URL string `json:"url"`
TargetHint SpeculationTargetHint `json:"targetHint,omitempty"`
}
// IngAttemptSource lists sources for a preloading attempt, specifically the
// ids of rule sets that had a speculation rule that triggered the attempt, and
// the BackendNodeIds of <a href> or <area href> elements that triggered the
// attempt (in the case of attempts triggered by a document rule). It is
// possible for multiple rule sets and links to trigger a single attempt.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-PreloadingAttemptSource
type IngAttemptSource struct {
Key *IngAttemptKey `json:"key"`
RuleSetIDs []RuleSetID `json:"ruleSetIds"`
NodeIDs []cdp.BackendNodeID `json:"nodeIds"`
}
// PrerenderFinalStatus list of FinalStatus reasons for Prerender2.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-PrerenderFinalStatus
type PrerenderFinalStatus string
// String returns the PrerenderFinalStatus as string value.
func (t PrerenderFinalStatus) String() string {
return string(t)
}
// PrerenderFinalStatus values.
const (
PrerenderFinalStatusActivated PrerenderFinalStatus = "Activated"
PrerenderFinalStatusDestroyed PrerenderFinalStatus = "Destroyed"
PrerenderFinalStatusLowEndDevice PrerenderFinalStatus = "LowEndDevice"
PrerenderFinalStatusInvalidSchemeRedirect PrerenderFinalStatus = "InvalidSchemeRedirect"
PrerenderFinalStatusInvalidSchemeNavigation PrerenderFinalStatus = "InvalidSchemeNavigation"
PrerenderFinalStatusNavigationRequestBlockedByCsp PrerenderFinalStatus = "NavigationRequestBlockedByCsp"
PrerenderFinalStatusMainFrameNavigation PrerenderFinalStatus = "MainFrameNavigation"
PrerenderFinalStatusMojoBinderPolicy PrerenderFinalStatus = "MojoBinderPolicy"
PrerenderFinalStatusRendererProcessCrashed PrerenderFinalStatus = "RendererProcessCrashed"
PrerenderFinalStatusRendererProcessKilled PrerenderFinalStatus = "RendererProcessKilled"
PrerenderFinalStatusDownload PrerenderFinalStatus = "Download"
PrerenderFinalStatusTriggerDestroyed PrerenderFinalStatus = "TriggerDestroyed"
PrerenderFinalStatusNavigationNotCommitted PrerenderFinalStatus = "NavigationNotCommitted"
PrerenderFinalStatusNavigationBadHTTPStatus PrerenderFinalStatus = "NavigationBadHttpStatus"
PrerenderFinalStatusClientCertRequested PrerenderFinalStatus = "ClientCertRequested"
PrerenderFinalStatusNavigationRequestNetworkError PrerenderFinalStatus = "NavigationRequestNetworkError"
PrerenderFinalStatusCancelAllHostsForTesting PrerenderFinalStatus = "CancelAllHostsForTesting"
PrerenderFinalStatusDidFailLoad PrerenderFinalStatus = "DidFailLoad"
PrerenderFinalStatusStop PrerenderFinalStatus = "Stop"
PrerenderFinalStatusSslCertificateError PrerenderFinalStatus = "SslCertificateError"
PrerenderFinalStatusLoginAuthRequested PrerenderFinalStatus = "LoginAuthRequested"
PrerenderFinalStatusUaChangeRequiresReload PrerenderFinalStatus = "UaChangeRequiresReload"
PrerenderFinalStatusBlockedByClient PrerenderFinalStatus = "BlockedByClient"
PrerenderFinalStatusAudioOutputDeviceRequested PrerenderFinalStatus = "AudioOutputDeviceRequested"
PrerenderFinalStatusMixedContent PrerenderFinalStatus = "MixedContent"
PrerenderFinalStatusTriggerBackgrounded PrerenderFinalStatus = "TriggerBackgrounded"
PrerenderFinalStatusMemoryLimitExceeded PrerenderFinalStatus = "MemoryLimitExceeded"
PrerenderFinalStatusDataSaverEnabled PrerenderFinalStatus = "DataSaverEnabled"
PrerenderFinalStatusTriggerURLHasEffectiveURL PrerenderFinalStatus = "TriggerUrlHasEffectiveUrl"
PrerenderFinalStatusActivatedBeforeStarted PrerenderFinalStatus = "ActivatedBeforeStarted"
PrerenderFinalStatusInactivePageRestriction PrerenderFinalStatus = "InactivePageRestriction"
PrerenderFinalStatusStartFailed PrerenderFinalStatus = "StartFailed"
PrerenderFinalStatusTimeoutBackgrounded PrerenderFinalStatus = "TimeoutBackgrounded"
PrerenderFinalStatusCrossSiteRedirectInInitialNavigation PrerenderFinalStatus = "CrossSiteRedirectInInitialNavigation"
PrerenderFinalStatusCrossSiteNavigationInInitialNavigation PrerenderFinalStatus = "CrossSiteNavigationInInitialNavigation"
PrerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInInitialNavigation PrerenderFinalStatus = "SameSiteCrossOriginRedirectNotOptInInInitialNavigation"
PrerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInInitialNavigation PrerenderFinalStatus = "SameSiteCrossOriginNavigationNotOptInInInitialNavigation"
PrerenderFinalStatusActivationNavigationParameterMismatch PrerenderFinalStatus = "ActivationNavigationParameterMismatch"
PrerenderFinalStatusActivatedInBackground PrerenderFinalStatus = "ActivatedInBackground"
PrerenderFinalStatusEmbedderHostDisallowed PrerenderFinalStatus = "EmbedderHostDisallowed"
PrerenderFinalStatusActivationNavigationDestroyedBeforeSuccess PrerenderFinalStatus = "ActivationNavigationDestroyedBeforeSuccess"
PrerenderFinalStatusTabClosedByUserGesture PrerenderFinalStatus = "TabClosedByUserGesture"
PrerenderFinalStatusTabClosedWithoutUserGesture PrerenderFinalStatus = "TabClosedWithoutUserGesture"
PrerenderFinalStatusPrimaryMainFrameRendererProcessCrashed PrerenderFinalStatus = "PrimaryMainFrameRendererProcessCrashed"
PrerenderFinalStatusPrimaryMainFrameRendererProcessKilled PrerenderFinalStatus = "PrimaryMainFrameRendererProcessKilled"
PrerenderFinalStatusActivationFramePolicyNotCompatible PrerenderFinalStatus = "ActivationFramePolicyNotCompatible"
PrerenderFinalStatusPreloadingDisabled PrerenderFinalStatus = "PreloadingDisabled"
PrerenderFinalStatusBatterySaverEnabled PrerenderFinalStatus = "BatterySaverEnabled"
PrerenderFinalStatusActivatedDuringMainFrameNavigation PrerenderFinalStatus = "ActivatedDuringMainFrameNavigation"
PrerenderFinalStatusPreloadingUnsupportedByWebContents PrerenderFinalStatus = "PreloadingUnsupportedByWebContents"
PrerenderFinalStatusCrossSiteRedirectInMainFrameNavigation PrerenderFinalStatus = "CrossSiteRedirectInMainFrameNavigation"
PrerenderFinalStatusCrossSiteNavigationInMainFrameNavigation PrerenderFinalStatus = "CrossSiteNavigationInMainFrameNavigation"
PrerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInMainFrameNavigation PrerenderFinalStatus = "SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation"
PrerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInMainFrameNavigation PrerenderFinalStatus = "SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation"
PrerenderFinalStatusMemoryPressureOnTrigger PrerenderFinalStatus = "MemoryPressureOnTrigger"
PrerenderFinalStatusMemoryPressureAfterTriggered PrerenderFinalStatus = "MemoryPressureAfterTriggered"
PrerenderFinalStatusPrerenderingDisabledByDevTools PrerenderFinalStatus = "PrerenderingDisabledByDevTools"
PrerenderFinalStatusSpeculationRuleRemoved PrerenderFinalStatus = "SpeculationRuleRemoved"
PrerenderFinalStatusActivatedWithAuxiliaryBrowsingContexts PrerenderFinalStatus = "ActivatedWithAuxiliaryBrowsingContexts"
PrerenderFinalStatusMaxNumOfRunningEagerPrerendersExceeded PrerenderFinalStatus = "MaxNumOfRunningEagerPrerendersExceeded"
PrerenderFinalStatusMaxNumOfRunningNonEagerPrerendersExceeded PrerenderFinalStatus = "MaxNumOfRunningNonEagerPrerendersExceeded"
PrerenderFinalStatusMaxNumOfRunningEmbedderPrerendersExceeded PrerenderFinalStatus = "MaxNumOfRunningEmbedderPrerendersExceeded"
PrerenderFinalStatusPrerenderingURLHasEffectiveURL PrerenderFinalStatus = "PrerenderingUrlHasEffectiveUrl"
PrerenderFinalStatusRedirectedPrerenderingURLHasEffectiveURL PrerenderFinalStatus = "RedirectedPrerenderingUrlHasEffectiveUrl"
PrerenderFinalStatusActivationURLHasEffectiveURL PrerenderFinalStatus = "ActivationUrlHasEffectiveUrl"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PrerenderFinalStatus) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t PrerenderFinalStatus) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PrerenderFinalStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch PrerenderFinalStatus(v) {
case PrerenderFinalStatusActivated:
*t = PrerenderFinalStatusActivated
case PrerenderFinalStatusDestroyed:
*t = PrerenderFinalStatusDestroyed
case PrerenderFinalStatusLowEndDevice:
*t = PrerenderFinalStatusLowEndDevice
case PrerenderFinalStatusInvalidSchemeRedirect:
*t = PrerenderFinalStatusInvalidSchemeRedirect
case PrerenderFinalStatusInvalidSchemeNavigation:
*t = PrerenderFinalStatusInvalidSchemeNavigation
case PrerenderFinalStatusNavigationRequestBlockedByCsp:
*t = PrerenderFinalStatusNavigationRequestBlockedByCsp
case PrerenderFinalStatusMainFrameNavigation:
*t = PrerenderFinalStatusMainFrameNavigation
case PrerenderFinalStatusMojoBinderPolicy:
*t = PrerenderFinalStatusMojoBinderPolicy
case PrerenderFinalStatusRendererProcessCrashed:
*t = PrerenderFinalStatusRendererProcessCrashed
case PrerenderFinalStatusRendererProcessKilled:
*t = PrerenderFinalStatusRendererProcessKilled
case PrerenderFinalStatusDownload:
*t = PrerenderFinalStatusDownload
case PrerenderFinalStatusTriggerDestroyed:
*t = PrerenderFinalStatusTriggerDestroyed
case PrerenderFinalStatusNavigationNotCommitted:
*t = PrerenderFinalStatusNavigationNotCommitted
case PrerenderFinalStatusNavigationBadHTTPStatus:
*t = PrerenderFinalStatusNavigationBadHTTPStatus
case PrerenderFinalStatusClientCertRequested:
*t = PrerenderFinalStatusClientCertRequested
case PrerenderFinalStatusNavigationRequestNetworkError:
*t = PrerenderFinalStatusNavigationRequestNetworkError
case PrerenderFinalStatusCancelAllHostsForTesting:
*t = PrerenderFinalStatusCancelAllHostsForTesting
case PrerenderFinalStatusDidFailLoad:
*t = PrerenderFinalStatusDidFailLoad
case PrerenderFinalStatusStop:
*t = PrerenderFinalStatusStop
case PrerenderFinalStatusSslCertificateError:
*t = PrerenderFinalStatusSslCertificateError
case PrerenderFinalStatusLoginAuthRequested:
*t = PrerenderFinalStatusLoginAuthRequested
case PrerenderFinalStatusUaChangeRequiresReload:
*t = PrerenderFinalStatusUaChangeRequiresReload
case PrerenderFinalStatusBlockedByClient:
*t = PrerenderFinalStatusBlockedByClient
case PrerenderFinalStatusAudioOutputDeviceRequested:
*t = PrerenderFinalStatusAudioOutputDeviceRequested
case PrerenderFinalStatusMixedContent:
*t = PrerenderFinalStatusMixedContent
case PrerenderFinalStatusTriggerBackgrounded:
*t = PrerenderFinalStatusTriggerBackgrounded
case PrerenderFinalStatusMemoryLimitExceeded:
*t = PrerenderFinalStatusMemoryLimitExceeded
case PrerenderFinalStatusDataSaverEnabled:
*t = PrerenderFinalStatusDataSaverEnabled
case PrerenderFinalStatusTriggerURLHasEffectiveURL:
*t = PrerenderFinalStatusTriggerURLHasEffectiveURL
case PrerenderFinalStatusActivatedBeforeStarted:
*t = PrerenderFinalStatusActivatedBeforeStarted
case PrerenderFinalStatusInactivePageRestriction:
*t = PrerenderFinalStatusInactivePageRestriction
case PrerenderFinalStatusStartFailed:
*t = PrerenderFinalStatusStartFailed
case PrerenderFinalStatusTimeoutBackgrounded:
*t = PrerenderFinalStatusTimeoutBackgrounded
case PrerenderFinalStatusCrossSiteRedirectInInitialNavigation:
*t = PrerenderFinalStatusCrossSiteRedirectInInitialNavigation
case PrerenderFinalStatusCrossSiteNavigationInInitialNavigation:
*t = PrerenderFinalStatusCrossSiteNavigationInInitialNavigation
case PrerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInInitialNavigation:
*t = PrerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInInitialNavigation
case PrerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInInitialNavigation:
*t = PrerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInInitialNavigation
case PrerenderFinalStatusActivationNavigationParameterMismatch:
*t = PrerenderFinalStatusActivationNavigationParameterMismatch
case PrerenderFinalStatusActivatedInBackground:
*t = PrerenderFinalStatusActivatedInBackground
case PrerenderFinalStatusEmbedderHostDisallowed:
*t = PrerenderFinalStatusEmbedderHostDisallowed
case PrerenderFinalStatusActivationNavigationDestroyedBeforeSuccess:
*t = PrerenderFinalStatusActivationNavigationDestroyedBeforeSuccess
case PrerenderFinalStatusTabClosedByUserGesture:
*t = PrerenderFinalStatusTabClosedByUserGesture
case PrerenderFinalStatusTabClosedWithoutUserGesture:
*t = PrerenderFinalStatusTabClosedWithoutUserGesture
case PrerenderFinalStatusPrimaryMainFrameRendererProcessCrashed:
*t = PrerenderFinalStatusPrimaryMainFrameRendererProcessCrashed
case PrerenderFinalStatusPrimaryMainFrameRendererProcessKilled:
*t = PrerenderFinalStatusPrimaryMainFrameRendererProcessKilled
case PrerenderFinalStatusActivationFramePolicyNotCompatible:
*t = PrerenderFinalStatusActivationFramePolicyNotCompatible
case PrerenderFinalStatusPreloadingDisabled:
*t = PrerenderFinalStatusPreloadingDisabled
case PrerenderFinalStatusBatterySaverEnabled:
*t = PrerenderFinalStatusBatterySaverEnabled
case PrerenderFinalStatusActivatedDuringMainFrameNavigation:
*t = PrerenderFinalStatusActivatedDuringMainFrameNavigation
case PrerenderFinalStatusPreloadingUnsupportedByWebContents:
*t = PrerenderFinalStatusPreloadingUnsupportedByWebContents
case PrerenderFinalStatusCrossSiteRedirectInMainFrameNavigation:
*t = PrerenderFinalStatusCrossSiteRedirectInMainFrameNavigation
case PrerenderFinalStatusCrossSiteNavigationInMainFrameNavigation:
*t = PrerenderFinalStatusCrossSiteNavigationInMainFrameNavigation
case PrerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInMainFrameNavigation:
*t = PrerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInMainFrameNavigation
case PrerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInMainFrameNavigation:
*t = PrerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInMainFrameNavigation
case PrerenderFinalStatusMemoryPressureOnTrigger:
*t = PrerenderFinalStatusMemoryPressureOnTrigger
case PrerenderFinalStatusMemoryPressureAfterTriggered:
*t = PrerenderFinalStatusMemoryPressureAfterTriggered
case PrerenderFinalStatusPrerenderingDisabledByDevTools:
*t = PrerenderFinalStatusPrerenderingDisabledByDevTools
case PrerenderFinalStatusSpeculationRuleRemoved:
*t = PrerenderFinalStatusSpeculationRuleRemoved
case PrerenderFinalStatusActivatedWithAuxiliaryBrowsingContexts:
*t = PrerenderFinalStatusActivatedWithAuxiliaryBrowsingContexts
case PrerenderFinalStatusMaxNumOfRunningEagerPrerendersExceeded:
*t = PrerenderFinalStatusMaxNumOfRunningEagerPrerendersExceeded
case PrerenderFinalStatusMaxNumOfRunningNonEagerPrerendersExceeded:
*t = PrerenderFinalStatusMaxNumOfRunningNonEagerPrerendersExceeded
case PrerenderFinalStatusMaxNumOfRunningEmbedderPrerendersExceeded:
*t = PrerenderFinalStatusMaxNumOfRunningEmbedderPrerendersExceeded
case PrerenderFinalStatusPrerenderingURLHasEffectiveURL:
*t = PrerenderFinalStatusPrerenderingURLHasEffectiveURL
case PrerenderFinalStatusRedirectedPrerenderingURLHasEffectiveURL:
*t = PrerenderFinalStatusRedirectedPrerenderingURLHasEffectiveURL
case PrerenderFinalStatusActivationURLHasEffectiveURL:
*t = PrerenderFinalStatusActivationURLHasEffectiveURL
default:
in.AddError(fmt.Errorf("unknown PrerenderFinalStatus value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *PrerenderFinalStatus) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// IngStatus preloading status values, see also PreloadingTriggeringOutcome.
// This status is shared by prefetchStatusUpdated and prerenderStatusUpdated.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-PreloadingStatus
type IngStatus string
// String returns the IngStatus as string value.
func (t IngStatus) String() string {
return string(t)
}
// IngStatus values.
const (
IngStatusPending IngStatus = "Pending"
IngStatusRunning IngStatus = "Running"
IngStatusReady IngStatus = "Ready"
IngStatusSuccess IngStatus = "Success"
IngStatusFailure IngStatus = "Failure"
IngStatusNotSupported IngStatus = "NotSupported"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t IngStatus) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t IngStatus) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *IngStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch IngStatus(v) {
case IngStatusPending:
*t = IngStatusPending
case IngStatusRunning:
*t = IngStatusRunning
case IngStatusReady:
*t = IngStatusReady
case IngStatusSuccess:
*t = IngStatusSuccess
case IngStatusFailure:
*t = IngStatusFailure
case IngStatusNotSupported:
*t = IngStatusNotSupported
default:
in.AddError(fmt.Errorf("unknown IngStatus value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *IngStatus) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// PrefetchStatus tODO(https://crbug.com/1384419): revisit the list of
// PrefetchStatus and filter out the ones that aren't necessary to the
// developers.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Preload#type-PrefetchStatus
type PrefetchStatus string
// String returns the PrefetchStatus as string value.
func (t PrefetchStatus) String() string {
return string(t)
}
// PrefetchStatus values.
const (
PrefetchStatusPrefetchAllowed PrefetchStatus = "PrefetchAllowed"
PrefetchStatusPrefetchFailedIneligibleRedirect PrefetchStatus = "PrefetchFailedIneligibleRedirect"
PrefetchStatusPrefetchFailedInvalidRedirect PrefetchStatus = "PrefetchFailedInvalidRedirect"
PrefetchStatusPrefetchFailedMIMENotSupported PrefetchStatus = "PrefetchFailedMIMENotSupported"
PrefetchStatusPrefetchFailedNetError PrefetchStatus = "PrefetchFailedNetError"
PrefetchStatusPrefetchFailedNon2xX PrefetchStatus = "PrefetchFailedNon2XX"
PrefetchStatusPrefetchFailedPerPageLimitExceeded PrefetchStatus = "PrefetchFailedPerPageLimitExceeded"
PrefetchStatusPrefetchEvicted PrefetchStatus = "PrefetchEvicted"
PrefetchStatusPrefetchHeldback PrefetchStatus = "PrefetchHeldback"
PrefetchStatusPrefetchIneligibleRetryAfter PrefetchStatus = "PrefetchIneligibleRetryAfter"
PrefetchStatusPrefetchIsPrivacyDecoy PrefetchStatus = "PrefetchIsPrivacyDecoy"
PrefetchStatusPrefetchIsStale PrefetchStatus = "PrefetchIsStale"
PrefetchStatusPrefetchNotEligibleBrowserContextOffTheRecord PrefetchStatus = "PrefetchNotEligibleBrowserContextOffTheRecord"
PrefetchStatusPrefetchNotEligibleDataSaverEnabled PrefetchStatus = "PrefetchNotEligibleDataSaverEnabled"
PrefetchStatusPrefetchNotEligibleExistingProxy PrefetchStatus = "PrefetchNotEligibleExistingProxy"
PrefetchStatusPrefetchNotEligibleHostIsNonUnique PrefetchStatus = "PrefetchNotEligibleHostIsNonUnique"
PrefetchStatusPrefetchNotEligibleNonDefaultStoragePartition PrefetchStatus = "PrefetchNotEligibleNonDefaultStoragePartition"
PrefetchStatusPrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy PrefetchStatus = "PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy"
PrefetchStatusPrefetchNotEligibleSchemeIsNotHTTPS PrefetchStatus = "PrefetchNotEligibleSchemeIsNotHttps"
PrefetchStatusPrefetchNotEligibleUserHasCookies PrefetchStatus = "PrefetchNotEligibleUserHasCookies"
PrefetchStatusPrefetchNotEligibleUserHasServiceWorker PrefetchStatus = "PrefetchNotEligibleUserHasServiceWorker"
PrefetchStatusPrefetchNotEligibleBatterySaverEnabled PrefetchStatus = "PrefetchNotEligibleBatterySaverEnabled"
PrefetchStatusPrefetchNotEligiblePreloadingDisabled PrefetchStatus = "PrefetchNotEligiblePreloadingDisabled"
PrefetchStatusPrefetchNotFinishedInTime PrefetchStatus = "PrefetchNotFinishedInTime"
PrefetchStatusPrefetchNotStarted PrefetchStatus = "PrefetchNotStarted"
PrefetchStatusPrefetchNotUsedCookiesChanged PrefetchStatus = "PrefetchNotUsedCookiesChanged"
PrefetchStatusPrefetchProxyNotAvailable PrefetchStatus = "PrefetchProxyNotAvailable"
PrefetchStatusPrefetchResponseUsed PrefetchStatus = "PrefetchResponseUsed"
PrefetchStatusPrefetchSuccessfulButNotUsed PrefetchStatus = "PrefetchSuccessfulButNotUsed"
PrefetchStatusPrefetchNotUsedProbeFailed PrefetchStatus = "PrefetchNotUsedProbeFailed"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t PrefetchStatus) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t PrefetchStatus) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *PrefetchStatus) UnmarshalEasyJSON(in *jlexer.Lexer) {
v := in.String()
switch PrefetchStatus(v) {
case PrefetchStatusPrefetchAllowed:
*t = PrefetchStatusPrefetchAllowed
case PrefetchStatusPrefetchFailedIneligibleRedirect:
*t = PrefetchStatusPrefetchFailedIneligibleRedirect
case PrefetchStatusPrefetchFailedInvalidRedirect:
*t = PrefetchStatusPrefetchFailedInvalidRedirect
case PrefetchStatusPrefetchFailedMIMENotSupported:
*t = PrefetchStatusPrefetchFailedMIMENotSupported
case PrefetchStatusPrefetchFailedNetError:
*t = PrefetchStatusPrefetchFailedNetError
case PrefetchStatusPrefetchFailedNon2xX:
*t = PrefetchStatusPrefetchFailedNon2xX
case PrefetchStatusPrefetchFailedPerPageLimitExceeded:
*t = PrefetchStatusPrefetchFailedPerPageLimitExceeded
case PrefetchStatusPrefetchEvicted:
*t = PrefetchStatusPrefetchEvicted
case PrefetchStatusPrefetchHeldback:
*t = PrefetchStatusPrefetchHeldback
case PrefetchStatusPrefetchIneligibleRetryAfter:
*t = PrefetchStatusPrefetchIneligibleRetryAfter
case PrefetchStatusPrefetchIsPrivacyDecoy:
*t = PrefetchStatusPrefetchIsPrivacyDecoy
case PrefetchStatusPrefetchIsStale:
*t = PrefetchStatusPrefetchIsStale
case PrefetchStatusPrefetchNotEligibleBrowserContextOffTheRecord:
*t = PrefetchStatusPrefetchNotEligibleBrowserContextOffTheRecord
case PrefetchStatusPrefetchNotEligibleDataSaverEnabled:
*t = PrefetchStatusPrefetchNotEligibleDataSaverEnabled
case PrefetchStatusPrefetchNotEligibleExistingProxy:
*t = PrefetchStatusPrefetchNotEligibleExistingProxy
case PrefetchStatusPrefetchNotEligibleHostIsNonUnique:
*t = PrefetchStatusPrefetchNotEligibleHostIsNonUnique
case PrefetchStatusPrefetchNotEligibleNonDefaultStoragePartition:
*t = PrefetchStatusPrefetchNotEligibleNonDefaultStoragePartition
case PrefetchStatusPrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy:
*t = PrefetchStatusPrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy
case PrefetchStatusPrefetchNotEligibleSchemeIsNotHTTPS:
*t = PrefetchStatusPrefetchNotEligibleSchemeIsNotHTTPS
case PrefetchStatusPrefetchNotEligibleUserHasCookies:
*t = PrefetchStatusPrefetchNotEligibleUserHasCookies
case PrefetchStatusPrefetchNotEligibleUserHasServiceWorker:
*t = PrefetchStatusPrefetchNotEligibleUserHasServiceWorker
case PrefetchStatusPrefetchNotEligibleBatterySaverEnabled:
*t = PrefetchStatusPrefetchNotEligibleBatterySaverEnabled
case PrefetchStatusPrefetchNotEligiblePreloadingDisabled:
*t = PrefetchStatusPrefetchNotEligiblePreloadingDisabled
case PrefetchStatusPrefetchNotFinishedInTime:
*t = PrefetchStatusPrefetchNotFinishedInTime
case PrefetchStatusPrefetchNotStarted:
*t = PrefetchStatusPrefetchNotStarted
case PrefetchStatusPrefetchNotUsedCookiesChanged:
*t = PrefetchStatusPrefetchNotUsedCookiesChanged
case PrefetchStatusPrefetchProxyNotAvailable:
*t = PrefetchStatusPrefetchProxyNotAvailable
case PrefetchStatusPrefetchResponseUsed:
*t = PrefetchStatusPrefetchResponseUsed
case PrefetchStatusPrefetchSuccessfulButNotUsed:
*t = PrefetchStatusPrefetchSuccessfulButNotUsed
case PrefetchStatusPrefetchNotUsedProbeFailed:
*t = PrefetchStatusPrefetchNotUsedProbeFailed
default:
in.AddError(fmt.Errorf("unknown PrefetchStatus value: %v", v))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *PrefetchStatus) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}