-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
browser(firefox): remove multisession logic #4039
Conversation
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(() => { |
There was a problem hiding this comment.
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}); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kill disconnect
This patch:
SimpleChannel
to buffer messages to the namespace thathasn't been registered yet. This allows us to create
SimpleChannel
per target on the browser side right away.
PageAgent
in thecontent process, which talks to a single
PageHandler
on the browserside. Both ends can be created as-soon-as-needed; thanks to
SimpleChannel
bufferring, no messages will be lost and all messageswill be delivered in proper order. (This is currently the reason why
build 1178 flakes on windows).
as they appear on the browser side.
NOTE: this doesn't yet remove sessions from protocol.
References #3995