refactor: rename secondary page to speculative session (#10817)

This commit is contained in:
Alex Rudenko 2023-08-30 15:07:11 +02:00 committed by GitHub
parent 8233f61a45
commit a9446f3d43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -43,7 +43,7 @@ export class EmulationManager {
this.#secondaryClients.delete(client);
}
async registerSecondaryPage(client: CDPSession): Promise<void> {
async registerSpeculativeSession(client: CDPSession): Promise<void> {
this.#secondaryClients.add(client);
await this.#applyViewport(client);
client.once(CDPSessionEmittedEvents.Disconnected, () => {

View File

@ -182,7 +182,7 @@ export class FrameManager extends EventEmitter {
}
}
async registerSecondaryPage(client: CDPSessionImpl): Promise<void> {
async registerSpeculativeSession(client: CDPSessionImpl): Promise<void> {
await this.#networkManager.addClient(client);
}

View File

@ -266,8 +266,12 @@ export class CDPPage extends Page {
if (session._target()._subtype() !== 'prerender') {
return;
}
this.#frameManager.registerSecondaryPage(session).catch(debugError);
this.#emulationManager.registerSecondaryPage(session).catch(debugError);
this.#frameManager
.registerSpeculativeSession(session)
.catch(debugError);
this.#emulationManager
.registerSpeculativeSession(session)
.catch(debugError);
}
);
}