diff --git a/docshell/shistory/SessionHistoryEntry.cpp b/docshell/shistory/SessionHistoryEntry.cpp index 9f8ef8b674d2..8bedffbc80fd 100644 --- a/docshell/shistory/SessionHistoryEntry.cpp +++ b/docshell/shistory/SessionHistoryEntry.cpp @@ -404,6 +404,18 @@ SessionHistoryEntry::SetTitle(const nsAString& aTitle) { return NS_OK; } +NS_IMETHODIMP +SessionHistoryEntry::GetName(nsAString& aName) { + aName = mInfo->mName; + return NS_OK; +} + +NS_IMETHODIMP +SessionHistoryEntry::SetName(const nsAString& aName) { + mInfo->mName = aName; + return NS_OK; +} + NS_IMETHODIMP SessionHistoryEntry::GetIsSubFrame(bool* aIsSubFrame) { *aIsSubFrame = SharedInfo()->mIsFrameNavigation; @@ -1216,6 +1228,7 @@ void IPDLParamTraits::Write( WriteIPDLParam(aMsg, aActor, aParam.mResultPrincipalURI); WriteIPDLParam(aMsg, aActor, aParam.mReferrerInfo); WriteIPDLParam(aMsg, aActor, aParam.mTitle); + WriteIPDLParam(aMsg, aActor, aParam.mName); WriteIPDLParam(aMsg, aActor, aParam.mPostData); WriteIPDLParam(aMsg, aActor, aParam.mLoadType); WriteIPDLParam(aMsg, aActor, aParam.mScrollPositionX); @@ -1250,6 +1263,7 @@ bool IPDLParamTraits::Read( !ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResultPrincipalURI) || !ReadIPDLParam(aMsg, aIter, aActor, &aResult->mReferrerInfo) || !ReadIPDLParam(aMsg, aIter, aActor, &aResult->mTitle) || + !ReadIPDLParam(aMsg, aIter, aActor, &aResult->mName) || !ReadIPDLParam(aMsg, aIter, aActor, &aResult->mPostData) || !ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLoadType) || !ReadIPDLParam(aMsg, aIter, aActor, &aResult->mScrollPositionX) || diff --git a/docshell/shistory/SessionHistoryEntry.h b/docshell/shistory/SessionHistoryEntry.h index 09e65e2304bc..ab360bf96cc1 100644 --- a/docshell/shistory/SessionHistoryEntry.h +++ b/docshell/shistory/SessionHistoryEntry.h @@ -74,6 +74,9 @@ class SessionHistoryInfo { const nsAString& GetTitle() { return mTitle; } void SetTitle(const nsAString& aTitle) { mTitle = aTitle; } + const nsAString& GetName() { return mName; } + void SetName(const nsAString& aName) { mName = aName; } + void SetScrollRestorationIsManual(bool aIsManual) { mScrollRestorationIsManual = aIsManual; } @@ -124,6 +127,7 @@ class SessionHistoryInfo { nsCOMPtr mResultPrincipalURI; nsCOMPtr mReferrerInfo; nsString mTitle; + nsString mName; nsCOMPtr mPostData; uint32_t mLoadType = 0; int32_t mScrollPositionX = 0; diff --git a/docshell/shistory/nsISHEntry.idl b/docshell/shistory/nsISHEntry.idl index 5a6dc1cf810f..af5b3f4b4a89 100644 --- a/docshell/shistory/nsISHEntry.idl +++ b/docshell/shistory/nsISHEntry.idl @@ -75,6 +75,11 @@ interface nsISHEntry : nsISupports // XXX: make it [infallible] when AString supports that (bug 1491187). attribute AString title; + /** + * The name of the browsing context. + */ + attribute AString name; + /** * Was the entry created as a result of a subframe navigation? * - Will be 'false' when a frameset page is visited for the first time. diff --git a/docshell/shistory/nsSHEntry.cpp b/docshell/shistory/nsSHEntry.cpp index 8d476a461b2b..be76afea2510 100644 --- a/docshell/shistory/nsSHEntry.cpp +++ b/docshell/shistory/nsSHEntry.cpp @@ -208,6 +208,18 @@ nsSHEntry::SetTitle(const nsAString& aTitle) { return NS_OK; } +NS_IMETHODIMP +nsSHEntry::GetName(nsAString& aName) { + aName = mName; + return NS_OK; +} + +NS_IMETHODIMP +nsSHEntry::SetName(const nsAString& aName) { + mName = aName; + return NS_OK; +} + NS_IMETHODIMP nsSHEntry::GetPostData(nsIInputStream** aResult) { *aResult = mPostData; diff --git a/docshell/shistory/nsSHEntry.h b/docshell/shistory/nsSHEntry.h index 058f1720fa51..20bb96541583 100644 --- a/docshell/shistory/nsSHEntry.h +++ b/docshell/shistory/nsSHEntry.h @@ -47,6 +47,7 @@ class nsSHEntry : public nsISHEntry { nsCOMPtr mResultPrincipalURI; nsCOMPtr mReferrerInfo; nsString mTitle; + nsString mName; nsCOMPtr mPostData; uint32_t mLoadType; uint32_t mID;