Bug 566738 - Make setting titles asynchronous. r=sdwilsh r=mak sr=bz

This commit is contained in:
Benjamin Stover
2010-06-30 16:19:33 -07:00
parent 5fd5d0dce9
commit d77c8e68e2
7 changed files with 236 additions and 17 deletions

View File

@@ -4704,11 +4704,16 @@ nsDocShell::SetTitle(const PRUnichar * aTitle)
treeOwnerAsWin->SetTitle(aTitle);
}
if (mGlobalHistory && mCurrentURI && mLoadType != LOAD_ERROR_PAGE) {
mGlobalHistory->SetPageTitle(mCurrentURI, nsString(mTitle));
if (mCurrentURI && mLoadType != LOAD_ERROR_PAGE) {
nsCOMPtr<IHistory> history = services::GetHistoryService();
if (history) {
history->SetURITitle(mCurrentURI, mTitle);
}
else if (mGlobalHistory) {
mGlobalHistory->SetPageTitle(mCurrentURI, nsString(mTitle));
}
}
// Update SessionHistory with the document's title.
if (mOSHE && mLoadType != LOAD_BYPASS_HISTORY &&
mLoadType != LOAD_ERROR_PAGE) {