Title: [249979] trunk/Source/WebKit
Revision
249979
Author
[email protected]
Date
2019-09-17 13:48:58 -0700 (Tue, 17 Sep 2019)

Log Message

WebSWServerConnection does not need to store a sessionID
https://bugs.webkit.org/show_bug.cgi?id=201878

Reviewed by Geoffrey Garen.

WebSWServerConnection does not need to store a sessionID, it can simply get it from its SWServer.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
* NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::WebSWServerConnection):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::sessionID const):
* NetworkProcess/ServiceWorker/WebSWServerConnection.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (249978 => 249979)


--- trunk/Source/WebKit/ChangeLog	2019-09-17 20:20:38 UTC (rev 249978)
+++ trunk/Source/WebKit/ChangeLog	2019-09-17 20:48:58 UTC (rev 249979)
@@ -1,5 +1,22 @@
 2019-09-17  Chris Dumez  <[email protected]>
 
+        WebSWServerConnection does not need to store a sessionID
+        https://bugs.webkit.org/show_bug.cgi?id=201878
+
+        Reviewed by Geoffrey Garen.
+
+        WebSWServerConnection does not need to store a sessionID, it can simply get it from its SWServer.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
+        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
+        (WebKit::WebSWServerConnection::WebSWServerConnection):
+        (WebKit::WebSWServerConnection::startFetch):
+        (WebKit::WebSWServerConnection::sessionID const):
+        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
+
+2019-09-17  Chris Dumez  <[email protected]>
+
         WebPaymentCoordinatorProxy does not need sessionIDs
         https://bugs.webkit.org/show_bug.cgi?id=201875
 

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (249978 => 249979)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-09-17 20:20:38 UTC (rev 249978)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-09-17 20:48:58 UTC (rev 249979)
@@ -862,7 +862,7 @@
 void NetworkConnectionToWebProcess::establishSWServerConnection()
 {
     auto& server = m_networkProcess->swServerForSession(m_sessionID);
-    auto connection = makeUnique<WebSWServerConnection>(m_networkProcess, server, m_connection.get(), m_webProcessIdentifier, m_sessionID);
+    auto connection = makeUnique<WebSWServerConnection>(m_networkProcess, server, m_connection.get(), m_webProcessIdentifier);
 
     ASSERT(!m_swConnection);
     m_swConnection = makeWeakPtr(*connection);

Modified: trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp (249978 => 249979)


--- trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp	2019-09-17 20:20:38 UTC (rev 249978)
+++ trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp	2019-09-17 20:48:58 UTC (rev 249979)
@@ -58,12 +58,11 @@
 using namespace PAL;
 using namespace WebCore;
 
-#define SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(m_sessionID.isAlwaysOnLoggingAllowed(), ServiceWorker, "%p - WebSWServerConnection::" fmt, this, ##__VA_ARGS__)
-#define SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED(fmt, ...) RELEASE_LOG_ERROR_IF(m_sessionID.isAlwaysOnLoggingAllowed(), ServiceWorker, "%p - WebSWServerConnection::" fmt, this, ##__VA_ARGS__)
+#define SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(sessionID().isAlwaysOnLoggingAllowed(), ServiceWorker, "%p - WebSWServerConnection::" fmt, this, ##__VA_ARGS__)
+#define SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED(fmt, ...) RELEASE_LOG_ERROR_IF(sessionID().isAlwaysOnLoggingAllowed(), ServiceWorker, "%p - WebSWServerConnection::" fmt, this, ##__VA_ARGS__)
 
-WebSWServerConnection::WebSWServerConnection(NetworkProcess& networkProcess, SWServer& server, IPC::Connection& connection, ProcessIdentifier processIdentifier, SessionID sessionID)
+WebSWServerConnection::WebSWServerConnection(NetworkProcess& networkProcess, SWServer& server, IPC::Connection& connection, ProcessIdentifier processIdentifier)
     : SWServer::Connection(server, processIdentifier)
-    , m_sessionID(sessionID)
     , m_contentConnection(connection)
     , m_networkProcess(networkProcess)
 {
@@ -189,7 +188,7 @@
 
             if (contextConnection) {
                 SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("startFetch: Starting fetch %s via service worker %s", fetchIdentifier.loggingString().utf8().data(), serviceWorkerIdentifier.loggingString().utf8().data());
-                static_cast<WebSWServerToContextConnection&>(*contextConnection).startFetch(m_sessionID, m_contentConnection.get(), this->identifier(), fetchIdentifier, serviceWorkerIdentifier, request, options, formData, referrer);
+                static_cast<WebSWServerToContextConnection&>(*contextConnection).startFetch(sessionID(), m_contentConnection.get(), this->identifier(), fetchIdentifier, serviceWorkerIdentifier, request, options, formData, referrer);
             } else {
                 SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("startFetch: fetchIdentifier: %s DidNotHandle because failed to run service worker", fetchIdentifier.loggingString().utf8().data());
                 m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier);
@@ -357,6 +356,11 @@
     syncTerminateWorker(WTFMove(identifier));
     completionHandler();
 }
+
+PAL::SessionID WebSWServerConnection::sessionID() const
+{
+    return server().sessionID();
+}
     
 template<typename U> void WebSWServerConnection::sendToContextProcess(WebCore::SWServerToContextConnection& connection, U&& message)
 {

Modified: trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h (249978 => 249979)


--- trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h	2019-09-17 20:20:38 UTC (rev 249978)
+++ trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.h	2019-09-17 20:48:58 UTC (rev 249979)
@@ -54,7 +54,7 @@
 
 class WebSWServerConnection : public WebCore::SWServer::Connection, public IPC::MessageSender, public IPC::MessageReceiver {
 public:
-    WebSWServerConnection(NetworkProcess&, WebCore::SWServer&, IPC::Connection&, WebCore::ProcessIdentifier, PAL::SessionID);
+    WebSWServerConnection(NetworkProcess&, WebCore::SWServer&, IPC::Connection&, WebCore::ProcessIdentifier);
     WebSWServerConnection(const WebSWServerConnection&) = delete;
     ~WebSWServerConnection() final;
 
@@ -62,9 +62,9 @@
 
     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
     void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
+    
+    PAL::SessionID sessionID() const;
 
-    PAL::SessionID sessionID() const { return m_sessionID; }
-
 private:
     // Implement SWServer::Connection (Messages to the client WebProcess)
     void rejectJobInClient(WebCore::ServiceWorkerJobIdentifier, const WebCore::ExceptionData&) final;
@@ -109,7 +109,6 @@
     
     template<typename U> static void sendToContextProcess(WebCore::SWServerToContextConnection&, U&& message);
 
-    PAL::SessionID m_sessionID;
     Ref<IPC::Connection> m_contentConnection;
     Ref<NetworkProcess> m_networkProcess;
     HashMap<WebCore::ServiceWorkerClientIdentifier, WebCore::ClientOrigin> m_clientOrigins;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to