Skip to content

Conversation

@aslushnikov
Copy link
Contributor

@aslushnikov aslushnikov commented Oct 2, 2020

This patch:

  1. Changes SimpleChannel to buffer messages to the namespace that
    hasn't been registered yet. This allows us to create SimpleChannel
    per target on the browser side right away.
  2. Removes multisession support. Now there's only one PageAgent in the
    content process, which talks to a single PageHandler on the browser
    side. Both ends can be created as-soon-as-needed; thanks to
    SimpleChannel bufferring, no messages will be lost and all messages
    will be delivered in proper order. (This is currently the reason why
    build 1178 flakes on windows).
  3. Straightens up the target reporting. Targets are reported as soon
    as they appear on the browser side.

NOTE: this doesn't yet remove sessions from protocol.

References #3995

This patch:
1. Changes `SimpleChannel` to buffer messages to the namespace that
   hasn't been registered yet. This allows us to create `SimpleChannel`
   per target on the browser side right away.
2. Removes multisession support. Now there's only one `PageAgent` in the
   content process, which talks to a single `PageHandler` on the browser
   side. Both ends can be created as-soon-as-needed; thanks to
   `SimpleChannel` bufferring, no messages will be lost and all messages
   will be delivered in proper order. (This is currently the reason why
   build 1178 flakes on windows).
3. Straightens up the target reporting. Targets are reported as soon
   as they appear on the browser side.

References microsoft#3995
throw new Error('ERROR: double-register for namespace ' + namespace);
this._handlers.set(namespace, handler);
// Try to re-deliver all pending messages.
Promise.resolve().then(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do an explicit method instead: ready!

async newPage({browserContextId}) {
const targetId = await this._targetRegistry.newPage({browserContextId});
return {targetId};
const target = await this._targetRegistry.newPage({browserContextId});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this back

disconnectSession(session) {
if (!this._disposed)
this._channel.connect('').emit('detach', { sessionId: session.sessionId() });
async disconnectSession(session) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kill disconnect

@aslushnikov aslushnikov merged commit 2c11b10 into microsoft:master Oct 2, 2020
@aslushnikov aslushnikov deleted the fff-drastically-simplify-life branch October 2, 2020 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants