mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Fix removes const keyword from the out param of nsIWebShell::GetURL and fixes a memory leak in viewer when it calls this method. b=102413 r=jaggernaut@netscape.com sr=rpotts@netscape.com
This commit is contained in:
parent
c29d058fec
commit
fdfe0b65f7
@ -506,7 +506,7 @@ nsWebShell::GetHistoryIndex(PRInt32& aResult)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::GetURL(PRInt32 aIndex, const PRUnichar** aURLResult)
|
||||
nsWebShell::GetURL(PRInt32 aIndex, PRUnichar** aURLResult)
|
||||
{
|
||||
NS_ENSURE_STATE(mSessionHistory);
|
||||
NS_ENSURE_TRUE(!IsFrame(), NS_ERROR_FAILURE);
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
NS_IMETHOD GoTo(PRInt32 aHistoryIndex);
|
||||
NS_IMETHOD GetHistoryLength(PRInt32& aResult);
|
||||
NS_IMETHOD GetHistoryIndex(PRInt32& aResult);
|
||||
NS_IMETHOD GetURL(PRInt32 aHistoryIndex, const PRUnichar** aURLResult);
|
||||
NS_IMETHOD GetURL(PRInt32 aHistoryIndex, PRUnichar** aURLResult);
|
||||
|
||||
// nsIWebShellContainer
|
||||
NS_IMETHOD SetHistoryState(nsISupports* aLayoutHistoryState);
|
||||
|
@ -131,7 +131,7 @@ public:
|
||||
NS_IMETHOD GoTo(PRInt32 aHistoryIndex) = 0;
|
||||
NS_IMETHOD GetHistoryLength(PRInt32& aResult) = 0;
|
||||
NS_IMETHOD GetHistoryIndex(PRInt32& aResult) = 0;
|
||||
NS_IMETHOD GetURL(PRInt32 aHistoryIndex, const PRUnichar **aURLResult) = 0;
|
||||
NS_IMETHOD GetURL(PRInt32 aHistoryIndex, PRUnichar **aURLResult) = 0;
|
||||
|
||||
// SetToolBar
|
||||
// SetMenuBar
|
||||
|
@ -819,8 +819,8 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID)
|
||||
PRInt32 theIndex;
|
||||
nsCOMPtr<nsIWebShell> webShell(do_QueryInterface(mDocShell));
|
||||
webShell->GetHistoryIndex(theIndex);
|
||||
const PRUnichar* theURL;
|
||||
webShell->GetURL(theIndex,&theURL);
|
||||
nsXPIDLString theURL;
|
||||
webShell->GetURL(theIndex, getter_Copies(theURL));
|
||||
nsAutoString theString(theURL);
|
||||
mApp->ViewSource(theString);
|
||||
//XXX Find out how the string is allocated, and perhaps delete it...
|
||||
|
Loading…
x
Reference in New Issue
Block a user