Reduce use of SessionID::defaultSessionID() in WebKit
[WebKit-https.git] / Source / WebCore / html / HTMLAnchorElement.cpp
index a7a922a..597accb 100644 (file)
@@ -407,7 +407,8 @@ Optional<AdClickAttribution> HTMLAnchorElement::parseAdClickAttribution() const
     using Source = AdClickAttribution::Source;
     using Destination = AdClickAttribution::Destination;
 
-    if (!document().sessionID() || document().sessionID()->isEphemeral()
+    auto* page = document().page();
+    if (!page || page->sessionID().isEphemeral()
         || !RuntimeEnabledFeatures::sharedFeatures().adClickAttributionEnabled()
         || !UserGestureIndicator::processingUserGesture())
         return WTF::nullopt;