Closed Bug 1698129 Opened 3 years ago Closed 3 years ago

Replace the BrowsingContextId with BrowserId in the profiler

Categories

(Core :: Gecko Profiler, defect, P2)

defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox88 --- wontfix
firefox89 --- fixed

People

(Reporter: canova, Assigned: canova)

References

()

Details

(Whiteboard: [not-a-fission-bug])

Attachments

(3 files)

Currently we record all the navigations inside the profiler to see which JS frame/marker belongs to the tab we are profiling. We are recording the innerWindowId and BrowsingContextId. innerWindowId serves us well to understand each "frame", but we were using the BrowsingContextId to determine which tab that frame belongs to, like a tab ID. It wasn't exactly a tab ID, but that was the closest ID we can get that resembles the tab ID back then.

But, because it wasn't exactly a tab ID, it started to create us some problems. For example, if you navigate from the preloaded about:newtab to a web page, BrowserContext is being replaced, and therefore the ID changes. This is happening because BrowsingContext is being replaced on cross-group navigations. That behavior makes it impossible to use it as a "tab ID". Also, it looks like, as a part of fission work, they are going to replace the BrowsingContext for most of the navigations soon. So, we need to stop using BrowsingContextId soon.

As a solution, there is BrowserId now that we can use inside the BrowserContext. That corresponds directly to Tab Id. We should replace the browsingContextID with this number instead soon.

This will require a version bump and an upgrader in the profiler front-end.

Whiteboard: [not-a-fission-bug]

This patch is only about renaming the internals of the profiler codebase and
it doesn't touch any parts that requires a backwards compatibility or version
bump.

We have two parts in the codebase that we get the browsingContextId.

  1. Inside the DOM code with profiler_register_page function whenever a
    navigation happens.
  2. Inside the profiler recording front-end when we start the profiler. That was
    kept as activeBrowsingContextID, and now it's kept as activeTabID.

We are now changing these parts to keep the browserId instead so it directly
corresponds to the tabs. BrowsingContexts are replaced when there is a
cross-group navigation, but BrowserId is being preserved.

Depends on D109280

Lastly, we are changing the parts that requires a version bump and bumping the
profiler version in the end. This will require a PR in the front-end for a
version upgrader and changes related to the renaming.

Depends on D109281

Assignee: nobody → canaltinova
Status: NEW → ASSIGNED
Attachment #9210677 - Attachment description: Bug 1698129 - Rename browsingContextID to tabID inside the profiler codebase → WIP: Bug 1698129 - Rename browsingContextID to tabID inside the profiler codebase
Attachment #9210678 - Attachment description: Bug 1698129 - Change the tabID sources from browsingContextId to browserId in the profiler → WIP: Bug 1698129 - Change the tabID sources from browsingContextId to browserId in the profiler
Attachment #9210679 - Attachment description: Bug 1698129 - Rename the profiler browsingContextID outputs to tabID and bump the profile version → WIP: Bug 1698129 - Rename the profiler browsingContextID outputs to tabID and bump the profile version
Attachment #9210677 - Attachment description: WIP: Bug 1698129 - Rename browsingContextID to tabID inside the profiler codebase → Bug 1698129 - Rename browsingContextID to tabID inside the profiler codebase r=julienw,gerald
Attachment #9210678 - Attachment description: WIP: Bug 1698129 - Change the tabID sources from browsingContextId to browserId in the profiler → Bug 1698129 - Change the tabID sources from browsingContextId to browserId in the profiler r=nika,julienw
Attachment #9210679 - Attachment description: WIP: Bug 1698129 - Rename the profiler browsingContextID outputs to tabID and bump the profile version → Bug 1698129 - Rename the profiler browsingContextID outputs to tabID and bump the profile version r=gerald
Pushed by canaltinova@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/eb3f01499fba
Rename browsingContextID to tabID inside the profiler codebase r=julienw,gerald,devtools-backward-compat-reviewers
https://hg.mozilla.org/integration/autoland/rev/0a1c5a2bcfcc
Change the tabID sources from browsingContextId to browserId in the profiler r=nika,julienw
https://hg.mozilla.org/integration/autoland/rev/6438321cd013
Rename the profiler browsingContextID outputs to tabID and bump the profile version r=gerald
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: