Bug 1488628 - Change nsISHEntry.title to an AString. r=nika

This patch also removes the setTitle() method and makes `title` non-readonly.

--HG--
extra : rebase_source : 87e394ec5cb0eed7a9b77fa105b6dd45111d75fd
This commit is contained in:
Nicholas Nethercote 2018-09-05 11:29:36 +10:00
Родитель ea6e6b7d15
Коммит 55657f2206
6 изменённых файлов: 8 добавлений и 13 удалений

Просмотреть файл

@ -11881,7 +11881,7 @@ nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
// Set the new SHEntry's title (bug 655273).
nsString title;
mOSHE->GetTitle(getter_Copies(title));
mOSHE->GetTitle(title);
newSHEntry->SetTitle(title);
// AddToSessionHistory may not modify mOSHE. In case it doesn't,

Просмотреть файл

@ -60,11 +60,9 @@ interface nsISHEntry : nsISupports
attribute boolean loadReplace;
/**
* A readonly property that returns the title
* of the current entry. The object returned
* is a encoded string
* The title of the current entry.
*/
readonly attribute wstring title;
attribute AString title;
/**
* A readonly property that returns a boolean
@ -136,9 +134,6 @@ interface nsISHEntry : nsISupports
*/
void syncPresentationState();
/** Title for the document */
void setTitle(in AString aTitle);
/** Post Data for the document */
attribute nsIInputStream postData;

Просмотреть файл

@ -258,7 +258,7 @@ nsSHEntry::GetSticky(bool* aSticky)
}
NS_IMETHODIMP
nsSHEntry::GetTitle(char16_t** aTitle)
nsSHEntry::GetTitle(nsAString& aTitle)
{
// Check for empty title...
if (mTitle.IsEmpty() && mURI) {
@ -269,7 +269,7 @@ nsSHEntry::GetTitle(char16_t** aTitle)
}
}
*aTitle = ToNewUnicode(mTitle);
aTitle = mTitle;
return NS_OK;
}

Просмотреть файл

@ -735,7 +735,7 @@ nsSHistory::PrintHistory()
entry->GetLayoutHistoryState(getter_AddRefs(layoutHistoryState));
entry->GetURI(getter_AddRefs(uri));
entry->GetTitle(getter_Copies(title));
entry->GetTitle(title);
#if 0
nsAutoCString url;

Просмотреть файл

@ -261,7 +261,7 @@ var ViewSourceContent = {
let shEntry = Cc["@mozilla.org/browser/session-history-entry;1"]
.createInstance(Ci.nsISHEntry);
shEntry.setURI(Services.io.newURI(viewSrcURL));
shEntry.setTitle(viewSrcURL);
shEntry.title = viewSrcURL;
let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
shEntry.triggeringPrincipal = systemPrincipal;
shEntry.setAsHistoryLoad();

Просмотреть файл

@ -336,7 +336,7 @@ var SessionHistoryInternal = {
createInstance(Ci.nsISHEntry);
shEntry.setURI(Utils.makeURI(entry.url));
shEntry.setTitle(entry.title || entry.url);
shEntry.title = entry.title || entry.url;
if (entry.subframe)
shEntry.setIsSubFrame(entry.subframe || false);
shEntry.setAsHistoryLoad();