diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 2f35f8d1712..f51ff23e93f 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -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); diff --git a/mozilla/docshell/base/nsWebShell.h b/mozilla/docshell/base/nsWebShell.h index 61dbeead362..512963d9345 100644 --- a/mozilla/docshell/base/nsWebShell.h +++ b/mozilla/docshell/base/nsWebShell.h @@ -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); diff --git a/mozilla/webshell/public/nsIWebShell.h b/mozilla/webshell/public/nsIWebShell.h index b1e5d2c1a8f..fde40ab213b 100644 --- a/mozilla/webshell/public/nsIWebShell.h +++ b/mozilla/webshell/public/nsIWebShell.h @@ -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 diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index 9fc02b02abd..1485cd90629 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -819,8 +819,8 @@ nsBrowserWindow::DispatchMenuItem(PRInt32 aID) PRInt32 theIndex; nsCOMPtr 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...