From 1fc8b4694a91ee3000fc20f290bebe8eeb40dd28 Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Sat, 1 Apr 2000 23:28:31 +0000 Subject: [PATCH] Removed the unused mViewSource member. Fixed ::InternalLoad to call ::LoadURI instead of LoadURL since destroying and then re-creating the uri is pointless when it's passed in for us. Not to mention if the person calling this load had actually setup listeners on this uri then this information would be lost (which is actually causing bug 34167). git-svn-id: svn://10.0.0.236/trunk@64911 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 15 +++------------ mozilla/webshell/src/nsWebShell.cpp | 15 +++------------ 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 6ff0e7009bd..cbba4c80ad6 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -420,8 +420,6 @@ protected: static PRUint32 mPluginInitCnt; PRBool mProcessedEndDocumentLoad; - PRBool mViewSource; - MOZ_TIMER_DECLARE(mTotalTime) #ifdef DETECT_WEBSHELL_LEAKS @@ -556,7 +554,6 @@ nsWebShell::nsWebShell() : nsDocShell() mDefaultCharacterSet = ""; mProcessedEndDocumentLoad = PR_FALSE; mCharsetReloadState = eCharsetReloadInit; - mViewSource=PR_FALSE; mHistoryService = nsnull; mHistoryState = nsnull; mFiredUnloadEvent = PR_FALSE; @@ -980,7 +977,7 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec, nsISupports * aHistoryState, const PRUnichar* aReferrer) { - const char *cmd = mViewSource ? "view-source" : "view" ; + const char *cmd = (mViewMode == viewSource) ? "view-source" : "view" ; return LoadURL(aURLSpec, cmd, aPostDataStream, aModifyHistory,aType, aLocalIP, aHistoryState, @@ -1319,16 +1316,12 @@ NS_IMETHODIMP nsWebShell::InternalLoad(nsIURI* aURI, nsIURI* aReferrer, break; } - nsXPIDLCString url; - aURI->GetSpec(getter_Copies(url)); - nsXPIDLCString referrer; if(aReferrer) aReferrer->GetSpec(getter_Copies(referrer)); - - return LoadURL(nsAutoString(url).GetUnicode(), nsnull, updateHistory, - 0, 0, nsnull, nsAutoString(referrer).GetUnicode()); + return LoadURI(aURI, "view", nsnull, updateHistory, nsIChannel::LOAD_NORMAL, + 0, nsnull, nsAutoString(referrer).GetUnicode(), nsnull); } // nsIURIContentListener support @@ -1564,8 +1557,6 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec, optimizations here. -Gagan */ - mViewSource = (0==PL_strcmp("view-source", aCommand)); - nsAutoString urlStr(aURLSpec); // first things first. try to create a uri out of the string. nsCOMPtr uri; diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index 6ff0e7009bd..cbba4c80ad6 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -420,8 +420,6 @@ protected: static PRUint32 mPluginInitCnt; PRBool mProcessedEndDocumentLoad; - PRBool mViewSource; - MOZ_TIMER_DECLARE(mTotalTime) #ifdef DETECT_WEBSHELL_LEAKS @@ -556,7 +554,6 @@ nsWebShell::nsWebShell() : nsDocShell() mDefaultCharacterSet = ""; mProcessedEndDocumentLoad = PR_FALSE; mCharsetReloadState = eCharsetReloadInit; - mViewSource=PR_FALSE; mHistoryService = nsnull; mHistoryState = nsnull; mFiredUnloadEvent = PR_FALSE; @@ -980,7 +977,7 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec, nsISupports * aHistoryState, const PRUnichar* aReferrer) { - const char *cmd = mViewSource ? "view-source" : "view" ; + const char *cmd = (mViewMode == viewSource) ? "view-source" : "view" ; return LoadURL(aURLSpec, cmd, aPostDataStream, aModifyHistory,aType, aLocalIP, aHistoryState, @@ -1319,16 +1316,12 @@ NS_IMETHODIMP nsWebShell::InternalLoad(nsIURI* aURI, nsIURI* aReferrer, break; } - nsXPIDLCString url; - aURI->GetSpec(getter_Copies(url)); - nsXPIDLCString referrer; if(aReferrer) aReferrer->GetSpec(getter_Copies(referrer)); - - return LoadURL(nsAutoString(url).GetUnicode(), nsnull, updateHistory, - 0, 0, nsnull, nsAutoString(referrer).GetUnicode()); + return LoadURI(aURI, "view", nsnull, updateHistory, nsIChannel::LOAD_NORMAL, + 0, nsnull, nsAutoString(referrer).GetUnicode(), nsnull); } // nsIURIContentListener support @@ -1564,8 +1557,6 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec, optimizations here. -Gagan */ - mViewSource = (0==PL_strcmp("view-source", aCommand)); - nsAutoString urlStr(aURLSpec); // first things first. try to create a uri out of the string. nsCOMPtr uri;