Loading docshell/base/nsDocShell.cpp +64 −2 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ #include "nsIHTTPChannel.h" #include "nsIDataChannel.h" #include "nsIProgressEventSink.h" #include "nsIWebProgress.h" #include "nsILayoutHistoryState.h" #include "nsILocaleService.h" #include "nsIPlatformCharset.h" Loading Loading @@ -138,6 +139,7 @@ NS_INTERFACE_MAP_BEGIN(nsDocShell) NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObjectOwner) NS_INTERFACE_MAP_ENTRY(nsIRefreshURI) NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) NS_INTERFACE_MAP_END_THREADSAFE Loading Loading @@ -775,7 +777,7 @@ NS_IMETHODIMP nsDocShell::SetTreeOwner(nsIDocShellTreeOwner* aTreeOwner) { // Don't automatically set the progress based on the tree owner for frames if (!IsFrame()) { nsCOMPtr<nsIWebProgress> webProgress(do_GetInterface(mLoadCookie)); nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie)); if (webProgress) { nsCOMPtr<nsIWebProgressListener> oldListener(do_QueryInterface(mTreeOwner)); Loading Loading @@ -1261,9 +1263,10 @@ NS_IMETHODIMP nsDocShell::Destroy() mScriptGlobal = nsnull; mScriptContext = nsnull; mSessionHistory = nsnull; mLoadCookie = nsnull; SetTreeOwner(nsnull); SetLoadCookie(nsnull); if(mInitInfo) { delete mInitInfo; Loading Loading @@ -2020,6 +2023,31 @@ NS_IMETHODIMP nsDocShell::Embed(nsIContentViewer* aContentViewer, return SetupNewViewer(aContentViewer); } //***************************************************************************** // nsDocShell::nsIWebProgressListener //***************************************************************************** NS_IMETHODIMP nsDocShell::OnProgressChange(nsIWebProgress *aProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) { return NS_OK; } NS_IMETHODIMP nsDocShell::OnStateChange(nsIWebProgress *aProgress, nsIRequest *aRequest, PRInt32 aStateFlags, nsresult aStatus) { return NS_OK; } NS_IMETHODIMP nsDocShell::OnLocationChange(nsIURI *aURI) { return NS_OK; } //***************************************************************************** // nsDocShell: Content Viewer Management //***************************************************************************** Loading Loading @@ -3163,6 +3191,40 @@ NS_IMETHODIMP nsDocShell::UpdateCurrentGlobalHistory() // nsDocShell: Helper Routines //***************************************************************************** nsresult nsDocShell::SetLoadCookie(nsISupports *aCookie) { // Remove the DocShell as a listener of the old WebProgress... if (mLoadCookie) { nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie)); if (webProgress) { webProgress->RemoveProgressListener(this); } } mLoadCookie = aCookie; // Add the DocShell as a listener to the new WebProgress... if (mLoadCookie) { nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie)); if (webProgress) { webProgress->AddProgressListener(this); } } return NS_OK; } nsresult nsDocShell::GetLoadCookie(nsISupports **aResult) { *aResult = mLoadCookie; NS_IF_ADDREF(*aResult); return NS_OK; } nsDocShellInitInfo* nsDocShell::InitInfo() { if(mInitInfo) Loading docshell/base/nsDocShell.h +5 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ #include "nsISupportsArray.h" #include "nsITimerCallback.h" #include "nsIWebNavigation.h" #include "nsIWebProgress.h" #include "nsIWebProgressListener.h" //***************************************************************************** Loading Loading @@ -119,10 +118,10 @@ class nsDocShell : public nsIDocShell, public nsIInterfaceRequestor, public nsIScriptGlobalObjectOwner, public nsIRefreshURI, public nsIWebProgressListener, public nsSupportsWeakReference { friend class nsDSURIContentListener; friend class nsDSWebProgressListener; public: // Object Management Loading @@ -139,6 +138,7 @@ public: NS_DECL_NSITEXTSCROLL NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSISCRIPTGLOBALOBJECTOWNER NS_DECL_NSIWEBPROGRESSLISTENER // nsIRefreshURI NS_IMETHOD RefreshURI(nsIURI *aURI, PRInt32 aDelay, PRBool aRepeat); Loading @@ -151,6 +151,9 @@ public: nsISupports* aExtraInfo); nsresult SetLoadCookie(nsISupports *aCookie); nsresult GetLoadCookie(nsISupports **aResult); protected: // Object Management virtual ~nsDocShell(); Loading Loading
docshell/base/nsDocShell.cpp +64 −2 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ #include "nsIHTTPChannel.h" #include "nsIDataChannel.h" #include "nsIProgressEventSink.h" #include "nsIWebProgress.h" #include "nsILayoutHistoryState.h" #include "nsILocaleService.h" #include "nsIPlatformCharset.h" Loading Loading @@ -138,6 +139,7 @@ NS_INTERFACE_MAP_BEGIN(nsDocShell) NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObjectOwner) NS_INTERFACE_MAP_ENTRY(nsIRefreshURI) NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) NS_INTERFACE_MAP_END_THREADSAFE Loading Loading @@ -775,7 +777,7 @@ NS_IMETHODIMP nsDocShell::SetTreeOwner(nsIDocShellTreeOwner* aTreeOwner) { // Don't automatically set the progress based on the tree owner for frames if (!IsFrame()) { nsCOMPtr<nsIWebProgress> webProgress(do_GetInterface(mLoadCookie)); nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie)); if (webProgress) { nsCOMPtr<nsIWebProgressListener> oldListener(do_QueryInterface(mTreeOwner)); Loading Loading @@ -1261,9 +1263,10 @@ NS_IMETHODIMP nsDocShell::Destroy() mScriptGlobal = nsnull; mScriptContext = nsnull; mSessionHistory = nsnull; mLoadCookie = nsnull; SetTreeOwner(nsnull); SetLoadCookie(nsnull); if(mInitInfo) { delete mInitInfo; Loading Loading @@ -2020,6 +2023,31 @@ NS_IMETHODIMP nsDocShell::Embed(nsIContentViewer* aContentViewer, return SetupNewViewer(aContentViewer); } //***************************************************************************** // nsDocShell::nsIWebProgressListener //***************************************************************************** NS_IMETHODIMP nsDocShell::OnProgressChange(nsIWebProgress *aProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) { return NS_OK; } NS_IMETHODIMP nsDocShell::OnStateChange(nsIWebProgress *aProgress, nsIRequest *aRequest, PRInt32 aStateFlags, nsresult aStatus) { return NS_OK; } NS_IMETHODIMP nsDocShell::OnLocationChange(nsIURI *aURI) { return NS_OK; } //***************************************************************************** // nsDocShell: Content Viewer Management //***************************************************************************** Loading Loading @@ -3163,6 +3191,40 @@ NS_IMETHODIMP nsDocShell::UpdateCurrentGlobalHistory() // nsDocShell: Helper Routines //***************************************************************************** nsresult nsDocShell::SetLoadCookie(nsISupports *aCookie) { // Remove the DocShell as a listener of the old WebProgress... if (mLoadCookie) { nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie)); if (webProgress) { webProgress->RemoveProgressListener(this); } } mLoadCookie = aCookie; // Add the DocShell as a listener to the new WebProgress... if (mLoadCookie) { nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie)); if (webProgress) { webProgress->AddProgressListener(this); } } return NS_OK; } nsresult nsDocShell::GetLoadCookie(nsISupports **aResult) { *aResult = mLoadCookie; NS_IF_ADDREF(*aResult); return NS_OK; } nsDocShellInitInfo* nsDocShell::InitInfo() { if(mInitInfo) Loading
docshell/base/nsDocShell.h +5 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ #include "nsISupportsArray.h" #include "nsITimerCallback.h" #include "nsIWebNavigation.h" #include "nsIWebProgress.h" #include "nsIWebProgressListener.h" //***************************************************************************** Loading Loading @@ -119,10 +118,10 @@ class nsDocShell : public nsIDocShell, public nsIInterfaceRequestor, public nsIScriptGlobalObjectOwner, public nsIRefreshURI, public nsIWebProgressListener, public nsSupportsWeakReference { friend class nsDSURIContentListener; friend class nsDSWebProgressListener; public: // Object Management Loading @@ -139,6 +138,7 @@ public: NS_DECL_NSITEXTSCROLL NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSISCRIPTGLOBALOBJECTOWNER NS_DECL_NSIWEBPROGRESSLISTENER // nsIRefreshURI NS_IMETHOD RefreshURI(nsIURI *aURI, PRInt32 aDelay, PRBool aRepeat); Loading @@ -151,6 +151,9 @@ public: nsISupports* aExtraInfo); nsresult SetLoadCookie(nsISupports *aCookie); nsresult GetLoadCookie(nsISupports **aResult); protected: // Object Management virtual ~nsDocShell(); Loading