Title: [250153] trunk/Source
Revision
250153
Author
cdu...@apple.com
Date
2019-09-20 14:35:58 -0700 (Fri, 20 Sep 2019)

Log Message

Document no longer needs to store a SessionID
https://bugs.webkit.org/show_bug.cgi?id=202024

Reviewed by Geoffrey Garen.

Document no longer needs to store a SessionID, now that we have a single
session per WebProcess. It can simply get its sessionID from its Page.

Source/WebCore:

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* dom/DOMImplementation.cpp:
(WebCore::createXMLDocument):
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementation::createHTMLDocument):
* dom/DOMImplementation.h:
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::m_undoManager):
(WebCore::Document::create):
(WebCore::Document::createNonRenderedPlaceholder):
(WebCore::Document::cloneDocumentWithoutChildren const):
(WebCore::Document::sessionID const):
(WebCore::Document::privateBrowsingStateDidChange):
(WebCore::Document::ensureTemplateDocument):
(WebCore::Document::logger):
(WebCore::Document::didLogMessage):
* dom/Document.h:
(WebCore::Document::create):
* dom/XMLDocument.h:
(WebCore::XMLDocument::create):
(WebCore::XMLDocument::createXHTML):
(WebCore::XMLDocument::XMLDocument):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
* html/FTPDirectoryDocument.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::createSynthesizedDocument):
(WebCore::HTMLDocument::HTMLDocument):
(WebCore::HTMLDocument::cloneDocumentWithoutChildren const):
* html/HTMLDocument.h:
(WebCore::HTMLDocument::create):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::ImageDocument):
* html/MediaDocument.cpp:
(WebCore::MediaDocument::MediaDocument):
* html/MediaDocument.h:
* html/PluginDocument.cpp:
(WebCore::PluginDocument::PluginDocument):
* html/TextDocument.cpp:
(WebCore::TextDocument::TextDocument):
* html/TextDocument.h:
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument):
* loader/CookieJar.cpp:
(WebCore::CookieJar::cookieRequestHeaderFieldProxy):
(WebCore::CookieJar::cookieRequestHeaderFieldValue const):
* loader/CookieJar.h:
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::createDocument):
* loader/SinkDocument.cpp:
(WebCore::SinkDocument::SinkDocument):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::varyHeaderValuesMatch):
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::finishLoading):
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData):
* page/Page.cpp:
(WebCore::Page::configureLoggingChannel):
* platform/network/CacheValidation.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):
* platform/network/CacheValidation.h:
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::SVGDocument):
(WebCore::SVGDocument::cloneDocumentWithoutChildren const):
* svg/SVGDocument.h:
(WebCore::SVGDocument::create):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
* worklets/WorkletGlobalScope.h:
* xml/DOMParser.cpp:
(WebCore::DOMParser::parseFromString):
* xml/DOMParser.h:
* xml/DOMParser.idl:
* xml/XMLHttpRequest.cpp:
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):

Source/WebKit:

* WebProcess/WebPage/WebCookieJar.cpp:
(WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
* WebProcess/WebPage/WebCookieJar.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (250152 => 250153)


--- trunk/Source/WebCore/ChangeLog	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/ChangeLog	2019-09-20 21:35:58 UTC (rev 250153)
@@ -1,3 +1,104 @@
+2019-09-20  Chris Dumez  <cdu...@apple.com>
+
+        Document no longer needs to store a SessionID
+        https://bugs.webkit.org/show_bug.cgi?id=202024
+
+        Reviewed by Geoffrey Garen.
+
+        Document no longer needs to store a SessionID, now that we have a single
+        session per WebProcess. It can simply get its sessionID from its Page.
+
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::create):
+        * Modules/websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::didOpenSocketStream):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+        * dom/DOMImplementation.cpp:
+        (WebCore::createXMLDocument):
+        (WebCore::DOMImplementation::createDocument):
+        (WebCore::DOMImplementation::createHTMLDocument):
+        * dom/DOMImplementation.h:
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::m_undoManager):
+        (WebCore::Document::create):
+        (WebCore::Document::createNonRenderedPlaceholder):
+        (WebCore::Document::cloneDocumentWithoutChildren const):
+        (WebCore::Document::sessionID const):
+        (WebCore::Document::privateBrowsingStateDidChange):
+        (WebCore::Document::ensureTemplateDocument):
+        (WebCore::Document::logger):
+        (WebCore::Document::didLogMessage):
+        * dom/Document.h:
+        (WebCore::Document::create):
+        * dom/XMLDocument.h:
+        (WebCore::XMLDocument::create):
+        (WebCore::XMLDocument::createXHTML):
+        (WebCore::XMLDocument::XMLDocument):
+        * html/FTPDirectoryDocument.cpp:
+        (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
+        * html/FTPDirectoryDocument.h:
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::createSynthesizedDocument):
+        (WebCore::HTMLDocument::HTMLDocument):
+        (WebCore::HTMLDocument::cloneDocumentWithoutChildren const):
+        * html/HTMLDocument.h:
+        (WebCore::HTMLDocument::create):
+        * html/ImageDocument.cpp:
+        (WebCore::ImageDocument::ImageDocument):
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocument::MediaDocument):
+        * html/MediaDocument.h:
+        * html/PluginDocument.cpp:
+        (WebCore::PluginDocument::PluginDocument):
+        * html/TextDocument.cpp:
+        (WebCore::TextDocument::TextDocument):
+        * html/TextDocument.h:
+        * inspector/DOMPatchSupport.cpp:
+        (WebCore::DOMPatchSupport::patchDocument):
+        * loader/CookieJar.cpp:
+        (WebCore::CookieJar::cookieRequestHeaderFieldProxy):
+        (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
+        * loader/CookieJar.h:
+        * loader/DocumentWriter.cpp:
+        (WebCore::DocumentWriter::createDocument):
+        * loader/SinkDocument.cpp:
+        (WebCore::SinkDocument::SinkDocument):
+        * loader/cache/CachedResource.cpp:
+        (WebCore::CachedResource::setResponse):
+        (WebCore::CachedResource::varyHeaderValuesMatch):
+        * loader/cache/CachedSVGDocument.cpp:
+        (WebCore::CachedSVGDocument::finishLoading):
+        * loader/cache/CachedSVGFont.cpp:
+        (WebCore::CachedSVGFont::ensureCustomFontData):
+        * page/Page.cpp:
+        (WebCore::Page::configureLoggingChannel):
+        * platform/network/CacheValidation.cpp:
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::collectVaryingRequestHeaders):
+        (WebCore::verifyVaryingRequestHeaders):
+        * platform/network/CacheValidation.h:
+        * svg/SVGDocument.cpp:
+        (WebCore::SVGDocument::SVGDocument):
+        (WebCore::SVGDocument::cloneDocumentWithoutChildren const):
+        * svg/SVGDocument.h:
+        (WebCore::SVGDocument::create):
+        * workers/service/ServiceWorkerContainer.cpp:
+        (WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):
+        * worklets/WorkletGlobalScope.cpp:
+        (WebCore::WorkletGlobalScope::WorkletGlobalScope):
+        * worklets/WorkletGlobalScope.h:
+        * xml/DOMParser.cpp:
+        (WebCore::DOMParser::parseFromString):
+        * xml/DOMParser.h:
+        * xml/DOMParser.idl:
+        * xml/XMLHttpRequest.cpp:
+        * xml/XSLTProcessor.cpp:
+        (WebCore::XSLTProcessor::createDocumentFromSource):
+
 2019-09-20  Said Abou-Hallawa  <sabouhall...@apple.com>
 
         [SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and <rect> elements (Addressing review comments)

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (250152 => 250153)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -76,7 +76,7 @@
         peerConnection->m_pendingActivity = peerConnection->makePendingActivity(peerConnection.get());
         if (auto* page = document.page()) {
             peerConnection->registerToController(page->rtcController());
-            page->libWebRTCProvider().setEnableLogging(!document.sessionID().isEphemeral());
+            page->libWebRTCProvider().setEnableLogging(!page->sessionID().isEphemeral());
         }
     }
     return peerConnection;

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp (250152 => 250153)


--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -271,8 +271,8 @@
     }
     auto handshakeMessage = m_handshake->clientHandshakeMessage();
     Optional<CookieRequestHeaderFieldProxy> cookieRequestHeaderFieldProxy;
-    if (m_allowCookies)
-        cookieRequestHeaderFieldProxy = CookieJar::cookieRequestHeaderFieldProxy(*m_document, m_handshake->httpURLForAuthenticationAndCookies());
+    if (m_allowCookies && m_document->page())
+        cookieRequestHeaderFieldProxy = CookieJar::cookieRequestHeaderFieldProxy(m_document->page()->sessionID(), *m_document, m_handshake->httpURLForAuthenticationAndCookies());
     handle.sendHandshake(WTFMove(handshakeMessage), WTFMove(cookieRequestHeaderFieldProxy), [this, protectedThis = makeRef(*this)] (bool success, bool didAccessSecureCookies) {
         if (!success)
             fail("Failed to send WebSocket handshake.");

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (250152 => 250153)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2019-09-20 21:35:58 UTC (rev 250153)
@@ -2750,8 +2750,10 @@
         if ([attributeName isEqualToString:NSAccessibilityCaretBrowsingEnabledAttribute])
             return [NSNumber numberWithBool:m_object->caretBrowsingEnabled()];
         if ([attributeName isEqualToString:NSAccessibilityWebSessionIDAttribute]) {
-            if (Document* doc = m_object->topDocument())
-                return [NSNumber numberWithUnsignedLongLong:doc->sessionID().toUInt64()];
+            if (auto* document = m_object->topDocument()) {
+                if (auto* page = document->page())
+                    return [NSNumber numberWithUnsignedLongLong:page->sessionID().toUInt64()];
+            }
         }
     }
     

Modified: trunk/Source/WebCore/dom/DOMImplementation.cpp (250152 => 250153)


--- trunk/Source/WebCore/dom/DOMImplementation.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/dom/DOMImplementation.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -77,18 +77,18 @@
     return DocumentType::create(m_document, qualifiedName, publicId, systemId);
 }
 
-static inline Ref<XMLDocument> createXMLDocument(PAL::SessionID sessionID, const String& namespaceURI)
+static inline Ref<XMLDocument> createXMLDocument(const String& namespaceURI)
 {
     if (namespaceURI == SVGNames::svgNamespaceURI)
-        return SVGDocument::create(sessionID, nullptr, URL());
+        return SVGDocument::create(nullptr, URL());
     if (namespaceURI == HTMLNames::xhtmlNamespaceURI)
-        return XMLDocument::createXHTML(sessionID, nullptr, URL());
-    return XMLDocument::create(sessionID, nullptr, URL());
+        return XMLDocument::createXHTML(nullptr, URL());
+    return XMLDocument::create(nullptr, URL());
 }
 
 ExceptionOr<Ref<XMLDocument>> DOMImplementation::createDocument(const String& namespaceURI, const String& qualifiedName, DocumentType* documentType)
 {
-    auto document = createXMLDocument(m_document.sessionID(), namespaceURI);
+    auto document = createXMLDocument(namespaceURI);
     document->setContextDocument(m_document.contextDocument());
     document->setSecurityOriginPolicy(m_document.securityOriginPolicy());
 
@@ -120,7 +120,7 @@
 
 Ref<HTMLDocument> DOMImplementation::createHTMLDocument(const String& title)
 {
-    auto document = HTMLDocument::create(m_document.sessionID(), nullptr, URL());
+    auto document = HTMLDocument::create(nullptr, URL());
     document->open();
     document->write(nullptr, { "<!doctype html><html><head></head><body></body></html>"_s });
     if (!title.isNull()) {
@@ -134,7 +134,7 @@
     return document;
 }
 
-Ref<Document> DOMImplementation::createDocument(PAL::SessionID sessionID, const String& type, Frame* frame, const URL& url)
+Ref<Document> DOMImplementation::createDocument(const String& type, Frame* frame, const URL& url)
 {
     // FIXME: Inelegant to have this here just because this is the home of DOM APIs for creating documents.
     // This is internal, not a DOM API. Maybe we should put it in a new class called DocumentFactory,
@@ -142,11 +142,11 @@
 
     // Plug-ins cannot take over for HTML, XHTML, plain text, or non-PDF images.
     if (equalLettersIgnoringASCIICase(type, "text/html"))
-        return HTMLDocument::create(sessionID, frame, url);
+        return HTMLDocument::create(frame, url);
     if (equalLettersIgnoringASCIICase(type, "application/xhtml+xml"))
-        return XMLDocument::createXHTML(sessionID, frame, url);
+        return XMLDocument::createXHTML(frame, url);
     if (equalLettersIgnoringASCIICase(type, "text/plain"))
-        return TextDocument::create(sessionID, frame, url);
+        return TextDocument::create(frame, url);
     bool isImage = MIMETypeRegistry::isSupportedImageMIMEType(type);
     if (frame && isImage && !MIMETypeRegistry::isPDFOrPostScriptMIMEType(type))
         return ImageDocument::create(*frame, url);
@@ -160,12 +160,12 @@
     parameters.type = ContentType { type };
     parameters.url = ""
     if (MediaPlayer::supportsType(parameters))
-        return MediaDocument::create(sessionID, frame, url);
+        return MediaDocument::create(frame, url);
 #endif
 
 #if ENABLE(FTPDIR)
     if (equalLettersIgnoringASCIICase(type, "application/x-ftp-directory"))
-        return FTPDirectoryDocument::create(sessionID, frame, url);
+        return FTPDirectoryDocument::create(frame, url);
 #endif
 
     if (frame && frame->loader().client().shouldAlwaysUsePluginDocument(type))
@@ -184,12 +184,12 @@
     if (frame && isImage)
         return ImageDocument::create(*frame, url);
     if (MIMETypeRegistry::isTextMIMEType(type))
-        return TextDocument::create(sessionID, frame, url);
+        return TextDocument::create(frame, url);
     if (equalLettersIgnoringASCIICase(type, "image/svg+xml"))
-        return SVGDocument::create(sessionID, frame, url);
+        return SVGDocument::create(frame, url);
     if (MIMETypeRegistry::isXMLMIMEType(type))
-        return XMLDocument::create(sessionID, frame, url);
-    return HTMLDocument::create(sessionID, frame, url);
+        return XMLDocument::create(frame, url);
+    return HTMLDocument::create(frame, url);
 }
 
 }

Modified: trunk/Source/WebCore/dom/DOMImplementation.h (250152 => 250153)


--- trunk/Source/WebCore/dom/DOMImplementation.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/dom/DOMImplementation.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -43,7 +43,7 @@
     static bool hasFeature() { return true; }
     WEBCORE_EXPORT static Ref<CSSStyleSheet> createCSSStyleSheet(const String& title, const String& media);
 
-    static Ref<Document> createDocument(PAL::SessionID, const String& MIMEType, Frame*, const URL&);
+    static Ref<Document> createDocument(const String& MIMEType, Frame*, const URL&);
 
 private:
     Document& m_document;

Modified: trunk/Source/WebCore/dom/Document.cpp (250152 => 250153)


--- trunk/Source/WebCore/dom/Document.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/dom/Document.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -511,7 +511,7 @@
     return 0;
 }
 
-Document::Document(PAL::SessionID sessionID, Frame* frame, const URL& url, unsigned documentClasses, unsigned constructionFlags)
+Document::Document(Frame* frame, const URL& url, unsigned documentClasses, unsigned constructionFlags)
     : ContainerNode(*this, CreateDocument)
     , TreeScope(*this)
     , FrameDestructionObserver(frame)
@@ -561,12 +561,9 @@
     , m_isSynthesized(constructionFlags & Synthesized)
     , m_isNonRenderedPlaceholder(constructionFlags & NonRenderedPlaceholder)
     , m_orientationNotifier(currentOrientation(frame))
-    , m_sessionID(sessionID)
     , m_identifier(DocumentIdentifier::generate())
     , m_undoManager(UndoManager::create(*this))
 {
-    ASSERT(!frame || frame->sessionID() == m_sessionID);
-
     auto addResult = allDocumentsMap().add(m_identifier, this);
     ASSERT_UNUSED(addResult, addResult.isNewEntry);
 
@@ -597,7 +594,7 @@
 
 Ref<Document> Document::create(Document& contextDocument)
 {
-    auto document = adoptRef(*new Document(contextDocument.sessionID(), nullptr, URL()));
+    auto document = adoptRef(*new Document(nullptr, URL()));
     document->setContextDocument(contextDocument);
     document->setSecurityOriginPolicy(contextDocument.securityOriginPolicy());
     return document;
@@ -605,7 +602,7 @@
 
 Ref<Document> Document::createNonRenderedPlaceholder(Frame& frame, const URL& url)
 {
-    return adoptRef(*new Document(frame.sessionID(), &frame, url, DefaultDocumentClass, NonRenderedPlaceholder));
+    return adoptRef(*new Document(&frame, url, DefaultDocumentClass, NonRenderedPlaceholder));
 }
 
 Document::~Document()
@@ -3881,10 +3878,10 @@
 {
     if (isXMLDocument()) {
         if (isXHTMLDocument())
-            return XMLDocument::createXHTML(sessionID(), nullptr, url());
-        return XMLDocument::create(sessionID(), nullptr, url());
+            return XMLDocument::createXHTML(nullptr, url());
+        return XMLDocument::create(nullptr, url());
     }
-    return create(sessionID(), url());
+    return create(url());
 }
 
 void Document::cloneDataFromDocument(const Document& other)
@@ -5068,9 +5065,10 @@
     return completeURL(url, m_baseURL);
 }
 
-PAL::SessionID Document::sessionID() const
+Optional<PAL::SessionID> Document::sessionID() const
 {
-    return m_sessionID;
+    auto* page = this->page();
+    return page ? makeOptional(page->sessionID()) : WTF::nullopt;
 }
 
 void Document::setPageCacheState(PageCacheState state)
@@ -5270,7 +5268,6 @@
 
 void Document::privateBrowsingStateDidChange(PAL::SessionID sessionID)
 {
-    m_sessionID = sessionID;
     if (m_logger)
         m_logger->setEnabled(this, sessionID.isAlwaysOnLoggingAllowed());
 
@@ -6893,9 +6890,9 @@
         return const_cast<Document&>(*document);
 
     if (isHTMLDocument())
-        m_templateDocument = HTMLDocument::create(sessionID(), nullptr, WTF::blankURL());
+        m_templateDocument = HTMLDocument::create(nullptr, WTF::blankURL());
     else
-        m_templateDocument = create(sessionID(), WTF::blankURL());
+        m_templateDocument = create(WTF::blankURL());
 
     m_templateDocument->setContextDocument(contextDocument());
     m_templateDocument->setTemplateDocumentHost(this); // balanced in dtor.
@@ -7792,7 +7789,7 @@
 {
     if (!m_logger) {
         m_logger = Logger::create(this);
-        m_logger->setEnabled(this, sessionID().isAlwaysOnLoggingAllowed());
+        m_logger->setEnabled(this, sessionID() && sessionID()->isAlwaysOnLoggingAllowed());
         m_logger->addObserver(*this);
     }
 
@@ -8041,10 +8038,11 @@
         });
         return;
     }
-    if (!page())
+    auto* page = this->page();
+    if (!page)
         return;
 
-    ASSERT(sessionID().isAlwaysOnLoggingAllowed());
+    ASSERT(page->sessionID().isAlwaysOnLoggingAllowed());
 
     auto messageSource = messageSourceForWTFLogChannel(channel);
     if (messageSource == MessageSource::Other)
@@ -8051,7 +8049,7 @@
         return;
 
     m_logMessageTaskQueue.enqueueTask([this, level, messageSource, logMessages = WTFMove(logMessages)]() mutable {
-        if (!page())
+        if (!this->page())
             return;
 
         auto messageLevel = messageLevelFromWTFLogLevel(level);

Modified: trunk/Source/WebCore/dom/Document.h (250152 => 250153)


--- trunk/Source/WebCore/dom/Document.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/dom/Document.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -351,7 +351,7 @@
     , public Logger::Observer {
     WTF_MAKE_ISO_ALLOCATED(Document);
 public:
-    static Ref<Document> create(PAL::SessionID, const URL&);
+    static Ref<Document> create(const URL&);
     static Ref<Document> createNonRenderedPlaceholder(Frame&, const URL&);
     static Ref<Document> create(Document&);
 
@@ -683,7 +683,7 @@
 
     WEBCORE_EXPORT URL completeURL(const String&) const final;
     URL completeURL(const String&, const URL& baseURLOverride) const;
-    WEBCORE_EXPORT PAL::SessionID sessionID() const;
+    WEBCORE_EXPORT Optional<PAL::SessionID> sessionID() const;
 
     String userAgent(const URL&) const final;
 
@@ -1538,7 +1538,7 @@
 
 protected:
     enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 };
-    Document(PAL::SessionID, Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned constructionFlags = 0);
+    Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned constructionFlags = 0);
 
     void clearXMLVersion() { m_xmlVersion = String(); }
 
@@ -2018,7 +2018,6 @@
 #endif
 
     OrientationNotifier m_orientationNotifier;
-    mutable PAL::SessionID m_sessionID;
     mutable RefPtr<Logger> m_logger;
     RefPtr<StringCallback> m_consoleMessageListener;
 
@@ -2082,9 +2081,9 @@
     return existingAXObjectCacheSlow();
 }
 
-inline Ref<Document> Document::create(PAL::SessionID sessionID, const URL& url)
+inline Ref<Document> Document::create(const URL& url)
 {
-    return adoptRef(*new Document(sessionID, nullptr, url));
+    return adoptRef(*new Document(nullptr, url));
 }
 
 inline void Document::invalidateAccessKeyCache()

Modified: trunk/Source/WebCore/dom/XMLDocument.h (250152 => 250153)


--- trunk/Source/WebCore/dom/XMLDocument.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/dom/XMLDocument.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -32,19 +32,19 @@
 class XMLDocument : public Document {
     WTF_MAKE_ISO_ALLOCATED(XMLDocument);
 public:
-    static Ref<XMLDocument> create(PAL::SessionID sessionID, Frame* frame, const URL& url)
+    static Ref<XMLDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(*new XMLDocument(sessionID, frame, url));
+        return adoptRef(*new XMLDocument(frame, url));
     }
 
-    static Ref<XMLDocument> createXHTML(PAL::SessionID sessionID, Frame* frame, const URL& url)
+    static Ref<XMLDocument> createXHTML(Frame* frame, const URL& url)
     {
-        return adoptRef(*new XMLDocument(sessionID, frame, url, XHTMLDocumentClass));
+        return adoptRef(*new XMLDocument(frame, url, XHTMLDocumentClass));
     }
 
 protected:
-    XMLDocument(PAL::SessionID sessionID, Frame* frame, const URL& url, unsigned documentClasses = DefaultDocumentClass)
-        : Document(sessionID, frame, url, XMLDocumentClass | documentClasses)
+    XMLDocument(Frame* frame, const URL& url, unsigned documentClasses = DefaultDocumentClass)
+        : Document(frame, url, XMLDocumentClass | documentClasses)
     { }
 };
 

Modified: trunk/Source/WebCore/html/FTPDirectoryDocument.cpp (250152 => 250153)


--- trunk/Source/WebCore/html/FTPDirectoryDocument.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/FTPDirectoryDocument.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -421,8 +421,8 @@
     HTMLDocumentParser::finish();
 }
 
-FTPDirectoryDocument::FTPDirectoryDocument(PAL::SessionID sessionID, Frame* frame, const URL& url)
-    : HTMLDocument(sessionID, frame, url)
+FTPDirectoryDocument::FTPDirectoryDocument(Frame* frame, const URL& url)
+    : HTMLDocument(frame, url)
 {
 #if !LOG_DISABLED
     LogFTP.state = WTFLogChannelState::On;

Modified: trunk/Source/WebCore/html/FTPDirectoryDocument.h (250152 => 250153)


--- trunk/Source/WebCore/html/FTPDirectoryDocument.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/FTPDirectoryDocument.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -31,13 +31,13 @@
 class FTPDirectoryDocument final : public HTMLDocument {
     WTF_MAKE_ISO_ALLOCATED(FTPDirectoryDocument);
 public:
-    static Ref<FTPDirectoryDocument> create(PAL::SessionID sessionID, Frame* frame, const URL& url)
+    static Ref<FTPDirectoryDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(*new FTPDirectoryDocument(sessionID, frame, url));
+        return adoptRef(*new FTPDirectoryDocument(frame, url));
     }
 
 private:
-    FTPDirectoryDocument(PAL::SessionID, Frame*, const URL&);
+    FTPDirectoryDocument(Frame*, const URL&);
     Ref<DocumentParser> createParser() override;
 };
 

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (250152 => 250153)


--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -407,7 +407,7 @@
     using Source = AdClickAttribution::Source;
     using Destination = AdClickAttribution::Destination;
 
-    if (document().sessionID().isEphemeral()
+    if (!document().sessionID() || document().sessionID()->isEphemeral()
         || !RuntimeEnabledFeatures::sharedFeatures().adClickAttributionEnabled()
         || !UserGestureIndicator::processingUserGesture())
         return WTF::nullopt;

Modified: trunk/Source/WebCore/html/HTMLDocument.cpp (250152 => 250153)


--- trunk/Source/WebCore/html/HTMLDocument.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/HTMLDocument.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -89,11 +89,11 @@
 
 Ref<HTMLDocument> HTMLDocument::createSynthesizedDocument(Frame& frame, const URL& url)
 {
-    return adoptRef(*new HTMLDocument(frame.sessionID(), &frame, url, HTMLDocumentClass, Synthesized));
+    return adoptRef(*new HTMLDocument(&frame, url, HTMLDocumentClass, Synthesized));
 }
 
-HTMLDocument::HTMLDocument(PAL::SessionID sessionID, Frame* frame, const URL& url, DocumentClassFlags documentClasses, unsigned constructionFlags)
-    : Document(sessionID, frame, url, documentClasses | HTMLDocumentClass, constructionFlags)
+HTMLDocument::HTMLDocument(Frame* frame, const URL& url, DocumentClassFlags documentClasses, unsigned constructionFlags)
+    : Document(frame, url, documentClasses | HTMLDocumentClass, constructionFlags)
 {
     clearXMLVersion();
 }
@@ -252,7 +252,7 @@
 
 Ref<Document> HTMLDocument::cloneDocumentWithoutChildren() const
 {
-    return create(sessionID(), nullptr, url());
+    return create(nullptr, url());
 }
 
 }

Modified: trunk/Source/WebCore/html/HTMLDocument.h (250152 => 250153)


--- trunk/Source/WebCore/html/HTMLDocument.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/HTMLDocument.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -29,7 +29,7 @@
 class HTMLDocument : public Document {
     WTF_MAKE_ISO_ALLOCATED(HTMLDocument);
 public:
-    static Ref<HTMLDocument> create(PAL::SessionID, Frame*, const URL&);
+    static Ref<HTMLDocument> create(Frame*, const URL&);
     static Ref<HTMLDocument> createSynthesizedDocument(Frame&, const URL&);
     virtual ~HTMLDocument();
 
@@ -54,7 +54,7 @@
     static bool isCaseSensitiveAttribute(const QualifiedName&);
 
 protected:
-    HTMLDocument(PAL::SessionID, Frame*, const URL&, DocumentClassFlags = 0, unsigned constructionFlags = 0);
+    HTMLDocument(Frame*, const URL&, DocumentClassFlags = 0, unsigned constructionFlags = 0);
 
 private:
     bool isFrameSet() const final;
@@ -65,9 +65,9 @@
     TreeScopeOrderedMap m_windowNamedItem;
 };
 
-inline Ref<HTMLDocument> HTMLDocument::create(PAL::SessionID sessionID, Frame* frame, const URL& url)
+inline Ref<HTMLDocument> HTMLDocument::create(Frame* frame, const URL& url)
 {
-    return adoptRef(*new HTMLDocument(sessionID, frame, url, HTMLDocumentClass));
+    return adoptRef(*new HTMLDocument(frame, url, HTMLDocumentClass));
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/html/ImageDocument.cpp (250152 => 250153)


--- trunk/Source/WebCore/html/ImageDocument.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/ImageDocument.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -198,7 +198,7 @@
 }
 
 ImageDocument::ImageDocument(Frame& frame, const URL& url)
-    : HTMLDocument(frame.sessionID(), &frame, url, ImageDocumentClass)
+    : HTMLDocument(&frame, url, ImageDocumentClass)
     , m_imageElement(nullptr)
     , m_imageSizeIsKnown(false)
 #if !PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebCore/html/MediaDocument.cpp (250152 => 250153)


--- trunk/Source/WebCore/html/MediaDocument.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/MediaDocument.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -144,8 +144,8 @@
     finish();
 }
     
-MediaDocument::MediaDocument(PAL::SessionID sessionID, Frame* frame, const URL& url)
-    : HTMLDocument(sessionID, frame, url, MediaDocumentClass)
+MediaDocument::MediaDocument(Frame* frame, const URL& url)
+    : HTMLDocument(frame, url, MediaDocumentClass)
     , m_replaceMediaElementTimer(*this, &MediaDocument::replaceMediaElementTimerFired)
 {
     setCompatibilityMode(DocumentCompatibilityMode::QuirksMode);

Modified: trunk/Source/WebCore/html/MediaDocument.h (250152 => 250153)


--- trunk/Source/WebCore/html/MediaDocument.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/MediaDocument.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -34,9 +34,9 @@
 class MediaDocument final : public HTMLDocument {
     WTF_MAKE_ISO_ALLOCATED(MediaDocument);
 public:
-    static Ref<MediaDocument> create(PAL::SessionID sessionID, Frame* frame, const URL& url)
+    static Ref<MediaDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(*new MediaDocument(sessionID, frame, url));
+        return adoptRef(*new MediaDocument(frame, url));
     }
     virtual ~MediaDocument();
 
@@ -45,7 +45,7 @@
     String outgoingReferrer() const { return m_outgoingReferrer; }
 
 private:
-    MediaDocument(PAL::SessionID, Frame*, const URL&);
+    MediaDocument(Frame*, const URL&);
 
     Ref<DocumentParser> createParser() override;
 

Modified: trunk/Source/WebCore/html/PluginDocument.cpp (250152 => 250153)


--- trunk/Source/WebCore/html/PluginDocument.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/PluginDocument.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -142,7 +142,7 @@
 }
 
 PluginDocument::PluginDocument(Frame& frame, const URL& url)
-    : HTMLDocument(frame.sessionID(), &frame, url, PluginDocumentClass)
+    : HTMLDocument(&frame, url, PluginDocumentClass)
 {
     setCompatibilityMode(DocumentCompatibilityMode::QuirksMode);
     lockCompatibilityMode();

Modified: trunk/Source/WebCore/html/TextDocument.cpp (250152 => 250153)


--- trunk/Source/WebCore/html/TextDocument.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/TextDocument.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -32,8 +32,8 @@
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(TextDocument);
 
-TextDocument::TextDocument(PAL::SessionID sessionID, Frame* frame, const URL& url)
-    : HTMLDocument(sessionID, frame, url, TextDocumentClass)
+TextDocument::TextDocument(Frame* frame, const URL& url)
+    : HTMLDocument(frame, url, TextDocumentClass)
 {
     setCompatibilityMode(DocumentCompatibilityMode::QuirksMode);
     lockCompatibilityMode();

Modified: trunk/Source/WebCore/html/TextDocument.h (250152 => 250153)


--- trunk/Source/WebCore/html/TextDocument.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/html/TextDocument.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -31,13 +31,13 @@
 class TextDocument final : public HTMLDocument {
     WTF_MAKE_ISO_ALLOCATED(TextDocument);
 public:
-    static Ref<TextDocument> create(PAL::SessionID sessionID, Frame* frame, const URL& url)
+    static Ref<TextDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(*new TextDocument(sessionID, frame, url));
+        return adoptRef(*new TextDocument(frame, url));
     }
 
 private:
-    TextDocument(PAL::SessionID, Frame*, const URL&);
+    TextDocument(Frame*, const URL&);
     
     Ref<DocumentParser> createParser() override;
 };

Modified: trunk/Source/WebCore/inspector/DOMPatchSupport.cpp (250152 => 250153)


--- trunk/Source/WebCore/inspector/DOMPatchSupport.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/inspector/DOMPatchSupport.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -76,11 +76,11 @@
 {
     RefPtr<Document> newDocument;
     if (m_document.isHTMLDocument())
-        newDocument = HTMLDocument::create(m_document.sessionID(), nullptr, URL());
+        newDocument = HTMLDocument::create(nullptr, URL());
     else if (m_document.isXHTMLDocument())
-        newDocument = XMLDocument::createXHTML(m_document.sessionID(), nullptr, URL());
+        newDocument = XMLDocument::createXHTML(nullptr, URL());
     else if (m_document.isSVGDocument())
-        newDocument = XMLDocument::create(m_document.sessionID(), nullptr, URL());
+        newDocument = XMLDocument::create(nullptr, URL());
 
     ASSERT(newDocument);
     RefPtr<DocumentParser> parser;

Modified: trunk/Source/WebCore/loader/CookieJar.cpp (250152 => 250153)


--- trunk/Source/WebCore/loader/CookieJar.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/loader/CookieJar.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -90,7 +90,7 @@
     return result.first;
 }
 
-CookieRequestHeaderFieldProxy CookieJar::cookieRequestHeaderFieldProxy(const Document& document, const URL& url)
+CookieRequestHeaderFieldProxy CookieJar::cookieRequestHeaderFieldProxy(PAL::SessionID sessionID, const Document& document, const URL& url)
 {
     TraceScope scope(FetchCookiesStart, FetchCookiesEnd);
 
@@ -101,7 +101,7 @@
         pageID = frame->loader().client().pageID();
     }
 
-    return { document.sessionID(), document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, shouldIncludeSecureCookies(document, url) };
+    return { sessionID, document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, shouldIncludeSecureCookies(document, url) };
 }
 
 void CookieJar::setCookies(Document& document, const URL& url, const String& cookieString)
@@ -128,7 +128,7 @@
     return false;
 }
 
-std::pair<String, SecureCookiesAccessed> CookieJar::cookieRequestHeaderFieldValue(const PAL::SessionID&, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, IncludeSecureCookies includeSecureCookies) const
+std::pair<String, SecureCookiesAccessed> CookieJar::cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, IncludeSecureCookies includeSecureCookies) const
 {
     if (auto* session = m_storageSessionProvider->storageSession()) {
         std::pair<String, bool> result = session->cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies);
@@ -148,7 +148,7 @@
         pageID = frame->loader().client().pageID();
     }
 
-    auto result = cookieRequestHeaderFieldValue(document.sessionID(), document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, shouldIncludeSecureCookies(document, url));
+    auto result = cookieRequestHeaderFieldValue(document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, shouldIncludeSecureCookies(document, url));
     if (result.second == SecureCookiesAccessed::Yes)
         document.setSecureCookiesAccessed();
     return result.first;

Modified: trunk/Source/WebCore/loader/CookieJar.h (250152 => 250153)


--- trunk/Source/WebCore/loader/CookieJar.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/loader/CookieJar.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -51,7 +51,7 @@
 public:
     static Ref<CookieJar> create(Ref<StorageSessionProvider>&&);
     
-    static CookieRequestHeaderFieldProxy cookieRequestHeaderFieldProxy(const Document&, const URL&);
+    static CookieRequestHeaderFieldProxy cookieRequestHeaderFieldProxy(PAL::SessionID, const Document&, const URL&);
 
     String cookieRequestHeaderFieldValue(Document&, const URL&) const;
 
@@ -60,7 +60,7 @@
     virtual void setCookies(Document&, const URL&, const String& cookieString);
 
     virtual bool cookiesEnabled(const Document&) const;
-    virtual std::pair<String, SecureCookiesAccessed> cookieRequestHeaderFieldValue(const PAL::SessionID&, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<FrameIdentifier>, Optional<PageIdentifier>, IncludeSecureCookies) const;
+    virtual std::pair<String, SecureCookiesAccessed> cookieRequestHeaderFieldValue(const URL& firstParty, const SameSiteInfo&, const URL&, Optional<FrameIdentifier>, Optional<PageIdentifier>, IncludeSecureCookies) const;
     virtual bool getRawCookies(const Document&, const URL&, Vector<Cookie>&) const;
     virtual void deleteCookie(const Document&, const URL&, const String& cookieName);
 

Modified: trunk/Source/WebCore/loader/DocumentWriter.cpp (250152 => 250153)


--- trunk/Source/WebCore/loader/DocumentWriter.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/loader/DocumentWriter.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -115,7 +115,7 @@
 #endif
     if (!m_frame->loader().client().hasHTMLView())
         return Document::createNonRenderedPlaceholder(*m_frame, url);
-    return DOMImplementation::createDocument(m_frame->sessionID(), m_mimeType, m_frame, url);
+    return DOMImplementation::createDocument(m_mimeType, m_frame, url);
 }
 
 bool DocumentWriter::begin(const URL& urlReference, bool dispatch, Document* ownerDocument)

Modified: trunk/Source/WebCore/loader/SinkDocument.cpp (250152 => 250153)


--- trunk/Source/WebCore/loader/SinkDocument.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/loader/SinkDocument.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -54,7 +54,7 @@
 };
 
 SinkDocument::SinkDocument(Frame& frame, const URL& url)
-    : HTMLDocument(frame.sessionID(), &frame, url)
+    : HTMLDocument(&frame, url)
 {
     setCompatibilityMode(DocumentCompatibilityMode::QuirksMode);
     lockCompatibilityMode();

Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (250152 => 250153)


--- trunk/Source/WebCore/loader/cache/CachedResource.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -478,7 +478,7 @@
 {
     ASSERT(m_response.type() == ResourceResponse::Type::Default);
     m_response = response;
-    m_varyingHeaderValues = collectVaryingRequestHeaders(cookieJar(), m_resourceRequest, m_response, sessionID());
+    m_varyingHeaderValues = collectVaryingRequestHeaders(cookieJar(), m_resourceRequest, m_response);
 
 #if ENABLE(SERVICE_WORKER)
     if (m_response.source() == ResourceResponse::Source::ServiceWorker) {
@@ -860,7 +860,7 @@
     if (m_varyingHeaderValues.isEmpty())
         return true;
 
-    return verifyVaryingRequestHeaders(cookieJar(), m_varyingHeaderValues, request, sessionID());
+    return verifyVaryingRequestHeaders(cookieJar(), m_varyingHeaderValues, request);
 }
 
 unsigned CachedResource::overheadSize() const

Modified: trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp (250152 => 250153)


--- trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/loader/cache/CachedSVGDocument.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -49,7 +49,7 @@
 {
     if (data) {
         // We don't need to create a new frame because the new document belongs to the parent UseElement.
-        m_document = SVGDocument::create(sessionID(), nullptr, response().url());
+        m_document = SVGDocument::create(nullptr, response().url());
         m_document->setContent(m_decoder->decodeAndFlush(data->data(), data->size()));
     }
     CachedResource::finishLoading(data);

Modified: trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp (250152 => 250153)


--- trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -68,7 +68,7 @@
         {
             // We may get here during render tree updates when events are forbidden.
             // Frameless document can't run scripts or call back to the client so this is safe.
-            m_externalSVGDocument = SVGDocument::create(sessionID(), nullptr, URL());
+            m_externalSVGDocument = SVGDocument::create(nullptr, URL());
             auto decoder = TextResourceDecoder::create("application/xml");
 
             ScriptDisallowedScope::DisableAssertionsInScope disabledScope;

Modified: trunk/Source/WebCore/page/Page.cpp (250152 => 250153)


--- trunk/Source/WebCore/page/Page.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/page/Page.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -2967,7 +2967,7 @@
 
 #if USE(LIBWEBRTC)
         if (channel == &LogWebRTC && m_mainFrame->document())
-            libWebRTCProvider().setEnableLogging(!m_mainFrame->document()->sessionID().isEphemeral());
+            libWebRTCProvider().setEnableLogging(!sessionID().isEphemeral());
 #endif
     }
 

Modified: trunk/Source/WebCore/platform/network/CacheValidation.cpp (250152 => 250153)


--- trunk/Source/WebCore/platform/network/CacheValidation.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/platform/network/CacheValidation.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -333,12 +333,12 @@
     return session.cookieRequestHeaderFieldValue(request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), WTF::nullopt, WTF::nullopt, request.url().protocolIs("https") ? IncludeSecureCookies::Yes : IncludeSecureCookies::No).first;
 }
 
-static String cookieRequestHeaderFieldValue(const CookieJar* cookieJar, const PAL::SessionID& sessionID, const ResourceRequest& request)
+static String cookieRequestHeaderFieldValue(const CookieJar* cookieJar, const ResourceRequest& request)
 {
     if (!cookieJar)
         return { };
 
-    return cookieJar->cookieRequestHeaderFieldValue(sessionID, request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), WTF::nullopt, WTF::nullopt, request.url().protocolIs("https") ? IncludeSecureCookies::Yes : IncludeSecureCookies::No).first;
+    return cookieJar->cookieRequestHeaderFieldValue(request.firstPartyForCookies(), SameSiteInfo::create(request), request.url(), WTF::nullopt, WTF::nullopt, request.url().protocolIs("https") ? IncludeSecureCookies::Yes : IncludeSecureCookies::No).first;
 }
 
 static String headerValueForVary(const ResourceRequest& request, const String& headerName, Function<String()>&& cookieRequestHeaderFieldValueFunction)
@@ -379,11 +379,11 @@
     });
 }
 
-Vector<std::pair<String, String>> collectVaryingRequestHeaders(const CookieJar* cookieJar, const ResourceRequest& request, const ResourceResponse& response, const PAL::SessionID& sessionID)
+Vector<std::pair<String, String>> collectVaryingRequestHeaders(const CookieJar* cookieJar, const ResourceRequest& request, const ResourceResponse& response)
 {
     return collectVaryingRequestHeadersInternal(response, [&] (const String& headerName) {
         return headerValueForVary(request, headerName, [&] {
-            return cookieRequestHeaderFieldValue(cookieJar, sessionID, request);
+            return cookieRequestHeaderFieldValue(cookieJar, request);
         });
     });
 }
@@ -411,11 +411,11 @@
     });
 }
 
-bool verifyVaryingRequestHeaders(const CookieJar* cookieJar, const Vector<std::pair<String, String>>& varyingRequestHeaders, const ResourceRequest& request, const PAL::SessionID& sessionID)
+bool verifyVaryingRequestHeaders(const CookieJar* cookieJar, const Vector<std::pair<String, String>>& varyingRequestHeaders, const ResourceRequest& request)
 {
     return verifyVaryingRequestHeadersInternal(varyingRequestHeaders, [&] (const String& headerName) {
         return headerValueForVary(request, headerName, [&] {
-            return cookieRequestHeaderFieldValue(cookieJar, sessionID, request);
+            return cookieRequestHeaderFieldValue(cookieJar, request);
         });
     });
 }

Modified: trunk/Source/WebCore/platform/network/CacheValidation.h (250152 => 250153)


--- trunk/Source/WebCore/platform/network/CacheValidation.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/platform/network/CacheValidation.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -77,9 +77,9 @@
 WEBCORE_EXPORT CacheControlDirectives parseCacheControlDirectives(const HTTPHeaderMap&);
 
 WEBCORE_EXPORT Vector<std::pair<String, String>> collectVaryingRequestHeaders(NetworkStorageSession*, const ResourceRequest&, const ResourceResponse&);
-WEBCORE_EXPORT Vector<std::pair<String, String>> collectVaryingRequestHeaders(const CookieJar*, const ResourceRequest&, const ResourceResponse&, const PAL::SessionID&);
+WEBCORE_EXPORT Vector<std::pair<String, String>> collectVaryingRequestHeaders(const CookieJar*, const ResourceRequest&, const ResourceResponse&);
 WEBCORE_EXPORT bool verifyVaryingRequestHeaders(NetworkStorageSession*, const Vector<std::pair<String, String>>& varyingRequestHeaders, const ResourceRequest&);
-WEBCORE_EXPORT bool verifyVaryingRequestHeaders(const CookieJar*, const Vector<std::pair<String, String>>& varyingRequestHeaders, const ResourceRequest&, const PAL::SessionID&);
+WEBCORE_EXPORT bool verifyVaryingRequestHeaders(const CookieJar*, const Vector<std::pair<String, String>>& varyingRequestHeaders, const ResourceRequest&);
 
 WEBCORE_EXPORT bool isStatusCodeCacheableByDefault(int statusCode);
 WEBCORE_EXPORT bool isStatusCodePotentiallyCacheable(int statusCode);

Modified: trunk/Source/WebCore/svg/SVGDocument.cpp (250152 => 250153)


--- trunk/Source/WebCore/svg/SVGDocument.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/svg/SVGDocument.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -30,8 +30,8 @@
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(SVGDocument);
 
-SVGDocument::SVGDocument(PAL::SessionID sessionID, Frame* frame, const URL& url)
-    : XMLDocument(sessionID, frame, url, SVGDocumentClass)
+SVGDocument::SVGDocument(Frame* frame, const URL& url)
+    : XMLDocument(frame, url, SVGDocumentClass)
 {
 }
 
@@ -69,7 +69,7 @@
 
 Ref<Document> SVGDocument::cloneDocumentWithoutChildren() const
 {
-    return create(sessionID(), nullptr, url());
+    return create(nullptr, url());
 }
 
 }

Modified: trunk/Source/WebCore/svg/SVGDocument.h (250152 => 250153)


--- trunk/Source/WebCore/svg/SVGDocument.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/svg/SVGDocument.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -30,7 +30,7 @@
 class SVGDocument final : public XMLDocument {
     WTF_MAKE_ISO_ALLOCATED(SVGDocument);
 public:
-    static Ref<SVGDocument> create(PAL::SessionID, Frame*, const URL&);
+    static Ref<SVGDocument> create(Frame*, const URL&);
 
     static RefPtr<SVGSVGElement> rootElement(const Document&);
 
@@ -39,7 +39,7 @@
     void updatePan(const FloatPoint& position) const;
 
 private:
-    SVGDocument(PAL::SessionID, Frame*, const URL&);
+    SVGDocument(Frame*, const URL&);
 
     Ref<Document> cloneDocumentWithoutChildren() const override;
 
@@ -46,9 +46,9 @@
     FloatSize m_panningOffset;
 };
 
-inline Ref<SVGDocument> SVGDocument::create(PAL::SessionID sessionID, Frame* frame, const URL& url)
+inline Ref<SVGDocument> SVGDocument::create(Frame* frame, const URL& url)
 {
-    return adoptRef(*new SVGDocument(sessionID, frame, url));
+    return adoptRef(*new SVGDocument(frame, url));
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp (250152 => 250153)


--- trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -621,8 +621,10 @@
     if (!context)
         return false;
 
-    if (is<Document>(*context))
-        return downcast<Document>(*context).sessionID().isAlwaysOnLoggingAllowed();
+    if (is<Document>(*context)) {
+        auto sessionID = downcast<Document>(*context).sessionID();
+        return sessionID && sessionID->isAlwaysOnLoggingAllowed();
+    }
 
     // FIXME: No logging inside service workers for now.
     return false;

Modified: trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp (250152 => 250153)


--- trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -48,7 +48,6 @@
 
 WorkletGlobalScope::WorkletGlobalScope(Document& document, ScriptSourceCode&& code)
     : m_document(makeWeakPtr(document))
-    , m_sessionID(m_document->sessionID())
     , m_script(makeUnique<WorkletScriptController>(this))
     , m_topOrigin(SecurityOrigin::createUnique())
     , m_eventQueue(*this)

Modified: trunk/Source/WebCore/worklets/WorkletGlobalScope.h (250152 => 250153)


--- trunk/Source/WebCore/worklets/WorkletGlobalScope.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/worklets/WorkletGlobalScope.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -120,7 +120,6 @@
     bool unwrapCryptoKey(const Vector<uint8_t>&, Vector<uint8_t>&) final { RELEASE_ASSERT_NOT_REACHED(); return false; }
 #endif
     URL completeURL(const String&) const final;
-    PAL::SessionID sessionID() const { return m_sessionID; }
     String userAgent(const URL&) const final;
     void disableEval(const String&) final;
     void disableWebAssembly(const String&) final;
@@ -127,7 +126,6 @@
 
     WeakPtr<Document> m_document;
 
-    PAL::SessionID m_sessionID;
     std::unique_ptr<WorkletScriptController> m_script;
 
     Ref<SecurityOrigin> m_topOrigin;

Modified: trunk/Source/WebCore/xml/DOMParser.cpp (250152 => 250153)


--- trunk/Source/WebCore/xml/DOMParser.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/xml/DOMParser.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -34,11 +34,11 @@
     return adoptRef(*new DOMParser(contextDocument));
 }
 
-ExceptionOr<Ref<Document>> DOMParser::parseFromString(Document& callingDocument, const String& string, const String& contentType)
+ExceptionOr<Ref<Document>> DOMParser::parseFromString(const String& string, const String& contentType)
 {
     if (contentType != "text/html" && contentType != "text/xml" && contentType != "application/xml" && contentType != "application/xhtml+xml" && contentType != "image/svg+xml")
         return Exception { TypeError };
-    auto document = DOMImplementation::createDocument(callingDocument.sessionID(), contentType, nullptr, URL { });
+    auto document = DOMImplementation::createDocument(contentType, nullptr, URL { });
     if (m_contextDocument)
         document->setContextDocument(*m_contextDocument.get());
     document->setContent(string);

Modified: trunk/Source/WebCore/xml/DOMParser.h (250152 => 250153)


--- trunk/Source/WebCore/xml/DOMParser.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/xml/DOMParser.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -28,7 +28,7 @@
 class DOMParser : public RefCounted<DOMParser> {
 public:
     static Ref<DOMParser> create(Document& contextDocument);
-    ExceptionOr<Ref<Document>> parseFromString(Document&, const String&, const String& contentType);
+    ExceptionOr<Ref<Document>> parseFromString(const String&, const String& contentType);
 
 private:
     explicit DOMParser(Document& contextDocument);

Modified: trunk/Source/WebCore/xml/DOMParser.idl (250152 => 250153)


--- trunk/Source/WebCore/xml/DOMParser.idl	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/xml/DOMParser.idl	2019-09-20 21:35:58 UTC (rev 250153)
@@ -22,5 +22,5 @@
     ConstructorCallWith=Document,
     ImplementationLacksVTable,
 ] interface DOMParser {
-    [MayThrowException, NewObject, CallWith=Document] Document parseFromString(DOMString string, DOMString contentType);
+    [MayThrowException, NewObject] Document parseFromString(DOMString string, DOMString contentType);
 };

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (250152 => 250153)


--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -185,9 +185,9 @@
             m_responseDocument = nullptr;
         } else {
             if (isHTML)
-                m_responseDocument = HTMLDocument::create(context.sessionID(), nullptr, m_url);
+                m_responseDocument = HTMLDocument::create(nullptr, m_url);
             else
-                m_responseDocument = XMLDocument::create(context.sessionID(), nullptr, m_url);
+                m_responseDocument = XMLDocument::create(nullptr, m_url);
             m_responseDocument->overrideLastModified(m_response.lastModified());
             m_responseDocument->setContent(m_responseBuilder.toStringPreserveCapacity());
             m_responseDocument->setContextDocument(context);

Modified: trunk/Source/WebCore/xml/XSLTProcessor.cpp (250152 => 250153)


--- trunk/Source/WebCore/xml/XSLTProcessor.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebCore/xml/XSLTProcessor.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -72,10 +72,10 @@
 
     RefPtr<Document> result;
     if (sourceMIMEType == "text/plain") {
-        result = XMLDocument::createXHTML(ownerDocument->sessionID(), frame, sourceIsDocument ? ownerDocument->url() : URL());
+        result = XMLDocument::createXHTML(frame, sourceIsDocument ? ownerDocument->url() : URL());
         transformTextStringToXHTMLDocumentString(documentSource);
     } else
-        result = DOMImplementation::createDocument(ownerDocument->sessionID(), sourceMIMEType, frame, sourceIsDocument ? ownerDocument->url() : URL());
+        result = DOMImplementation::createDocument(sourceMIMEType, frame, sourceIsDocument ? ownerDocument->url() : URL());
 
     // Before parsing, we need to save & detach the old document and get the new document
     // in place. We have to do this only if we're rendering the result document.

Modified: trunk/Source/WebKit/ChangeLog (250152 => 250153)


--- trunk/Source/WebKit/ChangeLog	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebKit/ChangeLog	2019-09-20 21:35:58 UTC (rev 250153)
@@ -1,5 +1,19 @@
 2019-09-20  Chris Dumez  <cdu...@apple.com>
 
+        Document no longer needs to store a SessionID
+        https://bugs.webkit.org/show_bug.cgi?id=202024
+
+        Reviewed by Geoffrey Garen.
+
+        Document no longer needs to store a SessionID, now that we have a single
+        session per WebProcess. It can simply get its sessionID from its Page.
+
+        * WebProcess/WebPage/WebCookieJar.cpp:
+        (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
+        * WebProcess/WebPage/WebCookieJar.h:
+
+2019-09-20  Chris Dumez  <cdu...@apple.com>
+
         [iOS] ASSERTION FAILED: Unsafe to ref/deref of ShareableBitmap from different threads
         https://bugs.webkit.org/show_bug.cgi?id=201712
         <rdar://problem/55289916>

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp (250152 => 250153)


--- trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp	2019-09-20 21:35:58 UTC (rev 250153)
@@ -85,7 +85,7 @@
     return result;
 }
 
-std::pair<String, WebCore::SecureCookiesAccessed> WebCookieJar::cookieRequestHeaderFieldValue(const PAL::SessionID&, const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, WebCore::IncludeSecureCookies includeSecureCookies) const
+std::pair<String, WebCore::SecureCookiesAccessed> WebCookieJar::cookieRequestHeaderFieldValue(const URL& firstParty, const WebCore::SameSiteInfo& sameSiteInfo, const URL& url, Optional<FrameIdentifier> frameID, Optional<PageIdentifier> pageID, WebCore::IncludeSecureCookies includeSecureCookies) const
 {
     String cookieString;
     bool secureCookiesAccessed = false;

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.h (250152 => 250153)


--- trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.h	2019-09-20 21:23:20 UTC (rev 250152)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.h	2019-09-20 21:35:58 UTC (rev 250153)
@@ -36,7 +36,7 @@
     String cookies(WebCore::Document&, const URL&) const final;
     void setCookies(WebCore::Document&, const URL&, const String& cookieString) final;
     bool cookiesEnabled(const WebCore::Document&) const final;
-    std::pair<String, WebCore::SecureCookiesAccessed> cookieRequestHeaderFieldValue(const PAL::SessionID&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<WebCore::FrameIdentifier>, Optional<WebCore::PageIdentifier>, WebCore::IncludeSecureCookies) const final;
+    std::pair<String, WebCore::SecureCookiesAccessed> cookieRequestHeaderFieldValue(const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<WebCore::FrameIdentifier>, Optional<WebCore::PageIdentifier>, WebCore::IncludeSecureCookies) const final;
     bool getRawCookies(const WebCore::Document&, const URL&, Vector<WebCore::Cookie>&) const final;
     void deleteCookie(const WebCore::Document&, const URL&, const String& cookieName) final;
 private:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to