Title: [250236] trunk/Source/WebKit
Revision
250236
Author
[email protected]
Date
2019-09-23 09:31:15 -0700 (Mon, 23 Sep 2019)

Log Message

WebPage::sessionID() does not need to get the sessionID from there WebCore Page
https://bugs.webkit.org/show_bug.cgi?id=202094

Reviewed by Youenn Fablet.

WebPage::sessionID() does not need to get the sessionID from there WebCore Page, it can
simply get the sessionID from the WebProcess singleton, now that we have a single session
per WebProcess. This will avoid potential crashes trying to dereference m_page to get the
sessionID, since m_page can be null.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sessionID const):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sessionID const): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (250235 => 250236)


--- trunk/Source/WebKit/ChangeLog	2019-09-23 16:14:21 UTC (rev 250235)
+++ trunk/Source/WebKit/ChangeLog	2019-09-23 16:31:15 UTC (rev 250236)
@@ -1,3 +1,20 @@
+2019-09-23  Chris Dumez  <[email protected]>
+
+        WebPage::sessionID() does not need to get the sessionID from there WebCore Page
+        https://bugs.webkit.org/show_bug.cgi?id=202094
+
+        Reviewed by Youenn Fablet.
+
+        WebPage::sessionID() does not need to get the sessionID from there WebCore Page, it can
+        simply get the sessionID from the WebProcess singleton, now that we have a single session
+        per WebProcess. This will avoid potential crashes trying to dereference m_page to get the
+        sessionID, since m_page can be null.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::sessionID const):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::sessionID const): Deleted.
+
 2019-09-23  Youenn Fablet  <[email protected]>
 
         Simplify UserMediaPermissionRequestManager management of UserMediaRequest

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (250235 => 250236)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-09-23 16:14:21 UTC (rev 250235)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-09-23 16:31:15 UTC (rev 250236)
@@ -6807,6 +6807,16 @@
     return document->searchForElementByIdentifier(textInputContext.elementIdentifier);
 }
 
+PAL::SessionID WebPage::sessionID() const
+{
+    return WebProcess::singleton().sessionID();
+}
+
+bool WebPage::usesEphemeralSession() const
+{
+    return sessionID().isEphemeral();
+}
+
 void WebPage::configureLoggingChannel(const String& channelName, WTFLogChannelState state, WTFLogLevel level)
 {
     send(Messages::WebPageProxy::ConfigureLoggingChannel(channelName, state, level));

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (250235 => 250236)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-09-23 16:14:21 UTC (rev 250235)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-09-23 16:31:15 UTC (rev 250236)
@@ -293,8 +293,8 @@
     WebCore::Page* corePage() const { return m_page.get(); }
     WebCore::PageIdentifier identifier() const { return m_identifier; }
     StorageNamespaceIdentifier sessionStorageNamespaceIdentifier() const { return makeObjectIdentifier<StorageNamespaceIdentifierType>(m_webPageProxyIdentifier.toUInt64()); }
-    PAL::SessionID sessionID() const { return m_page->sessionID(); }
-    bool usesEphemeralSession() const { return m_page->usesEphemeralSession(); }
+    PAL::SessionID sessionID() const;
+    bool usesEphemeralSession() const;
 
     void setSize(const WebCore::IntSize&);
     const WebCore::IntSize& size() const { return m_viewSize; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to