Bug 444222 - Add browsing context name into SHEntry. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D89555
This commit is contained in:
Tim Huang 2020-09-11 07:52:11 +00:00
Родитель f4e796f357
Коммит d332cd8f36
5 изменённых файлов: 36 добавлений и 0 удалений

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

@ -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<dom::SessionHistoryInfo>::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<dom::SessionHistoryInfo>::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) ||

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

@ -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<nsIURI> mResultPrincipalURI;
nsCOMPtr<nsIReferrerInfo> mReferrerInfo;
nsString mTitle;
nsString mName;
nsCOMPtr<nsIInputStream> mPostData;
uint32_t mLoadType = 0;
int32_t mScrollPositionX = 0;

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

@ -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.

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

@ -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;

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

@ -47,6 +47,7 @@ class nsSHEntry : public nsISHEntry {
nsCOMPtr<nsIURI> mResultPrincipalURI;
nsCOMPtr<nsIReferrerInfo> mReferrerInfo;
nsString mTitle;
nsString mName;
nsCOMPtr<nsIInputStream> mPostData;
uint32_t mLoadType;
uint32_t mID;