Remove use of emptySessionID from WebPageCreationParameters
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2019 17:16:58 +0000 (17:16 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2019 17:16:58 +0000 (17:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200708

Reviewed by Alex Christensen.

Make WebPageCreationParameters constructor take a SessionID.
Update constructor call sites.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
(WebKit::WebPageCreationParameters::WebPageCreationParameters):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248675 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPageCreationParameters.cpp
Source/WebKit/Shared/WebPageCreationParameters.h
Source/WebKit/UIProcess/WebPageProxy.cpp

index 9154dee..0f17825 100644 (file)
@@ -1,5 +1,22 @@
 2019-08-14  Youenn Fablet  <youenn@apple.com>
 
+        Remove use of emptySessionID from WebPageCreationParameters
+        https://bugs.webkit.org/show_bug.cgi?id=200708
+
+        Reviewed by Alex Christensen.
+
+        Make WebPageCreationParameters constructor take a SessionID.
+        Update constructor call sites.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPageCreationParameters.h:
+        (WebKit::WebPageCreationParameters::WebPageCreationParameters):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
+
+2019-08-14  Youenn Fablet  <youenn@apple.com>
+
         Remove API::PageConfiguration::m_sessionID
         https://bugs.webkit.org/show_bug.cgi?id=200670
 
index d6ab4e7..ec32393 100644 (file)
@@ -32,6 +32,7 @@ namespace WebKit {
 
 void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
 {
+    encoder << sessionID;
     encoder << viewSize;
     encoder << activityState;
 
@@ -52,7 +53,6 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << paginationLineGridEnabled;
     encoder << userAgent;
     encoder << itemStates;
-    encoder << sessionID;
     encoder << userContentControllerID;
     encoder << visitedLinkTableID;
     encoder << websiteDataStoreID;
@@ -137,7 +137,13 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
 
 Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decoder& decoder)
 {
-    WebPageCreationParameters parameters;
+    Optional<PAL::SessionID> sessionID;
+    decoder >> sessionID;
+    if (!sessionID)
+        return WTF::nullopt;
+
+    WebPageCreationParameters parameters { *sessionID };
+
     if (!decoder.decode(parameters.viewSize))
         return WTF::nullopt;
     if (!decoder.decode(parameters.activityState))
@@ -191,9 +197,6 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
         return WTF::nullopt;
     parameters.itemStates = WTFMove(*itemStates);
 
-    if (!decoder.decode(parameters.sessionID))
-        return WTF::nullopt;
-
     Optional<UserContentControllerIdentifier> userContentControllerIdentifier;
     decoder >> userContentControllerIdentifier;
     if (!userContentControllerIdentifier)
index a951c60..e19d996 100644 (file)
@@ -64,9 +64,15 @@ class Encoder;
 namespace WebKit {
 
 struct WebPageCreationParameters {
+    explicit WebPageCreationParameters(PAL::SessionID sessionID)
+        : sessionID(sessionID)
+    {
+    }
+
     void encode(IPC::Encoder&) const;
     static Optional<WebPageCreationParameters> decode(IPC::Decoder&);
 
+    PAL::SessionID sessionID;
     WebCore::IntSize viewSize;
 
     OptionSet<WebCore::ActivityState::Flag> activityState;
@@ -97,7 +103,6 @@ struct WebPageCreationParameters {
     String userAgent;
 
     Vector<BackForwardListItemState> itemStates;
-    PAL::SessionID sessionID { PAL::SessionID::emptySessionID() };
 
     UserContentControllerIdentifier userContentControllerID;
     uint64_t visitedLinkTableID;
index 7fa2b4d..32631c4 100644 (file)
@@ -7169,7 +7169,7 @@ void WebPageProxy::resetStateAfterProcessExited(ProcessTerminationReason termina
 
 WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& process, DrawingAreaProxy& drawingArea)
 {
-    WebPageCreationParameters parameters;
+    WebPageCreationParameters parameters { process.websiteDataStore().sessionID() };
 
     parameters.viewSize = pageClient().viewSize();
     parameters.activityState = m_activityState;
@@ -7191,7 +7191,6 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc
     parameters.paginationLineGridEnabled = m_paginationLineGridEnabled;
     parameters.userAgent = userAgent();
     parameters.itemStates = m_backForwardList->itemStates();
-    parameters.sessionID = process.websiteDataStore().sessionID();
     parameters.userContentControllerID = m_userContentController->identifier();
     parameters.visitedLinkTableID = m_visitedLinkStore->identifier();
     parameters.websiteDataStoreID = process.websiteDataStore().identifier();