Title: [203225] trunk/Source/WebCore
Revision
203225
Author
[email protected]
Date
2016-07-14 10:26:00 -0700 (Thu, 14 Jul 2016)

Log Message

Pass SessionID to WebSocketHandle constructor
https://bugs.webkit.org/show_bug.cgi?id=159772

Reviewed by Brady Eidson.

No new tests.  No change in behavior.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* platform/network/cf/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
* platform/network/curl/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
* platform/network/soup/SocketStreamHandle.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (203224 => 203225)


--- trunk/Source/WebCore/ChangeLog	2016-07-14 15:48:12 UTC (rev 203224)
+++ trunk/Source/WebCore/ChangeLog	2016-07-14 17:26:00 UTC (rev 203225)
@@ -1,3 +1,22 @@
+2016-07-14  Alex Christensen  <[email protected]>
+
+        Pass SessionID to WebSocketHandle constructor
+        https://bugs.webkit.org/show_bug.cgi?id=159772
+
+        Reviewed by Brady Eidson.
+
+        No new tests.  No change in behavior.
+
+        * Modules/websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::connect):
+        * platform/network/cf/SocketStreamHandle.h:
+        (WebCore::SocketStreamHandle::create):
+        * platform/network/cf/SocketStreamHandleCFNet.cpp:
+        (WebCore::SocketStreamHandle::SocketStreamHandle):
+        * platform/network/curl/SocketStreamHandle.h:
+        (WebCore::SocketStreamHandle::create):
+        * platform/network/soup/SocketStreamHandle.h:
+
 2016-07-14  Carlos Garcia Campos  <[email protected]>
 
         [GLib] Use a GSource instead of a thread to poll memory pressure eventFD in linux implementation

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp (203224 => 203225)


--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp	2016-07-14 15:48:12 UTC (rev 203224)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp	2016-07-14 17:26:00 UTC (rev 203225)
@@ -97,7 +97,8 @@
         if (NetworkingContext* networkingContext = frame->loader().networkingContext()) {
             ref();
             Page* page = frame->page();
-            m_handle = SocketStreamHandle::create(m_handshake->url(), *this, *networkingContext, (page ? page->usesEphemeralSession() : false));
+            SessionID sessionID = page ? page->sessionID() : SessionID::defaultSessionID();
+            m_handle = SocketStreamHandle::create(m_handshake->url(), *this, *networkingContext, sessionID);
         }
     }
 }

Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h (203224 => 203225)


--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h	2016-07-14 15:48:12 UTC (rev 203224)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h	2016-07-14 17:26:00 UTC (rev 203225)
@@ -31,6 +31,7 @@
 
 #pragma once
 
+#include "SessionID.h"
 #include "SocketStreamHandleBase.h"
 #include <wtf/RetainPtr.h>
 #include <wtf/ThreadSafeRefCounted.h>
@@ -47,7 +48,7 @@
 
 class SocketStreamHandle : public ThreadSafeRefCounted<SocketStreamHandle>, public SocketStreamHandleBase {
 public:
-    static Ref<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient& client, NetworkingContext& networkingContext, bool usesEphemeralSession) { return adoptRef(*new SocketStreamHandle(url, client, networkingContext, usesEphemeralSession)); }
+    static Ref<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient& client, NetworkingContext& networkingContext, SessionID sessionID) { return adoptRef(*new SocketStreamHandle(url, client, networkingContext, sessionID)); }
 
     virtual ~SocketStreamHandle();
 
@@ -55,7 +56,7 @@
     virtual int platformSend(const char* data, int length);
     virtual void platformClose();
 
-    SocketStreamHandle(const URL&, SocketStreamHandleClient&, NetworkingContext&, bool usesEphemeralSession);
+    SocketStreamHandle(const URL&, SocketStreamHandleClient&, NetworkingContext&, SessionID);
     void createStreams();
     void scheduleStreams();
     void chooseProxy();

Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp (203224 => 203225)


--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp	2016-07-14 15:48:12 UTC (rev 203224)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp	2016-07-14 17:26:00 UTC (rev 203225)
@@ -67,7 +67,7 @@
 
 namespace WebCore {
 
-SocketStreamHandle::SocketStreamHandle(const URL& url, SocketStreamHandleClient& client, NetworkingContext& networkingContext, bool usesEphemeralSession)
+SocketStreamHandle::SocketStreamHandle(const URL& url, SocketStreamHandleClient& client, NetworkingContext& networkingContext, SessionID sessionID)
     : SocketStreamHandleBase(url, client)
     , m_connectingSubstate(New)
     , m_connectionType(Unknown)
@@ -85,7 +85,7 @@
     // Don't check for HSTS violation for ephemeral sessions since
     // HSTS state should not transfer between regular and private browsing.
     if (url.protocolIs("ws")
-        && !usesEphemeralSession
+        && !sessionID.isEphemeral()
         && _CFNetworkIsKnownHSTSHostWithSession(m_httpsURL.get(), nullptr)) {
         m_client.didFailSocketStream(*this, SocketStreamError(0, m_url.string(), "WebSocket connection failed because it violates HTTP Strict Transport Security."));
         return;

Modified: trunk/Source/WebCore/platform/network/curl/SocketStreamHandle.h (203224 => 203225)


--- trunk/Source/WebCore/platform/network/curl/SocketStreamHandle.h	2016-07-14 15:48:12 UTC (rev 203224)
+++ trunk/Source/WebCore/platform/network/curl/SocketStreamHandle.h	2016-07-14 17:26:00 UTC (rev 203225)
@@ -37,8 +37,8 @@
 #include <winsock2.h>
 #endif
 
+#include "SessionID.h"
 #include <curl/curl.h>
-
 #include <wtf/Deque.h>
 #include <wtf/Lock.h>
 #include <wtf/RefCounted.h>
@@ -51,7 +51,7 @@
 
 class SocketStreamHandle : public ThreadSafeRefCounted<SocketStreamHandle>, public SocketStreamHandleBase {
 public:
-    static Ref<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient& client, NetworkingContext&, bool) { return adoptRef(*new SocketStreamHandle(url, client)); }
+    static Ref<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient& client, NetworkingContext&, SessionID) { return adoptRef(*new SocketStreamHandle(url, client)); }
 
     virtual ~SocketStreamHandle();
 

Modified: trunk/Source/WebCore/platform/network/soup/SocketStreamHandle.h (203224 => 203225)


--- trunk/Source/WebCore/platform/network/soup/SocketStreamHandle.h	2016-07-14 15:48:12 UTC (rev 203224)
+++ trunk/Source/WebCore/platform/network/soup/SocketStreamHandle.h	2016-07-14 17:26:00 UTC (rev 203225)
@@ -37,6 +37,7 @@
 
 #if USE(SOUP)
 
+#include "SessionID.h"
 #include <wtf/RefCounted.h>
 #include <wtf/glib/GRefPtr.h>
 
@@ -48,7 +49,7 @@
 
 class SocketStreamHandle final : public RefCounted<SocketStreamHandle>, public SocketStreamHandleBase {
 public:
-    static Ref<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient& client, NetworkingContext&, bool) { return adoptRef(*new SocketStreamHandle(url, client)); }
+    static Ref<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient& client, NetworkingContext&, SessionID) { return adoptRef(*new SocketStreamHandle(url, client)); }
     static Ref<SocketStreamHandle> create(GSocketConnection* socketConnection, SocketStreamHandleClient& client) { return adoptRef(*new SocketStreamHandle(socketConnection, client)); }
 
     virtual ~SocketStreamHandle();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to