From bc20fd3c03084216133a5e173bb773d49c3f6a3b Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Wed, 5 Jul 2000 23:10:29 +0000 Subject: [PATCH] Moved session history methods from nsIWebNavigation into a new interface called nsIDocShellHistory. Also made docshells persist layout state before being destroyed (this is necesssary for framesets). git-svn-id: svn://10.0.0.236/trunk@73703 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/Makefile.in | 1 + mozilla/docshell/base/makefile.win | 1 + mozilla/docshell/base/nsDocShell.cpp | 249 ++++++++++-------- mozilla/docshell/base/nsDocShell.h | 3 + mozilla/docshell/base/nsIWebNavigation.idl | 11 - .../browser/webBrowser/nsWebBrowser.cpp | 18 -- .../components/shistory/src/nsSHistory.cpp | 87 ++---- 7 files changed, 167 insertions(+), 203 deletions(-) diff --git a/mozilla/docshell/base/Makefile.in b/mozilla/docshell/base/Makefile.in index 065f5decb96..0c698d0e1bd 100644 --- a/mozilla/docshell/base/Makefile.in +++ b/mozilla/docshell/base/Makefile.in @@ -35,6 +35,7 @@ XPIDLSRCS = \ nsIDocShellTreeItem.idl \ nsIDocShellTreeNode.idl \ nsIDocShellTreeOwner.idl \ + nsIDocShellHistory.idl \ nsIMarkupDocumentViewer.idl \ nsIScrollable.idl \ nsITextScroll.idl \ diff --git a/mozilla/docshell/base/makefile.win b/mozilla/docshell/base/makefile.win index 55b6fb661fe..72cd0ef0198 100644 --- a/mozilla/docshell/base/makefile.win +++ b/mozilla/docshell/base/makefile.win @@ -25,6 +25,7 @@ MODULE=docshell_base XPIDLSRCS= \ .\nsCDocShell.idl \ .\nsIDocShell.idl \ + .\nsIDocShellHistory.idl \ .\nsIDocShellLoadInfo.idl \ .\nsIDocShellTreeItem.idl \ .\nsIDocShellTreeNode.idl \ diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 6a54d9f418c..a2f0f62f06e 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -138,6 +138,7 @@ NS_INTERFACE_MAP_BEGIN(nsDocShell) NS_INTERFACE_MAP_ENTRY(nsIDocShell) NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeItem) NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeNode) + NS_INTERFACE_MAP_ENTRY(nsIDocShellHistory) NS_INTERFACE_MAP_ENTRY(nsIWebNavigation) NS_INTERFACE_MAP_ENTRY(nsIBaseWindow) NS_INTERFACE_MAP_ENTRY(nsIScrollable) @@ -239,13 +240,13 @@ NS_IMETHODIMP nsDocShell::LoadURI(nsIURI* aURI, nsIDocShellLoadInfo* aLoadInfo) nsCOMPtr parentAsItem; GetSameTypeParent(getter_AddRefs(parentAsItem)); nsCOMPtr entry; - nsCOMPtr parent; + nsCOMPtr parent; // Get your SHEntry from your parent if (parentAsItem) { parent = do_QueryInterface(parentAsItem); if (!parent) return NS_ERROR_FAILURE; - parent->GetSHEForChild(mChildOffset, getter_AddRefs(entry)); + parent->GetChildSHEntry(mChildOffset, getter_AddRefs(entry)); // XXX: should loadType be set to loadHistory ? } @@ -377,33 +378,38 @@ nsDocShell::SetDocLoaderObserver(nsIDocumentLoaderObserver * aDocLoaderObserver) NS_IMETHODIMP nsDocShell::GetPresContext(nsIPresContext** aPresContext) { - NS_ENSURE_ARG_POINTER(aPresContext); - *aPresContext = nsnull; + nsresult rv = NS_OK; - NS_ENSURE_TRUE(mContentViewer, NS_ERROR_FAILURE); - - nsCOMPtr docv(do_QueryInterface(mContentViewer)); - NS_ENSURE_TRUE(docv, NS_ERROR_FAILURE); + NS_ENSURE_ARG_POINTER(aPresContext); + *aPresContext = nsnull; - NS_ENSURE_SUCCESS(docv->GetPresContext(*aPresContext), NS_ERROR_FAILURE); + if (mContentViewer) { + nsCOMPtr docv(do_QueryInterface(mContentViewer)); - return NS_OK; + if (docv) { + rv = docv->GetPresContext(*aPresContext); + } + } + + // Fail silently, if no PresContext is available... + return rv; } NS_IMETHODIMP nsDocShell::GetPresShell(nsIPresShell** aPresShell) { - NS_ENSURE_ARG_POINTER(aPresShell); - *aPresShell = nsnull; + nsresult rv = NS_OK; + + NS_ENSURE_ARG_POINTER(aPresShell); + *aPresShell = nsnull; - nsCOMPtr presContext; - NS_ENSURE_SUCCESS(GetPresContext(getter_AddRefs(presContext)), - NS_ERROR_FAILURE); - if(!presContext) - return NS_OK; + nsCOMPtr presContext; + (void) GetPresContext(getter_AddRefs(presContext)); - NS_ENSURE_SUCCESS(presContext->GetShell(aPresShell), NS_ERROR_FAILURE); + if(presContext) { + rv = presContext->GetShell(aPresShell); + } - return NS_OK; + return rv; } NS_IMETHODIMP nsDocShell::GetContentViewer(nsIContentViewer** aContentViewer) @@ -955,6 +961,90 @@ NS_IMETHODIMP nsDocShell::FindChildWithName(const PRUnichar *aName, return NS_OK; } +//***************************************************************************** +// nsDocShell::nsIDocShellHistory +//***************************************************************************** +NS_IMETHODIMP +nsDocShell::GetChildSHEntry(PRInt32 aChildOffset, nsISHEntry ** aResult) +{ + nsresult rv = NS_OK; + + NS_ENSURE_ARG_POINTER(aResult); + *aResult = nsnull; + + // + // A nsISHEntry for a child is *only* available when the parent is in + // the progress of loading a document too... + // + if (LSHE) { + nsCOMPtr container(do_QueryInterface(LSHE)); + if (container) { + rv = container->GetChildAt(aChildOffset, aResult); + } + } + return rv; +} + +NS_IMETHODIMP +nsDocShell::AddChildSHEntry(nsISHEntry * aCloneRef, nsISHEntry * aNewEntry, + PRInt32 aChildOffset) +{ + nsresult rv; + + if (LSHE) { + /* You get here if you are currently building a + * hierarchy ie.,you just visited a frameset page + */ + nsCOMPtr container(do_QueryInterface(LSHE, &rv)); + if(container) + rv = container->AddChild(aNewEntry, aChildOffset); + } + else if (mSessionHistory) { + /* You are currently in the rootDocShell. + * You will get here when a subframe has a new url + * to load and you have walked up the tree all the + * way to the top + */ + PRInt32 index=-1; + nsCOMPtr currentEntry; + mSessionHistory->GetIndex(&index); + if (index < 0) + return NS_ERROR_FAILURE; + + rv = mSessionHistory->GetEntryAtIndex(index, PR_FALSE, + getter_AddRefs(currentEntry)); + if (currentEntry) { + nsCOMPtr nextEntry; //(do_CreateInstance(NS_SHENTRY_PROGID)); + // NS_ENSURE_TRUE(result, NS_ERROR_FAILURE); + rv = CloneAndReplace(currentEntry, aCloneRef, aNewEntry, + getter_AddRefs(nextEntry)); + + if (NS_SUCCEEDED(rv)) { + rv = mSessionHistory->AddEntry(nextEntry, PR_TRUE); + } + } + } + else { + /* You will get here when you are in a subframe and + * a new url has been loaded on you. + * The OSHE in this subframe will be the previous url's + * OSHE. This OSHE will be used as the identification + * for this subframe in the CloneAndReplace function. + */ + + nsCOMPtr parent(do_QueryInterface(mParent, &rv)); + if (parent) { + if (!aCloneRef) { + aCloneRef = OSHE; + } + rv = parent->AddChildSHEntry(aCloneRef, aNewEntry, aChildOffset); + } + + } + return rv; +} + + //***************************************************************************** // nsDocShell::nsIWebNavigation //***************************************************************************** @@ -1333,6 +1423,11 @@ NS_IMETHODIMP nsDocShell::Destroy() SetDocLoaderObserver(nsnull); + // Save the state of the current document, before destroying the window. + // This is needed to capture the state of a frameset when the new document + // causes the frameset to be destroyed... + PersistLayoutHistoryState(); + // Remove this docshell from its parent's child list nsCOMPtr docShellParentAsNode(do_QueryInterface(mParent)); if(docShellParentAsNode) @@ -2128,7 +2223,7 @@ NS_IMETHODIMP nsDocShell::Embed(nsIContentViewer* aContentViewer, // XXX What if SetupNewViewer fails? OSHE = LSHE; - +/* PRBool updateHistory = PR_TRUE; // Determine if this type of load should update history @@ -2144,20 +2239,20 @@ NS_IMETHODIMP nsDocShell::Embed(nsIContentViewer* aContentViewer, default: break; } - nsCOMPtr layoutState; - if (OSHE) { +*/ + if (OSHE) { + nsCOMPtr layoutState; + rv = OSHE->GetLayoutHistoryState(getter_AddRefs(layoutState)); - if (!updateHistory && layoutState) { + if (layoutState) { // This is a SH load. That's why there is a LayoutHistoryState in OSHE - if (NS_SUCCEEDED(rv) && layoutState) { - nsCOMPtr presShell; - rv = GetPresShell(getter_AddRefs(presShell)); - if (NS_SUCCEEDED(rv) && presShell) { - rv = presShell->SetHistoryState(layoutState); - } - } + nsCOMPtr presShell; + rv = GetPresShell(getter_AddRefs(presShell)); + if (NS_SUCCEEDED(rv) && presShell) { + rv = presShell->SetHistoryState(layoutState); + } } - } + } return NS_OK; #else return SetupNewViewer(aContentViewer); @@ -3059,6 +3154,7 @@ nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, nsDocShellInfoLoadType *. Create a Entry for it and add it to SH, if this is the * rootDocShell */ + nsresult rv; nsCOMPtr entry; PRBool shouldPersist = PR_FALSE; ShouldPersistInSessionHistory(aURI, &shouldPersist); @@ -3094,17 +3190,16 @@ nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, nsDocShellInfoLoadType NS_ENSURE_SUCCESS(entry->Create(aURI, nsnull, nsnull, inputStream, nsnull), NS_ERROR_FAILURE); - if (mSessionHistory) { - NS_ENSURE_SUCCESS(mSessionHistory->AddEntry(entry, shouldPersist), - NS_ERROR_FAILURE); - LSHE = entry; - } - else { - // OSHE could be null here - NS_ENSURE_SUCCESS(AddChildSHEntry(nsnull /* OSHE */, entry, mChildOffset), - NS_ERROR_FAILURE); - LSHE = entry; - } + if (mSessionHistory) { + rv = mSessionHistory->AddEntry(entry, shouldPersist); + } + else { + rv = AddChildSHEntry(nsnull, entry, mChildOffset); + } + // Update LSHE if the entry was added... + if (NS_SUCCEEDED(rv)) { + LSHE = entry; + } //} //!she // Set the LSHE for non-SH initiated loads. //LSHE = entry; @@ -3373,7 +3468,7 @@ NS_IMETHODIMP nsDocShell::UpdateCurrentSessionHistory() } #ifdef SH_IN_FRAMES -NS_IMETHODIMP nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, nsDocShellInfoLoadType aLoadType) +NS_IMETHODIMP nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, nsDocShellInfoLoadType aLoadType) #else NS_IMETHODIMP nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry) #endif @@ -3431,19 +3526,6 @@ nsDocShell::GetSHEForChild(PRInt32 aChildOffset, nsISHEntry ** aResult) } */ -NS_IMETHODIMP -nsDocShell::GetSHEForChild(PRInt32 aChildOffset, nsISHEntry ** aResult) -{ - NS_ENSURE_ARG_POINTER(aResult); - - if (LSHE) { - nsCOMPtr container(do_QueryInterface(LSHE)); - if (container) - return container->GetChildAt(aChildOffset, aResult); - } - return NS_ERROR_FAILURE; -} - NS_IMETHODIMP nsDocShell::PersistLayoutHistoryState() { @@ -3464,61 +3546,6 @@ nsDocShell::PersistLayoutHistoryState() return rv; } -NS_IMETHODIMP -nsDocShell::AddChildSHEntry(nsISHEntry * aCloneRef, nsISHEntry * aNewEntry, PRInt32 aChildOffset) -{ - nsresult rv; - if (LSHE) { - /* You get here if you are currently building a - * hierarchy ie.,you just visited a frameset page - */ - nsCOMPtr container(do_QueryInterface(LSHE)); - if(container) - rv = container->AddChild(aNewEntry, aChildOffset); - - } - else if (mSessionHistory) { - /* You are currently in the rootDocShell. - * You will get here when a subframe has a new url - * to load and you have walked up the tree all the - * way to the top - */ - PRInt32 index=-1; - nsCOMPtr currentEntry; - mSessionHistory->GetIndex(&index); - if (index < 0) - return NS_ERROR_FAILURE; - mSessionHistory->GetEntryAtIndex(index, PR_FALSE, getter_AddRefs(currentEntry)); - if (currentEntry) { - nsCOMPtr result; //(do_CreateInstance(NS_SHENTRY_PROGID)); - // NS_ENSURE_TRUE(result, NS_ERROR_FAILURE); - rv = CloneAndReplace(currentEntry, aCloneRef, aNewEntry, getter_AddRefs(result)); - if (!NS_SUCCEEDED(rv)) - return NS_ERROR_FAILURE; - NS_ENSURE_SUCCESS(mSessionHistory->AddEntry(result, PR_TRUE), - NS_ERROR_FAILURE); - } - } - else { - /* You will get here when you are in a subframe and - * a new url has been loaded on you. - * The OSHE in this subframe will be the previous url's - * OSHE. This OSHE will be used as the identification - * for this subframe in the CloneAndReplace function. - */ - - nsCOMPtr webNav(do_QueryInterface(mParent)); - if (!webNav) - return NS_ERROR_FAILURE; - if (aCloneRef) - webNav->AddChildSHEntry(aCloneRef, aNewEntry, aChildOffset); - else - webNav->AddChildSHEntry(OSHE, aNewEntry, aChildOffset); - - } - return rv; -} - #if 0 NS_IMETHODIMP nsDocShell::CloneAndReplace(nsISHEntry * src, nsISHEntry * cloneRef, diff --git a/mozilla/docshell/base/nsDocShell.h b/mozilla/docshell/base/nsDocShell.h index 4b2229a2ed0..6b5a08d7c6b 100644 --- a/mozilla/docshell/base/nsDocShell.h +++ b/mozilla/docshell/base/nsDocShell.h @@ -69,6 +69,7 @@ #include "nsIWebProgressListener.h" #include "nsISHContainer.h" #include "nsIDocShellLoadInfo.h" +#include "nsIDocShellHistory.h" //***************************************************************************** //*** nsRefreshTimer @@ -114,6 +115,7 @@ public: class nsDocShell : public nsIDocShell, public nsIDocShellTreeItem, public nsIDocShellTreeNode, + public nsIDocShellHistory, public nsIWebNavigation, public nsIBaseWindow, public nsIScrollable, @@ -136,6 +138,7 @@ public: NS_DECL_NSIDOCSHELL NS_DECL_NSIDOCSHELLTREEITEM NS_DECL_NSIDOCSHELLTREENODE + NS_DECL_NSIDOCSHELLHISTORY NS_DECL_NSIWEBNAVIGATION NS_DECL_NSIBASEWINDOW NS_DECL_NSISCROLLABLE diff --git a/mozilla/docshell/base/nsIWebNavigation.idl b/mozilla/docshell/base/nsIWebNavigation.idl index 0f75e349447..a78f1cc21e8 100644 --- a/mozilla/docshell/base/nsIWebNavigation.idl +++ b/mozilla/docshell/base/nsIWebNavigation.idl @@ -133,15 +133,4 @@ interface nsIWebNavigation : nsISupports The session history object used to store the session history for the session. */ attribute nsISHistory sessionHistory; - - /* - Get the SHEntry associated with a child docshell - */ - nsISHEntry GetSHEForChild(in long childOffset); - - /* - Add a Child SHEntry for a frameset page - */ - void AddChildSHEntry(in nsISHEntry cloneReference, in nsISHEntry newEntry, in long childOffset); - }; \ No newline at end of file diff --git a/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp b/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp index 2b001a1e948..7fd8852e98d 100644 --- a/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp +++ b/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp @@ -454,24 +454,6 @@ NS_IMETHODIMP nsWebBrowser::GetSessionHistory(nsISHistory** aSessionHistory) return NS_OK; } -NS_IMETHODIMP -nsWebBrowser::AddChildSHEntry(nsISHEntry * aCloneRef, nsISHEntry * aNewEntry, PRInt32 aChildOffset) -{ - - //XXX Not yet implemented - return NS_OK; -} - -NS_IMETHODIMP -nsWebBrowser::GetSHEForChild(PRInt32 aChildOffset, nsISHEntry ** aResult) -{ - - // XXX Not yet implemented - return NS_OK; - -} - - //***************************************************************************** // nsWebBrowser::nsIWebProgress //***************************************************************************** diff --git a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp index f62a768c724..7a1e0114223 100644 --- a/mozilla/xpfe/components/shistory/src/nsSHistory.cpp +++ b/mozilla/xpfe/components/shistory/src/nsSHistory.cpp @@ -421,24 +421,6 @@ nsSHistory::LoadURI(const PRUnichar* aURI) return NS_OK; } - -NS_IMETHODIMP -nsSHistory::AddChildSHEntry(nsISHEntry * aCloneRef, nsISHEntry * aNewEntry, PRInt32 aChildOffset) -{ - - //XXX Not yet implemented - return NS_OK; -} - -NS_IMETHODIMP -nsSHistory::GetSHEForChild(PRInt32 aChildOffset, nsISHEntry ** aResult) -{ - - // XXX Not yet implemented - return NS_OK; - -} - NS_IMETHODIMP nsSHistory::GotoIndex(PRInt32 aIndex) { @@ -449,9 +431,7 @@ nsSHistory::GotoIndex(PRInt32 aIndex) NS_IMETHODIMP nsSHistory::LoadEntry(PRInt32 aIndex, PRBool aReloadFlag, long aLoadType) { - // XXX I think the docshell should be a weakref here. The rootDocshell - // from which we start walking down the hierarchy is a weak ref. - nsIDocShell* docShell = nsnull; + nsCOMPtr docShell; nsCOMPtr shEntry; PRInt32 oldIndex = mIndex; @@ -465,7 +445,9 @@ nsSHistory::LoadEntry(PRInt32 aIndex, PRBool aReloadFlag, long aLoadType) nsCOMPtr nexturi; nsCOMPtr loadInfo; if (oldIndex != aIndex) { - PRBool result = CompareSHEntry(prevEntry, nextEntry, mRootDocShell, (&docShell), getter_AddRefs(shEntry)); + PRBool result = CompareSHEntry(prevEntry, nextEntry, mRootDocShell, + getter_AddRefs(docShell), + getter_AddRefs(shEntry)); if (!result) mIndex = oldIndex; @@ -485,7 +467,6 @@ nsSHistory::LoadEntry(PRInt32 aIndex, PRBool aReloadFlag, long aLoadType) loadInfo->SetSHEntry(nextEntry); // Time to initiate a document load return docShell->LoadURI(nexturi, loadInfo); - } @@ -501,49 +482,33 @@ nsSHistory::CompareSHEntry(nsISHEntry * aPrevEntry, nsISHEntry * aNextEntry, nsI nsresult rv; PRBool result = PR_FALSE; - nsCOMPtr prevURI, nextURI; - nsXPIDLCString prevUriSpec, nextUriSpec; - // Not reference counted on purpose - nsIDocShell * docshell = aParent; - nsCOMPtr prevEntry = aPrevEntry; - nsCOMPtr nextEntry = aNextEntry; + nsCOMPtr prevURI, nextURI; - prevEntry->GetURI(getter_AddRefs(prevURI)); - nextEntry->GetURI(getter_AddRefs(nextURI)); + aPrevEntry->GetURI(getter_AddRefs(prevURI)); + aNextEntry->GetURI(getter_AddRefs(nextURI)); + + // If one of the URIs is not available, then the entries are not + // equal... if (!prevURI || !nextURI) return PR_FALSE; - prevURI->GetSpec(getter_Copies(prevUriSpec)); - nextURI->GetSpec(getter_Copies(nextUriSpec)); - - if (!prevUriSpec || !nextUriSpec) - return PR_FALSE; - - // XXX for some reason PL_strcmp isn't returning right value - nsAutoString prevAutoStr(NS_ConvertASCIItoUCS2((const char *)prevUriSpec)); - //nsAutoString nextAutoStr(nextUriSpec); - - if (!(prevAutoStr.EqualsWithConversion((const char *)nextUriSpec))) { - *aDSResult = docshell; - *aSHEResult = nextEntry; + prevURI->Equals(nextURI, &result); + if (!result) { + *aDSResult = aParent; + *aSHEResult = aNextEntry; NS_IF_ADDREF(*aSHEResult); - // XXX we don't addref docshell here. The rootDocShell from which we started - // walking down the hierarchy is a weak ref. - //NS_IF_ADDREF(*aDSResult); + NS_IF_ADDREF(*aDSResult); return PR_TRUE; } + result = PR_FALSE; - /* compare the child frames */ + /* The root entries are the same, so compare any child frames */ PRInt32 cnt=0, pcnt=0, ncnt=0, dsCount=0; - nsCOMPtr prevContainer(do_QueryInterface(prevEntry)); - nsCOMPtr nextContainer(do_QueryInterface(nextEntry)); - //XXX Not ref counted on purpose. Is this correct.? - // How about AddRef in the QueryInterface? - nsIDocShellTreeNode * dsTreeNode = nsnull; - - rv = docshell->QueryInterface(NS_GET_IID(nsIDocShellTreeNode), (void **) &dsTreeNode); + nsCOMPtr prevContainer(do_QueryInterface(aPrevEntry)); + nsCOMPtr nextContainer(do_QueryInterface(aNextEntry)); + nsCOMPtr dsTreeNode(do_QueryInterface(aParent)); - if (!NS_SUCCEEDED(rv) || !dsTreeNode) + if (!dsTreeNode) return PR_FALSE; if (!prevContainer || !nextContainer) return PR_FALSE; @@ -556,20 +521,16 @@ nsSHistory::CompareSHEntry(nsISHEntry * aPrevEntry, nsISHEntry * aNextEntry, nsI for (PRInt32 i=0; i pChild, nChild; - nsIDocShellTreeItem * dsTreeItemChild=nsnull; + nsCOMPtr dsTreeItemChild; - prevContainer->GetChildAt(i, getter_AddRefs(pChild)); nextContainer->GetChildAt(i, getter_AddRefs(nChild)); - dsTreeNode->GetChildAt(i, &dsTreeItemChild); + dsTreeNode->GetChildAt(i, getter_AddRefs(dsTreeItemChild)); if (!dsTreeItemChild) return PR_FALSE; - // XXX How about AddRef in QueryInterface? Is this OK? - nsIDocShell * dsChild = nsnull; - - rv = dsTreeItemChild->QueryInterface(NS_GET_IID(nsIDocShell), (void **) &dsChild); + nsCOMPtr dsChild(do_QueryInterface(dsTreeItemChild)); result = CompareSHEntry(pChild, nChild, dsChild, aDSResult, aSHEResult); if (result) // We have found the docshell in which loadUri is to be called.