зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1821303 - Add hasPostData bool to nsISHEntry r=smaug
To avoid unnecessary cloning of nsIInputStream, add a hasPostData boolean attribute to tell whether a nsISHEntry has populated postData. Differential Revision: https://phabricator.services.mozilla.com/D173237
This commit is contained in:
Родитель
dbf7c989d2
Коммит
e505210f70
|
@ -715,6 +715,12 @@ SessionHistoryEntry::SetPostData(nsIInputStream* aPostData) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SessionHistoryEntry::GetHasPostData(bool* aResult) {
|
||||
*aResult = mInfo->HasPostData();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SessionHistoryEntry::GetLayoutHistoryState(
|
||||
nsILayoutHistoryState** aLayoutHistoryState) {
|
||||
|
|
|
@ -128,6 +128,7 @@ interface nsISHEntry : nsISupports
|
|||
|
||||
/** Post Data for the document */
|
||||
[infallible] attribute nsIInputStream postData;
|
||||
[infallible] readonly attribute boolean hasPostData;
|
||||
|
||||
/** LayoutHistoryState for scroll position and form values */
|
||||
[infallible] attribute nsILayoutHistoryState layoutHistoryState;
|
||||
|
|
|
@ -244,6 +244,12 @@ nsSHEntry::SetPostData(nsIInputStream* aPostData) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSHEntry::GetHasPostData(bool* aResult) {
|
||||
*aResult = !!mPostData;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSHEntry::GetLayoutHistoryState(nsILayoutHistoryState** aResult) {
|
||||
*aResult = mShared->mLayoutHistoryState;
|
||||
|
|
|
@ -1368,7 +1368,7 @@ class RequestDetails {
|
|||
// See the above comment for more info.
|
||||
initiatorURI: parentPrin?.isContentPrincipal ? parentPrin.URI : null,
|
||||
type: isTop ? "main_frame" : "sub_frame",
|
||||
method: bc.activeSessionHistoryEntry?.postData ? "post" : "get",
|
||||
method: bc.activeSessionHistoryEntry?.hasPostData ? "post" : "get",
|
||||
tabId: this.tabId,
|
||||
// In this loop we are already explicitly accounting for ancestors, so
|
||||
// we intentionally omit browsingContext even though we have |bc|. If
|
||||
|
|
Загрузка…
Ссылка в новой задаче