Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser(firefox): remove multisession logic #4039

Merged

Conversation

aslushnikov
Copy link
Collaborator

@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
@@ -70,6 +71,14 @@ class SimpleChannel {
if (this._handlers.has(namespace))
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
Collaborator 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!

@@ -128,8 +127,10 @@ class BrowserHandler {
}

async newPage({browserContextId}) {
const targetId = await this._targetRegistry.newPage({browserContextId});
return {targetId};
const target = await this._targetRegistry.newPage({browserContextId});
Copy link
Collaborator 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
Collaborator 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