Bug 1594288 - Remove nsIDocShellTreeItem.findChildWithName. r=annyG

There are no callers of findChildWithName after it got replaced by
corresponding methods in BrowsingContext.

Differential Revision: https://phabricator.services.mozilla.com/D55977

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Farre 2019-12-06 19:05:52 +00:00
Родитель 93aac959cd
Коммит 8de0ab1d90
3 изменённых файлов: 0 добавлений и 87 удалений

Просмотреть файл

@ -3178,62 +3178,6 @@ nsDocShell* nsDocShell::GetInProcessChildAt(int32_t aIndex) {
return static_cast<nsDocShell*>(child);
}
NS_IMETHODIMP
nsDocShell::FindChildWithName(const nsAString& aName, bool aRecurse,
bool aSameType, nsIDocShellTreeItem* aRequestor,
nsIDocShellTreeItem* aOriginalRequestor,
nsIDocShellTreeItem** aResult) {
NS_ENSURE_ARG_POINTER(aResult);
// if we don't find one, we return NS_OK and a null result
*aResult = nullptr;
if (aName.IsEmpty()) {
return NS_OK;
}
nsTObserverArray<nsDocLoader*>::ForwardIterator iter(mChildList);
while (iter.HasMore()) {
nsCOMPtr<nsIDocShellTreeItem> child = do_QueryObject(iter.GetNext());
NS_ENSURE_TRUE(child, NS_ERROR_FAILURE);
int32_t childType = child->ItemType();
if (aSameType && (childType != mItemType)) {
continue;
}
bool childNameEquals = false;
child->NameEquals(aName, &childNameEquals);
if (childNameEquals && ItemIsActive(child) &&
CanAccessItem(child, aOriginalRequestor)) {
child.swap(*aResult);
break;
}
// Only ask it to check children if it is same type
if (childType != mItemType) {
continue;
}
// Only ask the child if it isn't the requestor
if (aRecurse && (aRequestor != child)) {
// See if child contains the shell with the given name
#ifdef DEBUG
nsresult rv =
#endif
child->FindChildWithName(aName, true, aSameType,
static_cast<nsIDocShellTreeItem*>(this),
aOriginalRequestor, aResult);
NS_ASSERTION(NS_SUCCEEDED(rv), "FindChildWithName should not fail here");
if (*aResult) {
// found it
return NS_OK;
}
}
}
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::AddChildSHEntry(nsISHEntry* aCloneRef, nsISHEntry* aNewEntry,
int32_t aChildOffset, uint32_t aLoadType,

Просмотреть файл

@ -153,26 +153,6 @@ interface nsIDocShellTreeItem : nsISupports
[binaryname(GetInProcessChildAt)]
nsIDocShellTreeItem getChildAt(in long index);
/*
Return the child DocShellTreeItem with the specified name.
aName - This is the name of the item that is trying to be found.
aRecurse - Is used to tell the function to recurse through children.
Note, recursion will only happen through items of the same type.
aSameType - If this is set only children of the same type will be returned.
aRequestor - This is the docshellTreeItem that is requesting the find. This
parameter is used when recursion is being used to avoid searching the same
tree again when a child has asked a parent to search for children.
aOriginalRequestor - The original treeitem that made the request, if any.
This is used to ensure that we don't run into cross-site issues.
Note the search is depth first when recursing.
*/
nsIDocShellTreeItem findChildWithName(in AString aName,
in boolean aRecurse,
in boolean aSameType,
in nsIDocShellTreeItem aRequestor,
in nsIDocShellTreeItem aOriginalRequestor);
/**
* BrowsingContext associated with the DocShell.
*/

Просмотреть файл

@ -472,17 +472,6 @@ nsWebBrowser::GetInProcessChildAt(int32_t aIndex,
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP
nsWebBrowser::FindChildWithName(const nsAString& aName, bool aRecurse,
bool aSameType, nsIDocShellTreeItem* aRequestor,
nsIDocShellTreeItem* aOriginalRequestor,
nsIDocShellTreeItem** aResult) {
NS_ENSURE_ARG_POINTER(aResult);
*aResult = nullptr;
return NS_OK;
}
//*****************************************************************************
// nsWebBrowser::nsIWebNavigation
//*****************************************************************************