Title: [233785] trunk/Source/WebKit
Revision
233785
Author
[email protected]
Date
2018-07-12 16:29:44 -0700 (Thu, 12 Jul 2018)

Log Message

Simplify code in NetworkConnectionToWebProcess::didReceiveMessage()
https://bugs.webkit.org/show_bug.cgi?id=187621

Reviewed by Youenn Fablet.

Simplify code in NetworkConnectionToWebProcess::didReceiveMessage() by not using HashMap iterators and
calling get() directly.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didReceiveMessage):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (233784 => 233785)


--- trunk/Source/WebKit/ChangeLog	2018-07-12 22:24:34 UTC (rev 233784)
+++ trunk/Source/WebKit/ChangeLog	2018-07-12 23:29:44 UTC (rev 233785)
@@ -1,5 +1,18 @@
 2018-07-12  Chris Dumez  <[email protected]>
 
+        Simplify code in NetworkConnectionToWebProcess::didReceiveMessage()
+        https://bugs.webkit.org/show_bug.cgi?id=187621
+
+        Reviewed by Youenn Fablet.
+
+        Simplify code in NetworkConnectionToWebProcess::didReceiveMessage() by not using HashMap iterators and
+        calling get() directly.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
+
+2018-07-12  Chris Dumez  <[email protected]>
+
         Make sure WebProcess::ensureNetworkProcessConnection() is always called on the main thread
         https://bugs.webkit.org/show_bug.cgi?id=187607
 

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (233784 => 233785)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2018-07-12 22:24:34 UTC (rev 233784)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2018-07-12 23:29:44 UTC (rev 233785)
@@ -105,20 +105,16 @@
     if (decoder.messageReceiverName() == Messages::NetworkResourceLoader::messageReceiverName()) {
         RELEASE_ASSERT(RunLoop::isMain());
         RELEASE_ASSERT(decoder.destinationID());
-        auto loaderIterator = m_networkResourceLoaders.find(decoder.destinationID());
-        if (loaderIterator != m_networkResourceLoaders.end()) {
-            RELEASE_ASSERT(loaderIterator->value);
-            loaderIterator->value->didReceiveNetworkResourceLoaderMessage(connection, decoder);
-        }
+        if (auto* loader = m_networkResourceLoaders.get(decoder.destinationID()))
+            loader->didReceiveNetworkResourceLoaderMessage(connection, decoder);
         return;
     }
 
     if (decoder.messageReceiverName() == Messages::NetworkSocketStream::messageReceiverName()) {
-        auto socketIterator = m_networkSocketStreams.find(decoder.destinationID());
-        if (socketIterator != m_networkSocketStreams.end()) {
-            socketIterator->value->didReceiveMessage(connection, decoder);
+        if (auto* socketStream = m_networkSocketStreams.get(decoder.destinationID())) {
+            socketStream->didReceiveMessage(connection, decoder);
             if (decoder.messageName() == Messages::NetworkSocketStream::Close::name())
-                m_networkSocketStreams.remove(socketIterator);
+                m_networkSocketStreams.remove(decoder.destinationID());
         }
         return;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to