Bug 1962710 - Part 1: Add source element to load state. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D249240
This commit is contained in:
committed by
afarre@mozilla.com
parent
a74508cc71
commit
51b4a22fa0
@@ -1402,3 +1402,11 @@ nsIURI* nsDocShellLoadState::GetUnstrippedURI() const { return mUnstrippedURI; }
|
||||
void nsDocShellLoadState::SetUnstrippedURI(nsIURI* aUnstrippedURI) {
|
||||
mUnstrippedURI = aUnstrippedURI;
|
||||
}
|
||||
|
||||
void nsDocShellLoadState::SetSourceElement(mozilla::dom::Element* aElement) {
|
||||
mSourceElement = do_GetWeakReference(aElement);
|
||||
}
|
||||
already_AddRefed<Element> nsDocShellLoadState::GetSourceElement() const {
|
||||
nsCOMPtr<Element> element = do_QueryReferent(mSourceElement);
|
||||
return element.forget();
|
||||
}
|
||||
|
||||
@@ -408,6 +408,9 @@ class nsDocShellLoadState final {
|
||||
|
||||
void MaybeStripTrackerQueryStrings(mozilla::dom::BrowsingContext* aContext);
|
||||
|
||||
void SetSourceElement(mozilla::dom::Element* aElement);
|
||||
already_AddRefed<mozilla::dom::Element> GetSourceElement() const;
|
||||
|
||||
protected:
|
||||
// Destructor can't be defaulted or inlined, as header doesn't have all type
|
||||
// includes it needs to do so.
|
||||
@@ -658,6 +661,8 @@ class nsDocShellLoadState final {
|
||||
// Solely for the use of collecting Telemetry for HTTPS upgrades.
|
||||
nsILoadInfo::HTTPSUpgradeTelemetryType mHttpsUpgradeTelemetry =
|
||||
nsILoadInfo::NOT_INITIALIZED;
|
||||
|
||||
nsWeakPtr mSourceElement;
|
||||
};
|
||||
|
||||
#endif /* nsDocShellLoadState_h__ */
|
||||
|
||||
Reference in New Issue
Block a user