Closed Bug 1583271 Opened 5 years ago Closed 5 years ago

Change the ID fields of PageInformation class to properly refer to pages

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: canova, Assigned: canova)

References

Details

Attachments

(4 files)

Currently we are keeping mDocShellId and mDocShellHistoryId to refer to a PageInformation. That sort of works for now but it's not gonna work after fission. So we need to change those fields to keep Browsing Context ID and Inner Window ID. That way we won't need to keep a pair to refer from markers and samples too.

Summary: Change the ID fields of PageInformation class to properly refer the pages → Change the ID fields of PageInformation class to properly refer to pages

We were keeping nsDocShell::mHistoryId and nsDocShell::mOSHE as keys. They
weren't quite good because:

  1. While loading an iframe, they were being registered twice with the same
    ids(for about:blank and the real URL) sometimes.
  2. It wasn't possible to access to the parent mHistoryId and mOSHE from a child
    processes if the parent is in a different process. That may not be the case for
    now, but it will be after fission.
    So we had to find other IDs to:
  3. Determine the Tab of the frames.
  4. Determine the URLs of the frames.
    For the first use case, we were using nsDocShell::mHistoryId for that purpose
    but that was wrong. The closest thing that we can get to a tab ID is
    BrowsingContext ID because they don't change after a navigation. But iframes
    have different BrowsingContext's, so we still need to create a tree to
    construct a tab content. That can be either in the front-end or capture time.
    For the second use case, we were using a key pair of mHistoryId and mOSHE. We
    now chose to keep inner window IDs for that purpose. Inner window IDs are
    unique for each navigation loads because inner window correspond to each JS
    window global objects. That's why we can use that without any problem. But one
    problem is that we cannot handle history.pushState and history.replaceState
    changes with that change since window global objects won't change during those.
    But that was the best thing we can do after fission. So this will be a small
    sacrifice for us to keep that functionality working after fission.
    In that patch we also remove the registration/unregistration calls. We are
    going to add those calls in the next patch.
Attachment #9095136 - Attachment description: Bug 1583271 - Part 1: Change profiler page information ID's to BrowsingContextID and InnerWindowID → Bug 1583271 - Part 1: Change profiler page information IDs to BrowsingContextID and InnerWindowID

See the first patch's commit message to learn why we had to change the
PageInformation's IDs to BrowsingContextID and InnerWindowID.
Previously we were registering profiler PageInformation in the nsDocShell
methods. That was not the correct place to handle page loads correctly. That's
why we had to move the registration to WindowGlobalChild::SetDocumentURI and
WindowGlobalChild::ActorDestroy. In those functions we are sure that each
document URIs will come here only once.

Depends on D47065

Attachment #9095138 - Attachment description: Bug 1583271 - Part 3: Enable back the assertion since now we are sure that all pages will be registered once → Bug 1583271 - Part 3: Remove the disabled assertion and add a mechanism to capture the first non-auto:blank frame
OS: Unspecified → All
Priority: -- → P2
Hardware: Unspecified → All
Pushed by canaltinova@gmail.com: https://hg.mozilla.org/integration/autoland/rev/aa846af7a710 Part 1: Change profiler page information IDs to BrowsingContextID and InnerWindowID r=gerald,nika https://hg.mozilla.org/integration/autoland/rev/4d3aa8fd2313 Part 2: Add the registration/unregistration parts for profiler page info r=nika https://hg.mozilla.org/integration/autoland/rev/a82e11140781 Part 3: Remove the disabled assertion and add a mechanism to capture the first non-auto:blank frame r=nika https://hg.mozilla.org/integration/autoland/rev/07b6734ecc4e Part 4: Update profiler page information tests r=gerald
Regressions: 1655735
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: