easyjson.go 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package preload
  3. import (
  4. json "encoding/json"
  5. cdp "github.com/chromedp/cdproto/cdp"
  6. network "github.com/chromedp/cdproto/network"
  7. easyjson "github.com/mailru/easyjson"
  8. jlexer "github.com/mailru/easyjson/jlexer"
  9. jwriter "github.com/mailru/easyjson/jwriter"
  10. )
  11. // suppress unused package warning
  12. var (
  13. _ *json.RawMessage
  14. _ *jlexer.Lexer
  15. _ *jwriter.Writer
  16. _ easyjson.Marshaler
  17. )
  18. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload(in *jlexer.Lexer, out *RuleSet) {
  19. isTopLevel := in.IsStart()
  20. if in.IsNull() {
  21. if isTopLevel {
  22. in.Consumed()
  23. }
  24. in.Skip()
  25. return
  26. }
  27. in.Delim('{')
  28. for !in.IsDelim('}') {
  29. key := in.UnsafeFieldName(false)
  30. in.WantColon()
  31. if in.IsNull() {
  32. in.Skip()
  33. in.WantComma()
  34. continue
  35. }
  36. switch key {
  37. case "id":
  38. out.ID = RuleSetID(in.String())
  39. case "loaderId":
  40. out.LoaderID = cdp.LoaderID(in.String())
  41. case "sourceText":
  42. out.SourceText = string(in.String())
  43. case "backendNodeId":
  44. (out.BackendNodeID).UnmarshalEasyJSON(in)
  45. case "url":
  46. out.URL = string(in.String())
  47. case "requestId":
  48. out.RequestID = network.RequestID(in.String())
  49. case "errorType":
  50. (out.ErrorType).UnmarshalEasyJSON(in)
  51. default:
  52. in.SkipRecursive()
  53. }
  54. in.WantComma()
  55. }
  56. in.Delim('}')
  57. if isTopLevel {
  58. in.Consumed()
  59. }
  60. }
  61. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload(out *jwriter.Writer, in RuleSet) {
  62. out.RawByte('{')
  63. first := true
  64. _ = first
  65. {
  66. const prefix string = ",\"id\":"
  67. out.RawString(prefix[1:])
  68. out.String(string(in.ID))
  69. }
  70. {
  71. const prefix string = ",\"loaderId\":"
  72. out.RawString(prefix)
  73. out.String(string(in.LoaderID))
  74. }
  75. {
  76. const prefix string = ",\"sourceText\":"
  77. out.RawString(prefix)
  78. out.String(string(in.SourceText))
  79. }
  80. if in.BackendNodeID != 0 {
  81. const prefix string = ",\"backendNodeId\":"
  82. out.RawString(prefix)
  83. out.Int64(int64(in.BackendNodeID))
  84. }
  85. if in.URL != "" {
  86. const prefix string = ",\"url\":"
  87. out.RawString(prefix)
  88. out.String(string(in.URL))
  89. }
  90. if in.RequestID != "" {
  91. const prefix string = ",\"requestId\":"
  92. out.RawString(prefix)
  93. out.String(string(in.RequestID))
  94. }
  95. if in.ErrorType != "" {
  96. const prefix string = ",\"errorType\":"
  97. out.RawString(prefix)
  98. (in.ErrorType).MarshalEasyJSON(out)
  99. }
  100. out.RawByte('}')
  101. }
  102. // MarshalJSON supports json.Marshaler interface
  103. func (v RuleSet) MarshalJSON() ([]byte, error) {
  104. w := jwriter.Writer{}
  105. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload(&w, v)
  106. return w.Buffer.BuildBytes(), w.Error
  107. }
  108. // MarshalEasyJSON supports easyjson.Marshaler interface
  109. func (v RuleSet) MarshalEasyJSON(w *jwriter.Writer) {
  110. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload(w, v)
  111. }
  112. // UnmarshalJSON supports json.Unmarshaler interface
  113. func (v *RuleSet) UnmarshalJSON(data []byte) error {
  114. r := jlexer.Lexer{Data: data}
  115. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload(&r, v)
  116. return r.Error()
  117. }
  118. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  119. func (v *RuleSet) UnmarshalEasyJSON(l *jlexer.Lexer) {
  120. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload(l, v)
  121. }
  122. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload1(in *jlexer.Lexer, out *PrerenderMismatchedHeaders) {
  123. isTopLevel := in.IsStart()
  124. if in.IsNull() {
  125. if isTopLevel {
  126. in.Consumed()
  127. }
  128. in.Skip()
  129. return
  130. }
  131. in.Delim('{')
  132. for !in.IsDelim('}') {
  133. key := in.UnsafeFieldName(false)
  134. in.WantColon()
  135. if in.IsNull() {
  136. in.Skip()
  137. in.WantComma()
  138. continue
  139. }
  140. switch key {
  141. case "headerName":
  142. out.HeaderName = string(in.String())
  143. case "initialValue":
  144. out.InitialValue = string(in.String())
  145. case "activationValue":
  146. out.ActivationValue = string(in.String())
  147. default:
  148. in.SkipRecursive()
  149. }
  150. in.WantComma()
  151. }
  152. in.Delim('}')
  153. if isTopLevel {
  154. in.Consumed()
  155. }
  156. }
  157. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload1(out *jwriter.Writer, in PrerenderMismatchedHeaders) {
  158. out.RawByte('{')
  159. first := true
  160. _ = first
  161. {
  162. const prefix string = ",\"headerName\":"
  163. out.RawString(prefix[1:])
  164. out.String(string(in.HeaderName))
  165. }
  166. if in.InitialValue != "" {
  167. const prefix string = ",\"initialValue\":"
  168. out.RawString(prefix)
  169. out.String(string(in.InitialValue))
  170. }
  171. if in.ActivationValue != "" {
  172. const prefix string = ",\"activationValue\":"
  173. out.RawString(prefix)
  174. out.String(string(in.ActivationValue))
  175. }
  176. out.RawByte('}')
  177. }
  178. // MarshalJSON supports json.Marshaler interface
  179. func (v PrerenderMismatchedHeaders) MarshalJSON() ([]byte, error) {
  180. w := jwriter.Writer{}
  181. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload1(&w, v)
  182. return w.Buffer.BuildBytes(), w.Error
  183. }
  184. // MarshalEasyJSON supports easyjson.Marshaler interface
  185. func (v PrerenderMismatchedHeaders) MarshalEasyJSON(w *jwriter.Writer) {
  186. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload1(w, v)
  187. }
  188. // UnmarshalJSON supports json.Unmarshaler interface
  189. func (v *PrerenderMismatchedHeaders) UnmarshalJSON(data []byte) error {
  190. r := jlexer.Lexer{Data: data}
  191. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload1(&r, v)
  192. return r.Error()
  193. }
  194. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  195. func (v *PrerenderMismatchedHeaders) UnmarshalEasyJSON(l *jlexer.Lexer) {
  196. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload1(l, v)
  197. }
  198. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(in *jlexer.Lexer, out *IngAttemptSource) {
  199. isTopLevel := in.IsStart()
  200. if in.IsNull() {
  201. if isTopLevel {
  202. in.Consumed()
  203. }
  204. in.Skip()
  205. return
  206. }
  207. in.Delim('{')
  208. for !in.IsDelim('}') {
  209. key := in.UnsafeFieldName(false)
  210. in.WantColon()
  211. if in.IsNull() {
  212. in.Skip()
  213. in.WantComma()
  214. continue
  215. }
  216. switch key {
  217. case "key":
  218. if in.IsNull() {
  219. in.Skip()
  220. out.Key = nil
  221. } else {
  222. if out.Key == nil {
  223. out.Key = new(IngAttemptKey)
  224. }
  225. (*out.Key).UnmarshalEasyJSON(in)
  226. }
  227. case "ruleSetIds":
  228. if in.IsNull() {
  229. in.Skip()
  230. out.RuleSetIDs = nil
  231. } else {
  232. in.Delim('[')
  233. if out.RuleSetIDs == nil {
  234. if !in.IsDelim(']') {
  235. out.RuleSetIDs = make([]RuleSetID, 0, 4)
  236. } else {
  237. out.RuleSetIDs = []RuleSetID{}
  238. }
  239. } else {
  240. out.RuleSetIDs = (out.RuleSetIDs)[:0]
  241. }
  242. for !in.IsDelim(']') {
  243. var v1 RuleSetID
  244. v1 = RuleSetID(in.String())
  245. out.RuleSetIDs = append(out.RuleSetIDs, v1)
  246. in.WantComma()
  247. }
  248. in.Delim(']')
  249. }
  250. case "nodeIds":
  251. if in.IsNull() {
  252. in.Skip()
  253. out.NodeIDs = nil
  254. } else {
  255. in.Delim('[')
  256. if out.NodeIDs == nil {
  257. if !in.IsDelim(']') {
  258. out.NodeIDs = make([]cdp.BackendNodeID, 0, 8)
  259. } else {
  260. out.NodeIDs = []cdp.BackendNodeID{}
  261. }
  262. } else {
  263. out.NodeIDs = (out.NodeIDs)[:0]
  264. }
  265. for !in.IsDelim(']') {
  266. var v2 cdp.BackendNodeID
  267. (v2).UnmarshalEasyJSON(in)
  268. out.NodeIDs = append(out.NodeIDs, v2)
  269. in.WantComma()
  270. }
  271. in.Delim(']')
  272. }
  273. default:
  274. in.SkipRecursive()
  275. }
  276. in.WantComma()
  277. }
  278. in.Delim('}')
  279. if isTopLevel {
  280. in.Consumed()
  281. }
  282. }
  283. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(out *jwriter.Writer, in IngAttemptSource) {
  284. out.RawByte('{')
  285. first := true
  286. _ = first
  287. {
  288. const prefix string = ",\"key\":"
  289. out.RawString(prefix[1:])
  290. if in.Key == nil {
  291. out.RawString("null")
  292. } else {
  293. (*in.Key).MarshalEasyJSON(out)
  294. }
  295. }
  296. {
  297. const prefix string = ",\"ruleSetIds\":"
  298. out.RawString(prefix)
  299. if in.RuleSetIDs == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  300. out.RawString("null")
  301. } else {
  302. out.RawByte('[')
  303. for v3, v4 := range in.RuleSetIDs {
  304. if v3 > 0 {
  305. out.RawByte(',')
  306. }
  307. out.String(string(v4))
  308. }
  309. out.RawByte(']')
  310. }
  311. }
  312. {
  313. const prefix string = ",\"nodeIds\":"
  314. out.RawString(prefix)
  315. if in.NodeIDs == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  316. out.RawString("null")
  317. } else {
  318. out.RawByte('[')
  319. for v5, v6 := range in.NodeIDs {
  320. if v5 > 0 {
  321. out.RawByte(',')
  322. }
  323. out.Int64(int64(v6))
  324. }
  325. out.RawByte(']')
  326. }
  327. }
  328. out.RawByte('}')
  329. }
  330. // MarshalJSON supports json.Marshaler interface
  331. func (v IngAttemptSource) MarshalJSON() ([]byte, error) {
  332. w := jwriter.Writer{}
  333. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(&w, v)
  334. return w.Buffer.BuildBytes(), w.Error
  335. }
  336. // MarshalEasyJSON supports easyjson.Marshaler interface
  337. func (v IngAttemptSource) MarshalEasyJSON(w *jwriter.Writer) {
  338. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload2(w, v)
  339. }
  340. // UnmarshalJSON supports json.Unmarshaler interface
  341. func (v *IngAttemptSource) UnmarshalJSON(data []byte) error {
  342. r := jlexer.Lexer{Data: data}
  343. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(&r, v)
  344. return r.Error()
  345. }
  346. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  347. func (v *IngAttemptSource) UnmarshalEasyJSON(l *jlexer.Lexer) {
  348. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload2(l, v)
  349. }
  350. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(in *jlexer.Lexer, out *IngAttemptKey) {
  351. isTopLevel := in.IsStart()
  352. if in.IsNull() {
  353. if isTopLevel {
  354. in.Consumed()
  355. }
  356. in.Skip()
  357. return
  358. }
  359. in.Delim('{')
  360. for !in.IsDelim('}') {
  361. key := in.UnsafeFieldName(false)
  362. in.WantColon()
  363. if in.IsNull() {
  364. in.Skip()
  365. in.WantComma()
  366. continue
  367. }
  368. switch key {
  369. case "loaderId":
  370. out.LoaderID = cdp.LoaderID(in.String())
  371. case "action":
  372. (out.Action).UnmarshalEasyJSON(in)
  373. case "url":
  374. out.URL = string(in.String())
  375. case "targetHint":
  376. (out.TargetHint).UnmarshalEasyJSON(in)
  377. default:
  378. in.SkipRecursive()
  379. }
  380. in.WantComma()
  381. }
  382. in.Delim('}')
  383. if isTopLevel {
  384. in.Consumed()
  385. }
  386. }
  387. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(out *jwriter.Writer, in IngAttemptKey) {
  388. out.RawByte('{')
  389. first := true
  390. _ = first
  391. {
  392. const prefix string = ",\"loaderId\":"
  393. out.RawString(prefix[1:])
  394. out.String(string(in.LoaderID))
  395. }
  396. {
  397. const prefix string = ",\"action\":"
  398. out.RawString(prefix)
  399. (in.Action).MarshalEasyJSON(out)
  400. }
  401. {
  402. const prefix string = ",\"url\":"
  403. out.RawString(prefix)
  404. out.String(string(in.URL))
  405. }
  406. if in.TargetHint != "" {
  407. const prefix string = ",\"targetHint\":"
  408. out.RawString(prefix)
  409. (in.TargetHint).MarshalEasyJSON(out)
  410. }
  411. out.RawByte('}')
  412. }
  413. // MarshalJSON supports json.Marshaler interface
  414. func (v IngAttemptKey) MarshalJSON() ([]byte, error) {
  415. w := jwriter.Writer{}
  416. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(&w, v)
  417. return w.Buffer.BuildBytes(), w.Error
  418. }
  419. // MarshalEasyJSON supports easyjson.Marshaler interface
  420. func (v IngAttemptKey) MarshalEasyJSON(w *jwriter.Writer) {
  421. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload3(w, v)
  422. }
  423. // UnmarshalJSON supports json.Unmarshaler interface
  424. func (v *IngAttemptKey) UnmarshalJSON(data []byte) error {
  425. r := jlexer.Lexer{Data: data}
  426. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(&r, v)
  427. return r.Error()
  428. }
  429. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  430. func (v *IngAttemptKey) UnmarshalEasyJSON(l *jlexer.Lexer) {
  431. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload3(l, v)
  432. }
  433. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(in *jlexer.Lexer, out *EventRuleSetUpdated) {
  434. isTopLevel := in.IsStart()
  435. if in.IsNull() {
  436. if isTopLevel {
  437. in.Consumed()
  438. }
  439. in.Skip()
  440. return
  441. }
  442. in.Delim('{')
  443. for !in.IsDelim('}') {
  444. key := in.UnsafeFieldName(false)
  445. in.WantColon()
  446. if in.IsNull() {
  447. in.Skip()
  448. in.WantComma()
  449. continue
  450. }
  451. switch key {
  452. case "ruleSet":
  453. if in.IsNull() {
  454. in.Skip()
  455. out.RuleSet = nil
  456. } else {
  457. if out.RuleSet == nil {
  458. out.RuleSet = new(RuleSet)
  459. }
  460. (*out.RuleSet).UnmarshalEasyJSON(in)
  461. }
  462. default:
  463. in.SkipRecursive()
  464. }
  465. in.WantComma()
  466. }
  467. in.Delim('}')
  468. if isTopLevel {
  469. in.Consumed()
  470. }
  471. }
  472. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(out *jwriter.Writer, in EventRuleSetUpdated) {
  473. out.RawByte('{')
  474. first := true
  475. _ = first
  476. {
  477. const prefix string = ",\"ruleSet\":"
  478. out.RawString(prefix[1:])
  479. if in.RuleSet == nil {
  480. out.RawString("null")
  481. } else {
  482. (*in.RuleSet).MarshalEasyJSON(out)
  483. }
  484. }
  485. out.RawByte('}')
  486. }
  487. // MarshalJSON supports json.Marshaler interface
  488. func (v EventRuleSetUpdated) MarshalJSON() ([]byte, error) {
  489. w := jwriter.Writer{}
  490. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(&w, v)
  491. return w.Buffer.BuildBytes(), w.Error
  492. }
  493. // MarshalEasyJSON supports easyjson.Marshaler interface
  494. func (v EventRuleSetUpdated) MarshalEasyJSON(w *jwriter.Writer) {
  495. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload4(w, v)
  496. }
  497. // UnmarshalJSON supports json.Unmarshaler interface
  498. func (v *EventRuleSetUpdated) UnmarshalJSON(data []byte) error {
  499. r := jlexer.Lexer{Data: data}
  500. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(&r, v)
  501. return r.Error()
  502. }
  503. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  504. func (v *EventRuleSetUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) {
  505. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload4(l, v)
  506. }
  507. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(in *jlexer.Lexer, out *EventRuleSetRemoved) {
  508. isTopLevel := in.IsStart()
  509. if in.IsNull() {
  510. if isTopLevel {
  511. in.Consumed()
  512. }
  513. in.Skip()
  514. return
  515. }
  516. in.Delim('{')
  517. for !in.IsDelim('}') {
  518. key := in.UnsafeFieldName(false)
  519. in.WantColon()
  520. if in.IsNull() {
  521. in.Skip()
  522. in.WantComma()
  523. continue
  524. }
  525. switch key {
  526. case "id":
  527. out.ID = RuleSetID(in.String())
  528. default:
  529. in.SkipRecursive()
  530. }
  531. in.WantComma()
  532. }
  533. in.Delim('}')
  534. if isTopLevel {
  535. in.Consumed()
  536. }
  537. }
  538. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(out *jwriter.Writer, in EventRuleSetRemoved) {
  539. out.RawByte('{')
  540. first := true
  541. _ = first
  542. {
  543. const prefix string = ",\"id\":"
  544. out.RawString(prefix[1:])
  545. out.String(string(in.ID))
  546. }
  547. out.RawByte('}')
  548. }
  549. // MarshalJSON supports json.Marshaler interface
  550. func (v EventRuleSetRemoved) MarshalJSON() ([]byte, error) {
  551. w := jwriter.Writer{}
  552. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(&w, v)
  553. return w.Buffer.BuildBytes(), w.Error
  554. }
  555. // MarshalEasyJSON supports easyjson.Marshaler interface
  556. func (v EventRuleSetRemoved) MarshalEasyJSON(w *jwriter.Writer) {
  557. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload5(w, v)
  558. }
  559. // UnmarshalJSON supports json.Unmarshaler interface
  560. func (v *EventRuleSetRemoved) UnmarshalJSON(data []byte) error {
  561. r := jlexer.Lexer{Data: data}
  562. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(&r, v)
  563. return r.Error()
  564. }
  565. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  566. func (v *EventRuleSetRemoved) UnmarshalEasyJSON(l *jlexer.Lexer) {
  567. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload5(l, v)
  568. }
  569. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(in *jlexer.Lexer, out *EventPrerenderStatusUpdated) {
  570. isTopLevel := in.IsStart()
  571. if in.IsNull() {
  572. if isTopLevel {
  573. in.Consumed()
  574. }
  575. in.Skip()
  576. return
  577. }
  578. in.Delim('{')
  579. for !in.IsDelim('}') {
  580. key := in.UnsafeFieldName(false)
  581. in.WantColon()
  582. if in.IsNull() {
  583. in.Skip()
  584. in.WantComma()
  585. continue
  586. }
  587. switch key {
  588. case "key":
  589. if in.IsNull() {
  590. in.Skip()
  591. out.Key = nil
  592. } else {
  593. if out.Key == nil {
  594. out.Key = new(IngAttemptKey)
  595. }
  596. (*out.Key).UnmarshalEasyJSON(in)
  597. }
  598. case "status":
  599. (out.Status).UnmarshalEasyJSON(in)
  600. case "prerenderStatus":
  601. (out.PrerenderStatus).UnmarshalEasyJSON(in)
  602. case "disallowedMojoInterface":
  603. out.DisallowedMojoInterface = string(in.String())
  604. case "mismatchedHeaders":
  605. if in.IsNull() {
  606. in.Skip()
  607. out.MismatchedHeaders = nil
  608. } else {
  609. in.Delim('[')
  610. if out.MismatchedHeaders == nil {
  611. if !in.IsDelim(']') {
  612. out.MismatchedHeaders = make([]*PrerenderMismatchedHeaders, 0, 8)
  613. } else {
  614. out.MismatchedHeaders = []*PrerenderMismatchedHeaders{}
  615. }
  616. } else {
  617. out.MismatchedHeaders = (out.MismatchedHeaders)[:0]
  618. }
  619. for !in.IsDelim(']') {
  620. var v7 *PrerenderMismatchedHeaders
  621. if in.IsNull() {
  622. in.Skip()
  623. v7 = nil
  624. } else {
  625. if v7 == nil {
  626. v7 = new(PrerenderMismatchedHeaders)
  627. }
  628. (*v7).UnmarshalEasyJSON(in)
  629. }
  630. out.MismatchedHeaders = append(out.MismatchedHeaders, v7)
  631. in.WantComma()
  632. }
  633. in.Delim(']')
  634. }
  635. default:
  636. in.SkipRecursive()
  637. }
  638. in.WantComma()
  639. }
  640. in.Delim('}')
  641. if isTopLevel {
  642. in.Consumed()
  643. }
  644. }
  645. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(out *jwriter.Writer, in EventPrerenderStatusUpdated) {
  646. out.RawByte('{')
  647. first := true
  648. _ = first
  649. {
  650. const prefix string = ",\"key\":"
  651. out.RawString(prefix[1:])
  652. if in.Key == nil {
  653. out.RawString("null")
  654. } else {
  655. (*in.Key).MarshalEasyJSON(out)
  656. }
  657. }
  658. {
  659. const prefix string = ",\"status\":"
  660. out.RawString(prefix)
  661. (in.Status).MarshalEasyJSON(out)
  662. }
  663. if in.PrerenderStatus != "" {
  664. const prefix string = ",\"prerenderStatus\":"
  665. out.RawString(prefix)
  666. (in.PrerenderStatus).MarshalEasyJSON(out)
  667. }
  668. if in.DisallowedMojoInterface != "" {
  669. const prefix string = ",\"disallowedMojoInterface\":"
  670. out.RawString(prefix)
  671. out.String(string(in.DisallowedMojoInterface))
  672. }
  673. if len(in.MismatchedHeaders) != 0 {
  674. const prefix string = ",\"mismatchedHeaders\":"
  675. out.RawString(prefix)
  676. {
  677. out.RawByte('[')
  678. for v8, v9 := range in.MismatchedHeaders {
  679. if v8 > 0 {
  680. out.RawByte(',')
  681. }
  682. if v9 == nil {
  683. out.RawString("null")
  684. } else {
  685. (*v9).MarshalEasyJSON(out)
  686. }
  687. }
  688. out.RawByte(']')
  689. }
  690. }
  691. out.RawByte('}')
  692. }
  693. // MarshalJSON supports json.Marshaler interface
  694. func (v EventPrerenderStatusUpdated) MarshalJSON() ([]byte, error) {
  695. w := jwriter.Writer{}
  696. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(&w, v)
  697. return w.Buffer.BuildBytes(), w.Error
  698. }
  699. // MarshalEasyJSON supports easyjson.Marshaler interface
  700. func (v EventPrerenderStatusUpdated) MarshalEasyJSON(w *jwriter.Writer) {
  701. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload6(w, v)
  702. }
  703. // UnmarshalJSON supports json.Unmarshaler interface
  704. func (v *EventPrerenderStatusUpdated) UnmarshalJSON(data []byte) error {
  705. r := jlexer.Lexer{Data: data}
  706. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(&r, v)
  707. return r.Error()
  708. }
  709. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  710. func (v *EventPrerenderStatusUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) {
  711. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload6(l, v)
  712. }
  713. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(in *jlexer.Lexer, out *EventPreloadingAttemptSourcesUpdated) {
  714. isTopLevel := in.IsStart()
  715. if in.IsNull() {
  716. if isTopLevel {
  717. in.Consumed()
  718. }
  719. in.Skip()
  720. return
  721. }
  722. in.Delim('{')
  723. for !in.IsDelim('}') {
  724. key := in.UnsafeFieldName(false)
  725. in.WantColon()
  726. if in.IsNull() {
  727. in.Skip()
  728. in.WantComma()
  729. continue
  730. }
  731. switch key {
  732. case "loaderId":
  733. out.LoaderID = cdp.LoaderID(in.String())
  734. case "preloadingAttemptSources":
  735. if in.IsNull() {
  736. in.Skip()
  737. out.PreloadingAttemptSources = nil
  738. } else {
  739. in.Delim('[')
  740. if out.PreloadingAttemptSources == nil {
  741. if !in.IsDelim(']') {
  742. out.PreloadingAttemptSources = make([]*IngAttemptSource, 0, 8)
  743. } else {
  744. out.PreloadingAttemptSources = []*IngAttemptSource{}
  745. }
  746. } else {
  747. out.PreloadingAttemptSources = (out.PreloadingAttemptSources)[:0]
  748. }
  749. for !in.IsDelim(']') {
  750. var v10 *IngAttemptSource
  751. if in.IsNull() {
  752. in.Skip()
  753. v10 = nil
  754. } else {
  755. if v10 == nil {
  756. v10 = new(IngAttemptSource)
  757. }
  758. (*v10).UnmarshalEasyJSON(in)
  759. }
  760. out.PreloadingAttemptSources = append(out.PreloadingAttemptSources, v10)
  761. in.WantComma()
  762. }
  763. in.Delim(']')
  764. }
  765. default:
  766. in.SkipRecursive()
  767. }
  768. in.WantComma()
  769. }
  770. in.Delim('}')
  771. if isTopLevel {
  772. in.Consumed()
  773. }
  774. }
  775. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(out *jwriter.Writer, in EventPreloadingAttemptSourcesUpdated) {
  776. out.RawByte('{')
  777. first := true
  778. _ = first
  779. {
  780. const prefix string = ",\"loaderId\":"
  781. out.RawString(prefix[1:])
  782. out.String(string(in.LoaderID))
  783. }
  784. {
  785. const prefix string = ",\"preloadingAttemptSources\":"
  786. out.RawString(prefix)
  787. if in.PreloadingAttemptSources == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  788. out.RawString("null")
  789. } else {
  790. out.RawByte('[')
  791. for v11, v12 := range in.PreloadingAttemptSources {
  792. if v11 > 0 {
  793. out.RawByte(',')
  794. }
  795. if v12 == nil {
  796. out.RawString("null")
  797. } else {
  798. (*v12).MarshalEasyJSON(out)
  799. }
  800. }
  801. out.RawByte(']')
  802. }
  803. }
  804. out.RawByte('}')
  805. }
  806. // MarshalJSON supports json.Marshaler interface
  807. func (v EventPreloadingAttemptSourcesUpdated) MarshalJSON() ([]byte, error) {
  808. w := jwriter.Writer{}
  809. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(&w, v)
  810. return w.Buffer.BuildBytes(), w.Error
  811. }
  812. // MarshalEasyJSON supports easyjson.Marshaler interface
  813. func (v EventPreloadingAttemptSourcesUpdated) MarshalEasyJSON(w *jwriter.Writer) {
  814. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload7(w, v)
  815. }
  816. // UnmarshalJSON supports json.Unmarshaler interface
  817. func (v *EventPreloadingAttemptSourcesUpdated) UnmarshalJSON(data []byte) error {
  818. r := jlexer.Lexer{Data: data}
  819. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(&r, v)
  820. return r.Error()
  821. }
  822. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  823. func (v *EventPreloadingAttemptSourcesUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) {
  824. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload7(l, v)
  825. }
  826. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(in *jlexer.Lexer, out *EventPreloadEnabledStateUpdated) {
  827. isTopLevel := in.IsStart()
  828. if in.IsNull() {
  829. if isTopLevel {
  830. in.Consumed()
  831. }
  832. in.Skip()
  833. return
  834. }
  835. in.Delim('{')
  836. for !in.IsDelim('}') {
  837. key := in.UnsafeFieldName(false)
  838. in.WantColon()
  839. if in.IsNull() {
  840. in.Skip()
  841. in.WantComma()
  842. continue
  843. }
  844. switch key {
  845. case "disabledByPreference":
  846. out.DisabledByPreference = bool(in.Bool())
  847. case "disabledByDataSaver":
  848. out.DisabledByDataSaver = bool(in.Bool())
  849. case "disabledByBatterySaver":
  850. out.DisabledByBatterySaver = bool(in.Bool())
  851. case "disabledByHoldbackPrefetchSpeculationRules":
  852. out.DisabledByHoldbackPrefetchSpeculationRules = bool(in.Bool())
  853. case "disabledByHoldbackPrerenderSpeculationRules":
  854. out.DisabledByHoldbackPrerenderSpeculationRules = bool(in.Bool())
  855. default:
  856. in.SkipRecursive()
  857. }
  858. in.WantComma()
  859. }
  860. in.Delim('}')
  861. if isTopLevel {
  862. in.Consumed()
  863. }
  864. }
  865. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(out *jwriter.Writer, in EventPreloadEnabledStateUpdated) {
  866. out.RawByte('{')
  867. first := true
  868. _ = first
  869. {
  870. const prefix string = ",\"disabledByPreference\":"
  871. out.RawString(prefix[1:])
  872. out.Bool(bool(in.DisabledByPreference))
  873. }
  874. {
  875. const prefix string = ",\"disabledByDataSaver\":"
  876. out.RawString(prefix)
  877. out.Bool(bool(in.DisabledByDataSaver))
  878. }
  879. {
  880. const prefix string = ",\"disabledByBatterySaver\":"
  881. out.RawString(prefix)
  882. out.Bool(bool(in.DisabledByBatterySaver))
  883. }
  884. {
  885. const prefix string = ",\"disabledByHoldbackPrefetchSpeculationRules\":"
  886. out.RawString(prefix)
  887. out.Bool(bool(in.DisabledByHoldbackPrefetchSpeculationRules))
  888. }
  889. {
  890. const prefix string = ",\"disabledByHoldbackPrerenderSpeculationRules\":"
  891. out.RawString(prefix)
  892. out.Bool(bool(in.DisabledByHoldbackPrerenderSpeculationRules))
  893. }
  894. out.RawByte('}')
  895. }
  896. // MarshalJSON supports json.Marshaler interface
  897. func (v EventPreloadEnabledStateUpdated) MarshalJSON() ([]byte, error) {
  898. w := jwriter.Writer{}
  899. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(&w, v)
  900. return w.Buffer.BuildBytes(), w.Error
  901. }
  902. // MarshalEasyJSON supports easyjson.Marshaler interface
  903. func (v EventPreloadEnabledStateUpdated) MarshalEasyJSON(w *jwriter.Writer) {
  904. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload8(w, v)
  905. }
  906. // UnmarshalJSON supports json.Unmarshaler interface
  907. func (v *EventPreloadEnabledStateUpdated) UnmarshalJSON(data []byte) error {
  908. r := jlexer.Lexer{Data: data}
  909. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(&r, v)
  910. return r.Error()
  911. }
  912. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  913. func (v *EventPreloadEnabledStateUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) {
  914. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload8(l, v)
  915. }
  916. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(in *jlexer.Lexer, out *EventPrefetchStatusUpdated) {
  917. isTopLevel := in.IsStart()
  918. if in.IsNull() {
  919. if isTopLevel {
  920. in.Consumed()
  921. }
  922. in.Skip()
  923. return
  924. }
  925. in.Delim('{')
  926. for !in.IsDelim('}') {
  927. key := in.UnsafeFieldName(false)
  928. in.WantColon()
  929. if in.IsNull() {
  930. in.Skip()
  931. in.WantComma()
  932. continue
  933. }
  934. switch key {
  935. case "key":
  936. if in.IsNull() {
  937. in.Skip()
  938. out.Key = nil
  939. } else {
  940. if out.Key == nil {
  941. out.Key = new(IngAttemptKey)
  942. }
  943. (*out.Key).UnmarshalEasyJSON(in)
  944. }
  945. case "initiatingFrameId":
  946. (out.InitiatingFrameID).UnmarshalEasyJSON(in)
  947. case "prefetchUrl":
  948. out.PrefetchURL = string(in.String())
  949. case "status":
  950. (out.Status).UnmarshalEasyJSON(in)
  951. case "prefetchStatus":
  952. (out.PrefetchStatus).UnmarshalEasyJSON(in)
  953. case "requestId":
  954. out.RequestID = network.RequestID(in.String())
  955. default:
  956. in.SkipRecursive()
  957. }
  958. in.WantComma()
  959. }
  960. in.Delim('}')
  961. if isTopLevel {
  962. in.Consumed()
  963. }
  964. }
  965. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(out *jwriter.Writer, in EventPrefetchStatusUpdated) {
  966. out.RawByte('{')
  967. first := true
  968. _ = first
  969. {
  970. const prefix string = ",\"key\":"
  971. out.RawString(prefix[1:])
  972. if in.Key == nil {
  973. out.RawString("null")
  974. } else {
  975. (*in.Key).MarshalEasyJSON(out)
  976. }
  977. }
  978. {
  979. const prefix string = ",\"initiatingFrameId\":"
  980. out.RawString(prefix)
  981. out.String(string(in.InitiatingFrameID))
  982. }
  983. {
  984. const prefix string = ",\"prefetchUrl\":"
  985. out.RawString(prefix)
  986. out.String(string(in.PrefetchURL))
  987. }
  988. {
  989. const prefix string = ",\"status\":"
  990. out.RawString(prefix)
  991. (in.Status).MarshalEasyJSON(out)
  992. }
  993. {
  994. const prefix string = ",\"prefetchStatus\":"
  995. out.RawString(prefix)
  996. (in.PrefetchStatus).MarshalEasyJSON(out)
  997. }
  998. {
  999. const prefix string = ",\"requestId\":"
  1000. out.RawString(prefix)
  1001. out.String(string(in.RequestID))
  1002. }
  1003. out.RawByte('}')
  1004. }
  1005. // MarshalJSON supports json.Marshaler interface
  1006. func (v EventPrefetchStatusUpdated) MarshalJSON() ([]byte, error) {
  1007. w := jwriter.Writer{}
  1008. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(&w, v)
  1009. return w.Buffer.BuildBytes(), w.Error
  1010. }
  1011. // MarshalEasyJSON supports easyjson.Marshaler interface
  1012. func (v EventPrefetchStatusUpdated) MarshalEasyJSON(w *jwriter.Writer) {
  1013. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload9(w, v)
  1014. }
  1015. // UnmarshalJSON supports json.Unmarshaler interface
  1016. func (v *EventPrefetchStatusUpdated) UnmarshalJSON(data []byte) error {
  1017. r := jlexer.Lexer{Data: data}
  1018. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(&r, v)
  1019. return r.Error()
  1020. }
  1021. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  1022. func (v *EventPrefetchStatusUpdated) UnmarshalEasyJSON(l *jlexer.Lexer) {
  1023. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload9(l, v)
  1024. }
  1025. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(in *jlexer.Lexer, out *EnableParams) {
  1026. isTopLevel := in.IsStart()
  1027. if in.IsNull() {
  1028. if isTopLevel {
  1029. in.Consumed()
  1030. }
  1031. in.Skip()
  1032. return
  1033. }
  1034. in.Delim('{')
  1035. for !in.IsDelim('}') {
  1036. key := in.UnsafeFieldName(false)
  1037. in.WantColon()
  1038. if in.IsNull() {
  1039. in.Skip()
  1040. in.WantComma()
  1041. continue
  1042. }
  1043. switch key {
  1044. default:
  1045. in.SkipRecursive()
  1046. }
  1047. in.WantComma()
  1048. }
  1049. in.Delim('}')
  1050. if isTopLevel {
  1051. in.Consumed()
  1052. }
  1053. }
  1054. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(out *jwriter.Writer, in EnableParams) {
  1055. out.RawByte('{')
  1056. first := true
  1057. _ = first
  1058. out.RawByte('}')
  1059. }
  1060. // MarshalJSON supports json.Marshaler interface
  1061. func (v EnableParams) MarshalJSON() ([]byte, error) {
  1062. w := jwriter.Writer{}
  1063. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(&w, v)
  1064. return w.Buffer.BuildBytes(), w.Error
  1065. }
  1066. // MarshalEasyJSON supports easyjson.Marshaler interface
  1067. func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
  1068. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload10(w, v)
  1069. }
  1070. // UnmarshalJSON supports json.Unmarshaler interface
  1071. func (v *EnableParams) UnmarshalJSON(data []byte) error {
  1072. r := jlexer.Lexer{Data: data}
  1073. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(&r, v)
  1074. return r.Error()
  1075. }
  1076. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  1077. func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  1078. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload10(l, v)
  1079. }
  1080. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload11(in *jlexer.Lexer, out *DisableParams) {
  1081. isTopLevel := in.IsStart()
  1082. if in.IsNull() {
  1083. if isTopLevel {
  1084. in.Consumed()
  1085. }
  1086. in.Skip()
  1087. return
  1088. }
  1089. in.Delim('{')
  1090. for !in.IsDelim('}') {
  1091. key := in.UnsafeFieldName(false)
  1092. in.WantColon()
  1093. if in.IsNull() {
  1094. in.Skip()
  1095. in.WantComma()
  1096. continue
  1097. }
  1098. switch key {
  1099. default:
  1100. in.SkipRecursive()
  1101. }
  1102. in.WantComma()
  1103. }
  1104. in.Delim('}')
  1105. if isTopLevel {
  1106. in.Consumed()
  1107. }
  1108. }
  1109. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload11(out *jwriter.Writer, in DisableParams) {
  1110. out.RawByte('{')
  1111. first := true
  1112. _ = first
  1113. out.RawByte('}')
  1114. }
  1115. // MarshalJSON supports json.Marshaler interface
  1116. func (v DisableParams) MarshalJSON() ([]byte, error) {
  1117. w := jwriter.Writer{}
  1118. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload11(&w, v)
  1119. return w.Buffer.BuildBytes(), w.Error
  1120. }
  1121. // MarshalEasyJSON supports easyjson.Marshaler interface
  1122. func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) {
  1123. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPreload11(w, v)
  1124. }
  1125. // UnmarshalJSON supports json.Unmarshaler interface
  1126. func (v *DisableParams) UnmarshalJSON(data []byte) error {
  1127. r := jlexer.Lexer{Data: data}
  1128. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload11(&r, v)
  1129. return r.Error()
  1130. }
  1131. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  1132. func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  1133. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPreload11(l, v)
  1134. }