Bug 568925 - Remote History Set Title for URI. r=cjones, sr=bz

This commit is contained in:
Doug Turner 2010-07-02 08:53:42 -07:00
parent dbd3ee48de
commit 848fbc02f4
4 changed files with 25 additions and 0 deletions

View File

@ -454,6 +454,17 @@ ContentParent::RecvVisitURI(const IPC::URI& uri,
return true;
}
bool
ContentParent::RecvSetURITitle(const IPC::URI& uri,
const nsString& title)
{
nsCOMPtr<nsIURI> ourURI = uri;
IHistory *history = nsContentUtils::GetHistory();
history->SetURITitle(ourURI, title);
return true;
}
/* void onDispatchedEvent (in nsIThreadInternal thread); */
NS_IMETHODIMP
ContentParent::OnDispatchedEvent(nsIThreadInternal *thread)

View File

@ -152,6 +152,9 @@ private:
const IPC::URI& referrer,
const PRUint32& flags);
virtual bool RecvSetURITitle(const IPC::URI& uri,
const nsString& title);
mozilla::Monitor mMonitor;
GeckoChildProcessHost* mSubprocess;

View File

@ -79,6 +79,7 @@ parent:
async StartVisitedQuery(URI uri);
async VisitURI(URI uri, URI referrer, PRUint32 flags);
async SetURITitle(URI uri, nsString title);
// PrefService messages
sync GetPrefType(nsCString prefName) returns (PRInt32 retValue, nsresult rv);

View File

@ -1264,6 +1264,16 @@ History::SetURITitle(nsIURI* aURI, const nsAString& aTitle)
return NS_OK;
}
#ifdef MOZ_IPC
if (XRE_GetProcessType() == GeckoProcessType_Content) {
mozilla::dom::ContentChild * cpc =
mozilla::dom::ContentChild::GetSingleton();
NS_ASSERTION(cpc, "Content Protocol is NULL!");
(void)cpc->SendSetURITitle(IPC::URI(aURI), nsDependentString(aTitle));
return NS_OK;
}
#endif /* MOZ_IPC */
nsNavHistory* history = nsNavHistory::GetHistoryService();
// At first, it seems like nav history should always be available here, no