Skip to content

Commit e179f29

Browse files
author
Jakub Kulhan
committed
autoupdated protocol.json & generated files
1 parent 365e323 commit e179f29

File tree

6 files changed

+130
-6
lines changed

6 files changed

+130
-6
lines changed

gen-src/ChromeDevtoolsProtocol/Domain/PageDomain.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
use ChromeDevtoolsProtocol\Model\Page\NavigatedWithinDocumentEvent;
6464
use ChromeDevtoolsProtocol\Model\Page\PrefetchStatusUpdatedEvent;
6565
use ChromeDevtoolsProtocol\Model\Page\PrerenderAttemptCompletedEvent;
66+
use ChromeDevtoolsProtocol\Model\Page\PrerenderStatusUpdatedEvent;
6667
use ChromeDevtoolsProtocol\Model\Page\PrintToPDFRequest;
6768
use ChromeDevtoolsProtocol\Model\Page\PrintToPDFResponse;
6869
use ChromeDevtoolsProtocol\Model\Page\ProduceCompilationCacheRequest;
@@ -872,6 +873,20 @@ public function awaitPrerenderAttemptCompleted(ContextInterface $ctx): Prerender
872873
}
873874

874875

876+
public function addPrerenderStatusUpdatedListener(callable $listener): SubscriptionInterface
877+
{
878+
return $this->internalClient->addListener('Page.prerenderStatusUpdated', function ($event) use ($listener) {
879+
return $listener(PrerenderStatusUpdatedEvent::fromJson($event));
880+
});
881+
}
882+
883+
884+
public function awaitPrerenderStatusUpdated(ContextInterface $ctx): PrerenderStatusUpdatedEvent
885+
{
886+
return PrerenderStatusUpdatedEvent::fromJson($this->internalClient->awaitEvent($ctx, 'Page.prerenderStatusUpdated'));
887+
}
888+
889+
875890
public function addScreencastFrameListener(callable $listener): SubscriptionInterface
876891
{
877892
return $this->internalClient->addListener('Page.screencastFrame', function ($event) use ($listener) {

gen-src/ChromeDevtoolsProtocol/Domain/PageDomainInterface.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
use ChromeDevtoolsProtocol\Model\Page\NavigatedWithinDocumentEvent;
6363
use ChromeDevtoolsProtocol\Model\Page\PrefetchStatusUpdatedEvent;
6464
use ChromeDevtoolsProtocol\Model\Page\PrerenderAttemptCompletedEvent;
65+
use ChromeDevtoolsProtocol\Model\Page\PrerenderStatusUpdatedEvent;
6566
use ChromeDevtoolsProtocol\Model\Page\PrintToPDFRequest;
6667
use ChromeDevtoolsProtocol\Model\Page\PrintToPDFResponse;
6768
use ChromeDevtoolsProtocol\Model\Page\ProduceCompilationCacheRequest;
@@ -1360,6 +1361,30 @@ public function addPrerenderAttemptCompletedListener(callable $listener): Subscr
13601361
public function awaitPrerenderAttemptCompleted(ContextInterface $ctx): PrerenderAttemptCompletedEvent;
13611362

13621363

1364+
/**
1365+
* TODO(crbug/1384419): Create a dedicated domain for preloading. Fired when a prerender attempt is updated.
1366+
*
1367+
* Listener will be called whenever event Page.prerenderStatusUpdated is fired.
1368+
*
1369+
* @param callable $listener
1370+
*
1371+
* @return SubscriptionInterface
1372+
*/
1373+
public function addPrerenderStatusUpdatedListener(callable $listener): SubscriptionInterface;
1374+
1375+
1376+
/**
1377+
* TODO(crbug/1384419): Create a dedicated domain for preloading. Fired when a prerender attempt is updated.
1378+
*
1379+
* Method will block until first Page.prerenderStatusUpdated event is fired.
1380+
*
1381+
* @param ContextInterface $ctx
1382+
*
1383+
* @return PrerenderStatusUpdatedEvent
1384+
*/
1385+
public function awaitPrerenderStatusUpdated(ContextInterface $ctx): PrerenderStatusUpdatedEvent;
1386+
1387+
13631388
/**
13641389
* Compressed image data requested by the `startScreencast`.
13651390
*

gen-src/ChromeDevtoolsProtocol/Model/Page/PrefetchStatusEnum.php renamed to gen-src/ChromeDevtoolsProtocol/Model/Page/PreloadingStatusEnum.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
namespace ChromeDevtoolsProtocol\Model\Page;
44

55
/**
6-
* List of Prefetch status, which refers to PreloadingTriggeringOutcome.
6+
* Preloading status values, see also PreloadingTriggeringOutcome. This status is shared by prefetchStatusUpdated and prerenderStatusUpdated.
77
*
88
* @generated This file has been auto-generated, do not edit.
99
*
1010
* @author Jakub Kulhan <[email protected]>
1111
*/
12-
final class PrefetchStatusEnum
12+
final class PreloadingStatusEnum
1313
{
14+
public const PENDING = 'Pending';
1415
public const RUNNING = 'Running';
1516
public const READY = 'Ready';
1617
public const SUCCESS = 'Success';
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\Page;
4+
5+
/**
6+
* TODO(crbug/1384419): Create a dedicated domain for preloading. Fired when a prerender attempt is updated.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class PrerenderStatusUpdatedEvent implements \JsonSerializable
13+
{
14+
/**
15+
* The frame id of the frame initiating prerender.
16+
*
17+
* @var string
18+
*/
19+
public $initiatingFrameId;
20+
21+
/** @var string */
22+
public $prerenderingUrl;
23+
24+
/** @var string */
25+
public $status;
26+
27+
28+
/**
29+
* @param object $data
30+
* @return static
31+
*/
32+
public static function fromJson($data)
33+
{
34+
$instance = new static();
35+
if (isset($data->initiatingFrameId)) {
36+
$instance->initiatingFrameId = (string)$data->initiatingFrameId;
37+
}
38+
if (isset($data->prerenderingUrl)) {
39+
$instance->prerenderingUrl = (string)$data->prerenderingUrl;
40+
}
41+
if (isset($data->status)) {
42+
$instance->status = (string)$data->status;
43+
}
44+
return $instance;
45+
}
46+
47+
48+
public function jsonSerialize()
49+
{
50+
$data = new \stdClass();
51+
if ($this->initiatingFrameId !== null) {
52+
$data->initiatingFrameId = $this->initiatingFrameId;
53+
}
54+
if ($this->prerenderingUrl !== null) {
55+
$data->prerenderingUrl = $this->prerenderingUrl;
56+
}
57+
if ($this->status !== null) {
58+
$data->status = $this->status;
59+
}
60+
return $data;
61+
}
62+
}

protocol.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18981,10 +18981,11 @@
1898118981
]
1898218982
},
1898318983
{
18984-
"id": "PrefetchStatus",
18985-
"description": "List of Prefetch status, which refers to PreloadingTriggeringOutcome.",
18984+
"id": "PreloadingStatus",
18985+
"description": "Preloading status values, see also PreloadingTriggeringOutcome. This status is shared by prefetchStatusUpdated and prerenderStatusUpdated.",
1898618986
"type": "string",
1898718987
"enum": [
18988+
"Pending",
1898818989
"Running",
1898918990
"Ready",
1899018991
"Success",
@@ -20623,7 +20624,7 @@
2062320624
},
2062420625
{
2062520626
"name": "status",
20626-
"$ref": "PrefetchStatus"
20627+
"$ref": "PreloadingStatus"
2062720628
}
2062820629
]
2062920630
},
@@ -20653,6 +20654,26 @@
2065320654
}
2065420655
]
2065520656
},
20657+
{
20658+
"name": "prerenderStatusUpdated",
20659+
"description": "TODO(crbug/1384419): Create a dedicated domain for preloading. Fired when a prerender attempt is updated.",
20660+
"experimental": true,
20661+
"parameters": [
20662+
{
20663+
"name": "initiatingFrameId",
20664+
"description": "The frame id of the frame initiating prerender.",
20665+
"$ref": "FrameId"
20666+
},
20667+
{
20668+
"name": "prerenderingUrl",
20669+
"type": "string"
20670+
},
20671+
{
20672+
"name": "status",
20673+
"$ref": "PreloadingStatus"
20674+
}
20675+
]
20676+
},
2065620677
{
2065720678
"name": "screencastFrame",
2065820679
"description": "Compressed image data requested by the `startScreencast`.",

protocol.json.md5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1e31a7ee83ba968481a98e50bff3e76e protocol.json
1+
506e354a921917d07e6468551b699bd1 protocol.json

0 commit comments

Comments
 (0)