Skip to content

Commit 76c71ca

Browse files
author
Jakub Kulhan
committed
autoupdated protocol.json & generated files
1 parent 373b601 commit 76c71ca

9 files changed

+348
-1
lines changed

gen-src/ChromeDevtoolsProtocol/Domain/PreloadDomain.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use ChromeDevtoolsProtocol\ContextInterface;
66
use ChromeDevtoolsProtocol\InternalClientInterface;
77
use ChromeDevtoolsProtocol\Model\Preload\PrefetchStatusUpdatedEvent;
8+
use ChromeDevtoolsProtocol\Model\Preload\PreloadingAttemptSourcesUpdatedEvent;
89
use ChromeDevtoolsProtocol\Model\Preload\PrerenderAttemptCompletedEvent;
910
use ChromeDevtoolsProtocol\Model\Preload\PrerenderStatusUpdatedEvent;
1011
use ChromeDevtoolsProtocol\Model\Preload\RuleSetRemovedEvent;
@@ -51,6 +52,20 @@ public function awaitPrefetchStatusUpdated(ContextInterface $ctx): PrefetchStatu
5152
}
5253

5354

55+
public function addPreloadingAttemptSourcesUpdatedListener(callable $listener): SubscriptionInterface
56+
{
57+
return $this->internalClient->addListener('Preload.preloadingAttemptSourcesUpdated', function ($event) use ($listener) {
58+
return $listener(PreloadingAttemptSourcesUpdatedEvent::fromJson($event));
59+
});
60+
}
61+
62+
63+
public function awaitPreloadingAttemptSourcesUpdated(ContextInterface $ctx): PreloadingAttemptSourcesUpdatedEvent
64+
{
65+
return PreloadingAttemptSourcesUpdatedEvent::fromJson($this->internalClient->awaitEvent($ctx, 'Preload.preloadingAttemptSourcesUpdated'));
66+
}
67+
68+
5469
public function addPrerenderAttemptCompletedListener(callable $listener): SubscriptionInterface
5570
{
5671
return $this->internalClient->addListener('Preload.prerenderAttemptCompleted', function ($event) use ($listener) {

gen-src/ChromeDevtoolsProtocol/Domain/PreloadDomainInterface.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use ChromeDevtoolsProtocol\ContextInterface;
66
use ChromeDevtoolsProtocol\Model\Preload\PrefetchStatusUpdatedEvent;
7+
use ChromeDevtoolsProtocol\Model\Preload\PreloadingAttemptSourcesUpdatedEvent;
78
use ChromeDevtoolsProtocol\Model\Preload\PrerenderAttemptCompletedEvent;
89
use ChromeDevtoolsProtocol\Model\Preload\PrerenderStatusUpdatedEvent;
910
use ChromeDevtoolsProtocol\Model\Preload\RuleSetRemovedEvent;
@@ -65,6 +66,30 @@ public function addPrefetchStatusUpdatedListener(callable $listener): Subscripti
6566
public function awaitPrefetchStatusUpdated(ContextInterface $ctx): PrefetchStatusUpdatedEvent;
6667

6768

69+
/**
70+
* Send a list of sources for all preloading attempts.
71+
*
72+
* Listener will be called whenever event Preload.preloadingAttemptSourcesUpdated is fired.
73+
*
74+
* @param callable $listener
75+
*
76+
* @return SubscriptionInterface
77+
*/
78+
public function addPreloadingAttemptSourcesUpdatedListener(callable $listener): SubscriptionInterface;
79+
80+
81+
/**
82+
* Send a list of sources for all preloading attempts.
83+
*
84+
* Method will block until first Preload.preloadingAttemptSourcesUpdated event is fired.
85+
*
86+
* @param ContextInterface $ctx
87+
*
88+
* @return PreloadingAttemptSourcesUpdatedEvent
89+
*/
90+
public function awaitPreloadingAttemptSourcesUpdated(ContextInterface $ctx): PreloadingAttemptSourcesUpdatedEvent;
91+
92+
6893
/**
6994
* Fired when a prerender attempt is completed.
7095
*
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\Preload;
4+
5+
/**
6+
* 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.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class PreloadingAttemptKey implements \JsonSerializable
13+
{
14+
/** @var string */
15+
public $loaderId;
16+
17+
/** @var string */
18+
public $action;
19+
20+
/** @var string */
21+
public $url;
22+
23+
/** @var string */
24+
public $targetHint;
25+
26+
27+
/**
28+
* @param object $data
29+
* @return static
30+
*/
31+
public static function fromJson($data)
32+
{
33+
$instance = new static();
34+
if (isset($data->loaderId)) {
35+
$instance->loaderId = (string)$data->loaderId;
36+
}
37+
if (isset($data->action)) {
38+
$instance->action = (string)$data->action;
39+
}
40+
if (isset($data->url)) {
41+
$instance->url = (string)$data->url;
42+
}
43+
if (isset($data->targetHint)) {
44+
$instance->targetHint = (string)$data->targetHint;
45+
}
46+
return $instance;
47+
}
48+
49+
50+
public function jsonSerialize()
51+
{
52+
$data = new \stdClass();
53+
if ($this->loaderId !== null) {
54+
$data->loaderId = $this->loaderId;
55+
}
56+
if ($this->action !== null) {
57+
$data->action = $this->action;
58+
}
59+
if ($this->url !== null) {
60+
$data->url = $this->url;
61+
}
62+
if ($this->targetHint !== null) {
63+
$data->targetHint = $this->targetHint;
64+
}
65+
return $data;
66+
}
67+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\Preload;
4+
5+
/**
6+
* 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 mulitple rule sets and links to trigger a single attempt.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class PreloadingAttemptSource implements \JsonSerializable
13+
{
14+
/** @var PreloadingAttemptKey */
15+
public $key;
16+
17+
/** @var string[] */
18+
public $ruleSetIds;
19+
20+
/** @var int[] */
21+
public $nodeIds;
22+
23+
24+
/**
25+
* @param object $data
26+
* @return static
27+
*/
28+
public static function fromJson($data)
29+
{
30+
$instance = new static();
31+
if (isset($data->key)) {
32+
$instance->key = PreloadingAttemptKey::fromJson($data->key);
33+
}
34+
if (isset($data->ruleSetIds)) {
35+
$instance->ruleSetIds = [];
36+
if (isset($data->ruleSetIds)) {
37+
$instance->ruleSetIds = [];
38+
foreach ($data->ruleSetIds as $item) {
39+
$instance->ruleSetIds[] = (string)$item;
40+
}
41+
}
42+
}
43+
if (isset($data->nodeIds)) {
44+
$instance->nodeIds = [];
45+
if (isset($data->nodeIds)) {
46+
$instance->nodeIds = [];
47+
foreach ($data->nodeIds as $item) {
48+
$instance->nodeIds[] = (int)$item;
49+
}
50+
}
51+
}
52+
return $instance;
53+
}
54+
55+
56+
public function jsonSerialize()
57+
{
58+
$data = new \stdClass();
59+
if ($this->key !== null) {
60+
$data->key = $this->key->jsonSerialize();
61+
}
62+
if ($this->ruleSetIds !== null) {
63+
$data->ruleSetIds = [];
64+
if ($this->ruleSetIds !== null) {
65+
$data->ruleSetIds = [];
66+
foreach ($this->ruleSetIds as $item) {
67+
$data->ruleSetIds[] = $item;
68+
}
69+
}
70+
}
71+
if ($this->nodeIds !== null) {
72+
$data->nodeIds = [];
73+
if ($this->nodeIds !== null) {
74+
$data->nodeIds = [];
75+
foreach ($this->nodeIds as $item) {
76+
$data->nodeIds[] = $item;
77+
}
78+
}
79+
}
80+
return $data;
81+
}
82+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\Preload;
4+
5+
/**
6+
* Send a list of sources for all preloading attempts.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class PreloadingAttemptSourcesUpdatedEvent implements \JsonSerializable
13+
{
14+
/** @var PreloadingAttemptSource[] */
15+
public $preloadingAttemptSources;
16+
17+
18+
/**
19+
* @param object $data
20+
* @return static
21+
*/
22+
public static function fromJson($data)
23+
{
24+
$instance = new static();
25+
if (isset($data->preloadingAttemptSources)) {
26+
$instance->preloadingAttemptSources = [];
27+
foreach ($data->preloadingAttemptSources as $item) {
28+
$instance->preloadingAttemptSources[] = PreloadingAttemptSource::fromJson($item);
29+
}
30+
}
31+
return $instance;
32+
}
33+
34+
35+
public function jsonSerialize()
36+
{
37+
$data = new \stdClass();
38+
if ($this->preloadingAttemptSources !== null) {
39+
$data->preloadingAttemptSources = [];
40+
foreach ($this->preloadingAttemptSources as $item) {
41+
$data->preloadingAttemptSources[] = $item->jsonSerialize();
42+
}
43+
}
44+
return $data;
45+
}
46+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\Preload;
4+
5+
/**
6+
* The type of preloading attempted. It corresponds to mojom::SpeculationAction (although PrefetchWithSubresources is omitted as it isn't being used by clients).
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class SpeculationActionEnum
13+
{
14+
public const PREFETCH = 'Prefetch';
15+
public const PRERENDER = 'Prerender';
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\Preload;
4+
5+
/**
6+
* Corresponds to mojom::SpeculationTargetHint. See https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class SpeculationTargetHintEnum
13+
{
14+
public const BLANK = 'Blank';
15+
public const SELF = 'Self';
16+
}

protocol.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20905,6 +20905,73 @@
2090520905
}
2090620906
]
2090720907
},
20908+
{
20909+
"id": "SpeculationAction",
20910+
"description": "The type of preloading attempted. It corresponds to mojom::SpeculationAction (although PrefetchWithSubresources is omitted as it isn't being used by clients).",
20911+
"type": "string",
20912+
"enum": [
20913+
"Prefetch",
20914+
"Prerender"
20915+
]
20916+
},
20917+
{
20918+
"id": "SpeculationTargetHint",
20919+
"description": "Corresponds to mojom::SpeculationTargetHint. See https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints",
20920+
"type": "string",
20921+
"enum": [
20922+
"Blank",
20923+
"Self"
20924+
]
20925+
},
20926+
{
20927+
"id": "PreloadingAttemptKey",
20928+
"description": "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.",
20929+
"type": "object",
20930+
"properties": [
20931+
{
20932+
"name": "loaderId",
20933+
"$ref": "Network.LoaderId"
20934+
},
20935+
{
20936+
"name": "action",
20937+
"$ref": "SpeculationAction"
20938+
},
20939+
{
20940+
"name": "url",
20941+
"type": "string"
20942+
},
20943+
{
20944+
"name": "targetHint",
20945+
"optional": true,
20946+
"$ref": "SpeculationTargetHint"
20947+
}
20948+
]
20949+
},
20950+
{
20951+
"id": "PreloadingAttemptSource",
20952+
"description": "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 mulitple rule sets and links to trigger a single attempt.",
20953+
"type": "object",
20954+
"properties": [
20955+
{
20956+
"name": "key",
20957+
"$ref": "PreloadingAttemptKey"
20958+
},
20959+
{
20960+
"name": "ruleSetIds",
20961+
"type": "array",
20962+
"items": {
20963+
"$ref": "RuleSetId"
20964+
}
20965+
},
20966+
{
20967+
"name": "nodeIds",
20968+
"type": "array",
20969+
"items": {
20970+
"$ref": "DOM.BackendNodeId"
20971+
}
20972+
}
20973+
]
20974+
},
2090820975
{
2090920976
"id": "PrerenderFinalStatus",
2091020977
"description": "List of FinalStatus reasons for Prerender2.",
@@ -21010,6 +21077,19 @@
2101021077
}
2101121078
]
2101221079
},
21080+
{
21081+
"name": "preloadingAttemptSourcesUpdated",
21082+
"description": "Send a list of sources for all preloading attempts.",
21083+
"parameters": [
21084+
{
21085+
"name": "preloadingAttemptSources",
21086+
"type": "array",
21087+
"items": {
21088+
"$ref": "PreloadingAttemptSource"
21089+
}
21090+
}
21091+
]
21092+
},
2101321093
{
2101421094
"name": "prerenderAttemptCompleted",
2101521095
"description": "Fired when a prerender attempt is completed.",

protocol.json.md5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3705f524df530a4096553e607078eddb protocol.json
1+
55fb4d34bf407d80b433247717d0151f protocol.json

0 commit comments

Comments
 (0)