Change nsSHistory::EvictContentViewerForEntry to accommodate session history changes
Categories
(Core :: DOM: Navigation, task, P2)
Tracking
()
Fission Milestone | M4 |
People
(Reporter: annyG, Assigned: annyG)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Inside of nsDocShell::UpdateURLAndHistory, there are 4 sync IPC calls to
nsSHistory plus 1 static call, which contains at least one nsSHEntry::GetParent
sync IPC call. All of these calls can be moved inside of a new method
EvictContentViewersOrReplaceEntry on nsSHEntry, resulting in just 1 sync IPC
call.
Assignee | ||
Comment 2•6 years ago
|
||
When we need to evict content viewers, we group SHEntrySharedParentState,
corresponding to session history entries that need to be evicted, by their
content parent, and create a runnable for each content parent. In the runnable
we use the passed in IDs of SHEntrySharedParentStates to retrieve corresponding content
viewers and evict them.
Depends on D32729
Assignee | ||
Comment 3•6 years ago
|
||
Add a new method to session history listener to listen for content
viewers being evicted.
Depends on D32730
Assignee | ||
Comment 4•6 years ago
|
||
Peter, here I will explain the rationale behind adding method NotifyListenersContentViewerEvicted to SHEntryChildShared and SHEntrySharedParentState. But first, a backstory!
Whenever NotifyListenersContentViewerEvicted is defined on nsSHistory or SHistoryChild, it actually uses the NOTIFY_LISTENERS macro and informs mListeners about an event. I have added NotifyListenersContentViewerEvicted() in nsISHistory.idl because nsSHistory and SHistoryChild both have their own listeners. Then I added calls to NotifyListenersContentViewerEvicted() in nsSHistory::EvictContentViewerForEntry and SHistoryChild::NotifyListenersContentViewerEvicted because these two places evict content viewers.
There are several other places where a content viewer gets evicted
- SHEntryChildShared::EvictContentViewers()
- nsSHEntry::EvictContentViewer()
- SHEntryChild::EvictContentViewer()
We don't have access to session history from those places to call nsISHistory::NotifyListenersContentViewerEvicted, however, we do have access to mShared, the type of which is SHEntryChildShared or SHEntrySHaredParentState, both of which have local mSHistory. Thus, we want to define a method on SHEntryChildShared and SHEntrySHaredParentState that will invoke NotifyListenersContentViewerEvicted() on the session history. The solution is to define a method NotifyListenersContentViewerEvicted which will use local mSHistory and call nsISHistory::NotifyListenersContentViewerEvicted on it.
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 6•6 years ago
|
||
Pushed to ash branch
https://hg.mozilla.org/projects/ash/rev/2cd5cd24763ff320719aedb2142a79822efd6de4
https://hg.mozilla.org/projects/ash/rev/0feb286c5b85e6e2a0ac56058c596324ca28d817
https://hg.mozilla.org/projects/ash/rev/5e4d0ab9e52ce1e1d1684fdb59534a66e9f9d9b9
![]() |
||
Comment 8•5 years ago
|
||
bugherder |
Description
•