Bug 1626404: Part 2a - Store source BrowsingContext rather than DocShell in LoadState. r=nika CLOSED TREE

Differential Revision: https://phabricator.services.mozilla.com/D69418
This commit is contained in:
Kris Maglione
2020-04-04 02:42:44 +00:00
parent 35503e3f6f
commit 535b46c73a
5 changed files with 20 additions and 17 deletions

View File

@@ -33,6 +33,10 @@ class DocShellLoadStateInit;
* call.
*/
class nsDocShellLoadState final {
using BrowsingContext = mozilla::dom::BrowsingContext;
template <typename T>
using MaybeDiscarded = mozilla::dom::MaybeDiscarded<T>;
public:
NS_INLINE_DECL_REFCOUNTING(nsDocShellLoadState);
@@ -140,9 +144,11 @@ class nsDocShellLoadState final {
void SetSrcdocData(const nsAString& aSrcdocData);
nsIDocShell* SourceDocShell() const;
const MaybeDiscarded<BrowsingContext>& SourceBrowsingContext() const {
return mSourceBrowsingContext;
}
void SetSourceDocShell(nsIDocShell* aSourceDocShell);
void SetSourceBrowsingContext(BrowsingContext* aSourceBrowsingContext);
nsIURI* BaseURI() const;
@@ -337,7 +343,7 @@ class nsDocShellLoadState final {
nsString mSrcdocData;
// When set, this is the Source Browsing Context for the navigation.
nsCOMPtr<nsIDocShell> mSourceDocShell;
MaybeDiscarded<BrowsingContext> mSourceBrowsingContext;
// Used for srcdoc loads to give view-source knowledge of the load's base URI
// as this information isn't embedded in the load's URI.