WebSocketStream does not need a SessionID
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2019 03:45:06 +0000 (03:45 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2019 03:45:06 +0000 (03:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201960

Reviewed by Geoffrey Garen.

WebSocketStream does not need a SessionID, now that we have a single session per WebProcess.

Source/WebCore:

* platform/network/cf/SocketStreamHandleImpl.h:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):

Source/WebKit:

* WebProcess/Network/WebSocketProvider.cpp:
(WebKit::WebSocketProvider::createSocketStreamHandle):
* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::create):
(WebKit::WebSocketStream::WebSocketStream):
* WebProcess/Network/WebSocketStream.h:

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h
Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/Network/WebSocketProvider.cpp
Source/WebKit/WebProcess/Network/WebSocketStream.cpp
Source/WebKit/WebProcess/Network/WebSocketStream.h

index cf13853..5165874 100644 (file)
@@ -1,5 +1,18 @@
 2019-09-18  Chris Dumez  <cdumez@apple.com>
 
+        WebSocketStream does not need a SessionID
+        https://bugs.webkit.org/show_bug.cgi?id=201960
+
+        Reviewed by Geoffrey Garen.
+
+        WebSocketStream does not need a SessionID, now that we have a single session per WebProcess.
+
+        * platform/network/cf/SocketStreamHandleImpl.h:
+        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
+        (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
+
+2019-09-18  Chris Dumez  <cdumez@apple.com>
+
         LibWebRTCProvider does not need sessionIDs anymore
         https://bugs.webkit.org/show_bug.cgi?id=201959
 
index 1c52521..d677280 100644 (file)
@@ -103,7 +103,6 @@ private:
     RetainPtr<CFWriteStreamRef> m_writeStream;
 
     RetainPtr<CFURLRef> m_httpsURL; // ws(s): replaced with https:
-    PAL::SessionID m_sessionID;
     String m_credentialPartition;
     SourceApplicationAuditToken m_auditData;
     RefPtr<const StorageSessionProvider> m_storageSessionProvider;
index b33d043..f949244 100644 (file)
@@ -101,7 +101,6 @@ SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandl
     , m_connectingSubstate(New)
     , m_connectionType(Unknown)
     , m_sentStoredCredentials(false)
-    , m_sessionID(sessionID)
     , m_credentialPartition(credentialPartition)
     , m_auditData(WTFMove(auditData))
     , m_storageSessionProvider(provider)
index ab77d02..1609062 100644 (file)
@@ -1,5 +1,21 @@
 2019-09-18  Chris Dumez  <cdumez@apple.com>
 
+        WebSocketStream does not need a SessionID
+        https://bugs.webkit.org/show_bug.cgi?id=201960
+
+        Reviewed by Geoffrey Garen.
+
+        WebSocketStream does not need a SessionID, now that we have a single session per WebProcess.
+
+        * WebProcess/Network/WebSocketProvider.cpp:
+        (WebKit::WebSocketProvider::createSocketStreamHandle):
+        * WebProcess/Network/WebSocketStream.cpp:
+        (WebKit::WebSocketStream::create):
+        (WebKit::WebSocketStream::WebSocketStream):
+        * WebProcess/Network/WebSocketStream.h:
+
+2019-09-18  Chris Dumez  <cdumez@apple.com>
+
         LibWebRTCProvider does not need sessionIDs anymore
         https://bugs.webkit.org/show_bug.cgi?id=201959
 
index 1f856c1..20528c3 100644 (file)
@@ -40,7 +40,8 @@ using namespace WebCore;
 
 Ref<SocketStreamHandle> WebSocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, const StorageSessionProvider*)
 {
-    return WebSocketStream::create(url, client, sessionID, credentialPartition);
+    ASSERT_UNUSED(sessionID, sessionID == WebProcess::singleton().sessionID());
+    return WebSocketStream::create(url, client, credentialPartition);
 }
 
 RefPtr<ThreadableWebSocketChannel> WebSocketProvider::createWebSocketChannel(Document& document, WebSocketChannelClient& client)
index 3ca9004..ba17b0c 100644 (file)
@@ -35,7 +35,6 @@
 #include <WebCore/CookieRequestHeaderFieldProxy.h>
 #include <WebCore/SocketStreamError.h>
 #include <WebCore/SocketStreamHandleClient.h>
-#include <pal/SessionID.h>
 #include <wtf/NeverDestroyed.h>
 
 namespace WebKit {
@@ -77,12 +76,12 @@ void WebSocketStream::networkProcessCrashed()
     globalWebSocketStreamMap().clear();
 }
 
-Ref<WebSocketStream> WebSocketStream::create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition)
+Ref<WebSocketStream> WebSocketStream::create(const URL& url, SocketStreamHandleClient& client, const String& credentialPartition)
 {
-    return adoptRef(*new WebSocketStream(url, client, sessionID, credentialPartition));
+    return adoptRef(*new WebSocketStream(url, client, credentialPartition));
 }
 
-WebSocketStream::WebSocketStream(const URL& url, WebCore::SocketStreamHandleClient& client, PAL::SessionID, const String& cachePartition)
+WebSocketStream::WebSocketStream(const URL& url, WebCore::SocketStreamHandleClient& client, const String& cachePartition)
     : SocketStreamHandle(url, client)
     , m_client(client)
 {
index 82b885e..604ec62 100644 (file)
@@ -28,7 +28,6 @@
 #include "MessageReceiver.h"
 #include "MessageSender.h"
 #include <WebCore/SocketStreamHandle.h>
-#include <pal/SessionID.h>
 #include <wtf/Identified.h>
 
 namespace IPC {
@@ -45,7 +44,7 @@ namespace WebKit {
 
 class WebSocketStream : public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::SocketStreamHandle, public Identified<WebSocketStream> {
 public:
-    static Ref<WebSocketStream> create(const URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition);
+    static Ref<WebSocketStream> create(const URL&, WebCore::SocketStreamHandleClient&, const String& credentialPartition);
     static void networkProcessCrashed();
     static WebSocketStream* streamWithIdentifier(uint64_t);
     
@@ -73,7 +72,7 @@ private:
     IPC::Connection* messageSenderConnection() const final;
     uint64_t messageSenderDestinationID() const final;
 
-    WebSocketStream(const URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition);
+    WebSocketStream(const URL&, WebCore::SocketStreamHandleClient&, const String& credentialPartition);
     ~WebSocketStream();
 
     size_t m_bufferedAmount { 0 };