Bug 568925 - [e10s] remote History Set Title for URI. r=cjones

This commit is contained in:
Doug Turner 2010-06-29 16:43:05 -07:00
parent b39ef0496a
commit cbc203c944
4 changed files with 24 additions and 0 deletions

View File

@ -421,6 +421,17 @@ ContentProcessParent::RecvVisitURI(const IPC::URI& uri,
return true;
}
bool
ContentProcessParent::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
ContentProcessParent::OnDispatchedEvent(nsIThreadInternal *thread)

View File

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

View File

@ -76,6 +76,7 @@ parent:
PNecko();
async VisitURI(URI uri, URI referrer, PRUint32 flags);
async SetURITitle(URI uri, nsString title);
async StartVisitedQuery(URI uri);
// prefs-related messages ...

View File

@ -1187,6 +1187,15 @@ NS_IMETHODIMP
History::SetURITitle(nsIURI* aURI, const nsAString& aTitle)
{
NS_PRECONDITION(aURI, "Must pass a non-null URI!");
#ifdef MOZ_IPC
if (XRE_GetProcessType() == GeckoProcessType_Content) {
mozilla::dom::ContentProcessChild* cpc =
mozilla::dom::ContentProcessChild::GetSingleton();
NS_ASSERTION(cpc, "Content Protocol is NULL!");
(void)cpc->SendSetURITitle(IPC::URI(aURI), aTitle);
return NS_OK;
}
#endif /* MOZ_IPC */
nsNavHistory* history = nsNavHistory::GetHistoryService();
PRBool canAdd;