Skip to content

Commit 68e69c4

Browse files
author
Jakub Kulhan
committed
autoupdated protocol.json & generated files
1 parent a7ffc2e commit 68e69c4

18 files changed

+1050
-1
lines changed

gen-src/ChromeDevtoolsProtocol/DevtoolsClientInterface.php

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

55
use ChromeDevtoolsProtocol\Domain\AccessibilityDomainInterface;
66
use ChromeDevtoolsProtocol\Domain\AnimationDomainInterface;
7+
use ChromeDevtoolsProtocol\Domain\ApplicationCacheDomainInterface;
78
use ChromeDevtoolsProtocol\Domain\AuditsDomainInterface;
89
use ChromeDevtoolsProtocol\Domain\BackgroundServiceDomainInterface;
910
use ChromeDevtoolsProtocol\Domain\BrowserDomainInterface;
@@ -73,6 +74,14 @@ public function accessibility(): AccessibilityDomainInterface;
7374
public function animation(): AnimationDomainInterface;
7475

7576

77+
/**
78+
* The domain is deprecated as AppCache is being removed (see crbug.com/582750).
79+
*
80+
* @experimental
81+
*/
82+
public function applicationCache(): ApplicationCacheDomainInterface;
83+
84+
7685
/**
7786
* Audits domain allows investigation of page violations and possible improvements.
7887
*

gen-src/ChromeDevtoolsProtocol/DevtoolsClientTrait.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
use ChromeDevtoolsProtocol\Domain\AccessibilityDomainInterface;
77
use ChromeDevtoolsProtocol\Domain\AnimationDomain;
88
use ChromeDevtoolsProtocol\Domain\AnimationDomainInterface;
9+
use ChromeDevtoolsProtocol\Domain\ApplicationCacheDomain;
10+
use ChromeDevtoolsProtocol\Domain\ApplicationCacheDomainInterface;
911
use ChromeDevtoolsProtocol\Domain\AuditsDomain;
1012
use ChromeDevtoolsProtocol\Domain\AuditsDomainInterface;
1113
use ChromeDevtoolsProtocol\Domain\BackgroundServiceDomain;
@@ -123,6 +125,18 @@ public function animation(): AnimationDomainInterface
123125
}
124126

125127

128+
public function applicationCache(): ApplicationCacheDomainInterface
129+
{
130+
if (!isset($this->domains['ApplicationCache'])) {
131+
/** @var InternalClientInterface $this */
132+
$this->domains['ApplicationCache'] = new ApplicationCacheDomain($this);
133+
}
134+
/** @var ApplicationCacheDomainInterface $domain */
135+
$domain = $this->domains['ApplicationCache'];
136+
return $domain;
137+
}
138+
139+
126140
public function audits(): AuditsDomainInterface
127141
{
128142
if (!isset($this->domains['Audits'])) {
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Domain;
4+
5+
use ChromeDevtoolsProtocol\ContextInterface;
6+
use ChromeDevtoolsProtocol\InternalClientInterface;
7+
use ChromeDevtoolsProtocol\Model\ApplicationCache\ApplicationCacheStatusUpdatedEvent;
8+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetApplicationCacheForFrameRequest;
9+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetApplicationCacheForFrameResponse;
10+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetFramesWithManifestsResponse;
11+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetManifestForFrameRequest;
12+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetManifestForFrameResponse;
13+
use ChromeDevtoolsProtocol\Model\ApplicationCache\NetworkStateUpdatedEvent;
14+
use ChromeDevtoolsProtocol\SubscriptionInterface;
15+
16+
class ApplicationCacheDomain implements ApplicationCacheDomainInterface
17+
{
18+
/** @var InternalClientInterface */
19+
public $internalClient;
20+
21+
22+
public function __construct(InternalClientInterface $internalClient)
23+
{
24+
$this->internalClient = $internalClient;
25+
}
26+
27+
28+
public function enable(ContextInterface $ctx): void
29+
{
30+
$request = new \stdClass();
31+
$this->internalClient->executeCommand($ctx, 'ApplicationCache.enable', $request);
32+
}
33+
34+
35+
public function getApplicationCacheForFrame(
36+
ContextInterface $ctx,
37+
GetApplicationCacheForFrameRequest $request
38+
): GetApplicationCacheForFrameResponse {
39+
$response = $this->internalClient->executeCommand($ctx, 'ApplicationCache.getApplicationCacheForFrame', $request);
40+
return GetApplicationCacheForFrameResponse::fromJson($response);
41+
}
42+
43+
44+
public function getFramesWithManifests(ContextInterface $ctx): GetFramesWithManifestsResponse
45+
{
46+
$request = new \stdClass();
47+
$response = $this->internalClient->executeCommand($ctx, 'ApplicationCache.getFramesWithManifests', $request);
48+
return GetFramesWithManifestsResponse::fromJson($response);
49+
}
50+
51+
52+
public function getManifestForFrame(
53+
ContextInterface $ctx,
54+
GetManifestForFrameRequest $request
55+
): GetManifestForFrameResponse {
56+
$response = $this->internalClient->executeCommand($ctx, 'ApplicationCache.getManifestForFrame', $request);
57+
return GetManifestForFrameResponse::fromJson($response);
58+
}
59+
60+
61+
public function addApplicationCacheStatusUpdatedListener(callable $listener): SubscriptionInterface
62+
{
63+
return $this->internalClient->addListener('ApplicationCache.applicationCacheStatusUpdated', function ($event) use ($listener) {
64+
return $listener(ApplicationCacheStatusUpdatedEvent::fromJson($event));
65+
});
66+
}
67+
68+
69+
public function awaitApplicationCacheStatusUpdated(ContextInterface $ctx): ApplicationCacheStatusUpdatedEvent
70+
{
71+
return ApplicationCacheStatusUpdatedEvent::fromJson($this->internalClient->awaitEvent($ctx, 'ApplicationCache.applicationCacheStatusUpdated'));
72+
}
73+
74+
75+
public function addNetworkStateUpdatedListener(callable $listener): SubscriptionInterface
76+
{
77+
return $this->internalClient->addListener('ApplicationCache.networkStateUpdated', function ($event) use ($listener) {
78+
return $listener(NetworkStateUpdatedEvent::fromJson($event));
79+
});
80+
}
81+
82+
83+
public function awaitNetworkStateUpdated(ContextInterface $ctx): NetworkStateUpdatedEvent
84+
{
85+
return NetworkStateUpdatedEvent::fromJson($this->internalClient->awaitEvent($ctx, 'ApplicationCache.networkStateUpdated'));
86+
}
87+
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Domain;
4+
5+
use ChromeDevtoolsProtocol\ContextInterface;
6+
use ChromeDevtoolsProtocol\Model\ApplicationCache\ApplicationCacheStatusUpdatedEvent;
7+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetApplicationCacheForFrameRequest;
8+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetApplicationCacheForFrameResponse;
9+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetFramesWithManifestsResponse;
10+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetManifestForFrameRequest;
11+
use ChromeDevtoolsProtocol\Model\ApplicationCache\GetManifestForFrameResponse;
12+
use ChromeDevtoolsProtocol\Model\ApplicationCache\NetworkStateUpdatedEvent;
13+
use ChromeDevtoolsProtocol\SubscriptionInterface;
14+
15+
/**
16+
* The domain is deprecated as AppCache is being removed (see crbug.com/582750).
17+
*
18+
* @experimental
19+
*
20+
* @generated This file has been auto-generated, do not edit.
21+
*
22+
* @author Jakub Kulhan <[email protected]>
23+
*/
24+
interface ApplicationCacheDomainInterface
25+
{
26+
/**
27+
* Enables application cache domain notifications.
28+
*
29+
* @param ContextInterface $ctx
30+
*
31+
* @return void
32+
*/
33+
public function enable(ContextInterface $ctx): void;
34+
35+
36+
/**
37+
* Returns relevant application cache data for the document in given frame.
38+
*
39+
* @param ContextInterface $ctx
40+
* @param GetApplicationCacheForFrameRequest $request
41+
*
42+
* @return GetApplicationCacheForFrameResponse
43+
*/
44+
public function getApplicationCacheForFrame(
45+
ContextInterface $ctx,
46+
GetApplicationCacheForFrameRequest $request
47+
): GetApplicationCacheForFrameResponse;
48+
49+
50+
/**
51+
* Returns array of frame identifiers with manifest urls for each frame containing a document associated with some application cache.
52+
*
53+
* @param ContextInterface $ctx
54+
*
55+
* @return GetFramesWithManifestsResponse
56+
*/
57+
public function getFramesWithManifests(ContextInterface $ctx): GetFramesWithManifestsResponse;
58+
59+
60+
/**
61+
* Returns manifest URL for document in the given frame.
62+
*
63+
* @param ContextInterface $ctx
64+
* @param GetManifestForFrameRequest $request
65+
*
66+
* @return GetManifestForFrameResponse
67+
*/
68+
public function getManifestForFrame(
69+
ContextInterface $ctx,
70+
GetManifestForFrameRequest $request
71+
): GetManifestForFrameResponse;
72+
73+
74+
/**
75+
* Subscribe to ApplicationCache.applicationCacheStatusUpdated event.
76+
*
77+
* Listener will be called whenever event ApplicationCache.applicationCacheStatusUpdated is fired.
78+
*
79+
* @param callable $listener
80+
*
81+
* @return SubscriptionInterface
82+
*/
83+
public function addApplicationCacheStatusUpdatedListener(callable $listener): SubscriptionInterface;
84+
85+
86+
/**
87+
* Wait for ApplicationCache.applicationCacheStatusUpdated event.
88+
*
89+
* Method will block until first ApplicationCache.applicationCacheStatusUpdated event is fired.
90+
*
91+
* @param ContextInterface $ctx
92+
*
93+
* @return ApplicationCacheStatusUpdatedEvent
94+
*/
95+
public function awaitApplicationCacheStatusUpdated(ContextInterface $ctx): ApplicationCacheStatusUpdatedEvent;
96+
97+
98+
/**
99+
* Subscribe to ApplicationCache.networkStateUpdated event.
100+
*
101+
* Listener will be called whenever event ApplicationCache.networkStateUpdated is fired.
102+
*
103+
* @param callable $listener
104+
*
105+
* @return SubscriptionInterface
106+
*/
107+
public function addNetworkStateUpdatedListener(callable $listener): SubscriptionInterface;
108+
109+
110+
/**
111+
* Wait for ApplicationCache.networkStateUpdated event.
112+
*
113+
* Method will block until first ApplicationCache.networkStateUpdated event is fired.
114+
*
115+
* @param ContextInterface $ctx
116+
*
117+
* @return NetworkStateUpdatedEvent
118+
*/
119+
public function awaitNetworkStateUpdated(ContextInterface $ctx): NetworkStateUpdatedEvent;
120+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\ApplicationCache;
4+
5+
/**
6+
* Detailed application cache information.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class ApplicationCache implements \JsonSerializable
13+
{
14+
/**
15+
* Manifest URL.
16+
*
17+
* @var string
18+
*/
19+
public $manifestURL;
20+
21+
/**
22+
* Application cache size.
23+
*
24+
* @var int|float
25+
*/
26+
public $size;
27+
28+
/**
29+
* Application cache creation time.
30+
*
31+
* @var int|float
32+
*/
33+
public $creationTime;
34+
35+
/**
36+
* Application cache update time.
37+
*
38+
* @var int|float
39+
*/
40+
public $updateTime;
41+
42+
/**
43+
* Application cache resources.
44+
*
45+
* @var ApplicationCacheResource[]
46+
*/
47+
public $resources;
48+
49+
50+
public static function fromJson($data)
51+
{
52+
$instance = new static();
53+
if (isset($data->manifestURL)) {
54+
$instance->manifestURL = (string)$data->manifestURL;
55+
}
56+
if (isset($data->size)) {
57+
$instance->size = $data->size;
58+
}
59+
if (isset($data->creationTime)) {
60+
$instance->creationTime = $data->creationTime;
61+
}
62+
if (isset($data->updateTime)) {
63+
$instance->updateTime = $data->updateTime;
64+
}
65+
if (isset($data->resources)) {
66+
$instance->resources = [];
67+
foreach ($data->resources as $item) {
68+
$instance->resources[] = ApplicationCacheResource::fromJson($item);
69+
}
70+
}
71+
return $instance;
72+
}
73+
74+
75+
public function jsonSerialize()
76+
{
77+
$data = new \stdClass();
78+
if ($this->manifestURL !== null) {
79+
$data->manifestURL = $this->manifestURL;
80+
}
81+
if ($this->size !== null) {
82+
$data->size = $this->size;
83+
}
84+
if ($this->creationTime !== null) {
85+
$data->creationTime = $this->creationTime;
86+
}
87+
if ($this->updateTime !== null) {
88+
$data->updateTime = $this->updateTime;
89+
}
90+
if ($this->resources !== null) {
91+
$data->resources = [];
92+
foreach ($this->resources as $item) {
93+
$data->resources[] = $item->jsonSerialize();
94+
}
95+
}
96+
return $data;
97+
}
98+
}

0 commit comments

Comments
 (0)