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): simplify PageTarget lifecycle #4014

Merged

Conversation

aslushnikov
Copy link
Contributor

@aslushnikov aslushnikov commented Sep 30, 2020

As of today, we create PageTarget instances whenever we get a
sync IPC from the content process. This, however, breaks an invariant
that browserContext.pages always has all pages (and browsing contexts - not to be confused with browser contexts), associated with browser context. This invariant will be especially important when we move
user agent emulation to browser-side.

This patch makes PageTarget lifecycle symmetrical:

  • PageTarget instance is created when tab is opened
  • PageTarget is destroyed when tab is crashed or closed

Drive-by: straighten viewport management and put a nice descriptive comment.

As of today, we create `PageTarget` instances whenever we get a
sync IPC from the content process. This, however, breaks an invariant
that `browserContext.pages` always has all pages, associated with
browser context.

This patch makes `PageTarget` lifecycle symmetrical:
- `PageTarget` instance is created when tab is opened
- `PageTarget` is destroyed when tab is crashed or clsed
@aslushnikov aslushnikov merged commit e280839 into microsoft:master Sep 30, 2020
@aslushnikov aslushnikov deleted the fff-simple-lifecycle-for-page-targets branch September 30, 2020 09:10
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