@@ -344,25 +344,6 @@ nsXULWindow::GetPrimaryTabParent(nsITabParent** aTab)
344344 return NS_OK;
345345}
346346
347- NS_IMETHODIMP nsXULWindow::GetContentShellById (const char16_t * aID,
348- nsIDocShellTreeItem** aDocShellTreeItem)
349- {
350- NS_ENSURE_ARG_POINTER (aDocShellTreeItem);
351- *aDocShellTreeItem = nullptr ;
352-
353- uint32_t count = mContentShells .Length ();
354- for (uint32_t i = 0 ; i < count; i++) {
355- nsContentShellInfo* shellInfo = mContentShells .ElementAt (i);
356- if (shellInfo->id .Equals (aID)) {
357- *aDocShellTreeItem = nullptr ;
358- if (shellInfo->child )
359- CallQueryReferent (shellInfo->child .get (), aDocShellTreeItem);
360- return NS_OK;
361- }
362- }
363- return NS_ERROR_FAILURE;
364- }
365-
366347NS_IMETHODIMP nsXULWindow::AddChildWindow (nsIXULWindow *aChild)
367348{
368349 // we're not really keeping track of this right now
@@ -510,13 +491,6 @@ NS_IMETHODIMP nsXULWindow::Destroy()
510491 mDocShell = nullptr ; // this can cause reentrancy of this function
511492 }
512493
513- // Remove our ref on the content shells
514- uint32_t count = mContentShells .Length ();
515- for (uint32_t i = 0 ; i < count; i++) {
516- nsContentShellInfo* shellInfo = mContentShells .ElementAt (i);
517- delete shellInfo;
518- }
519- mContentShells .Clear ();
520494 mPrimaryContentShell = nullptr ;
521495
522496 if (mContentTreeOwner ) {
@@ -1685,28 +1659,8 @@ nsXULWindow::GetWindowDOMElement() const
16851659}
16861660
16871661nsresult nsXULWindow::ContentShellAdded (nsIDocShellTreeItem* aContentShell,
1688- bool aPrimary, const nsAString& aID)
1689- {
1690- nsContentShellInfo* shellInfo = nullptr ;
1691-
1692- uint32_t i, count = mContentShells .Length ();
1693- nsWeakPtr contentShellWeak = do_GetWeakReference (aContentShell);
1694- for (i = 0 ; i < count; i++) {
1695- nsContentShellInfo* info = mContentShells .ElementAt (i);
1696- if (info->id .Equals (aID)) {
1697- // We already exist. Do a replace.
1698- info->child = contentShellWeak;
1699- shellInfo = info;
1700- }
1701- else if (info->child == contentShellWeak)
1702- info->child = nullptr ;
1703- }
1704-
1705- if (!shellInfo) {
1706- shellInfo = new nsContentShellInfo (aID, contentShellWeak);
1707- mContentShells .AppendElement (shellInfo);
1708- }
1709-
1662+ bool aPrimary)
1663+ {
17101664 // Set the default content tree owner
17111665 if (aPrimary) {
17121666 NS_ENSURE_SUCCESS (EnsurePrimaryContentTreeOwner(), NS_ERROR_FAILURE);
@@ -1729,17 +1683,6 @@ nsresult nsXULWindow::ContentShellRemoved(nsIDocShellTreeItem* aContentShell)
17291683 if (mPrimaryContentShell == aContentShell) {
17301684 mPrimaryContentShell = nullptr ;
17311685 }
1732-
1733- int32_t i, count = mContentShells .Length ();
1734- for (i = count - 1 ; i >= 0 ; --i) {
1735- nsContentShellInfo* info = mContentShells .ElementAt (i);
1736- nsCOMPtr<nsIDocShellTreeItem> curItem = do_QueryReferent (info->child );
1737- if (!curItem || SameCOMIdentity (curItem, aContentShell)) {
1738- mContentShells .RemoveElementAt (i);
1739- delete info;
1740- }
1741- }
1742-
17431686 return NS_OK;
17441687}
17451688
@@ -2271,20 +2214,3 @@ nsXULWindow::GetTabCount(uint32_t* aResult)
22712214 return NS_OK;
22722215}
22732216
2274- // *****************************************************************************
2275- // *** nsContentShellInfo: Object Management
2276- // *****************************************************************************
2277-
2278- nsContentShellInfo::nsContentShellInfo (const nsAString& aID,
2279- nsIWeakReference* aContentShell)
2280- : id(aID),
2281- child(aContentShell)
2282- {
2283- MOZ_COUNT_CTOR (nsContentShellInfo);
2284- }
2285-
2286- nsContentShellInfo::~nsContentShellInfo ()
2287- {
2288- MOZ_COUNT_DTOR (nsContentShellInfo);
2289- // XXX Set Tree Owner to null if the tree owner is nsXULWindow->mContentTreeOwner
2290- }
0 commit comments