Title: [248108] branches/safari-608.1-branch/Source/WebKit
Revision
248108
Author
alanc...@apple.com
Date
2019-08-01 10:55:50 -0700 (Thu, 01 Aug 2019)

Log Message

Cherry-pick r247905. rdar://problem/53820893

    Possible use-after-move under NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated()
    https://bugs.webkit.org/show_bug.cgi?id=200225

    Reviewed by Brent Fulgham.

    The code was WTFMove()-ing the method parameter inside of a loop, which means that it could
    move it several times. Instead of copying the parameters, I opted into sending the statistics
    only to the network session that matches this WebProcess connection.

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

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

Modified Paths

Diff

Modified: branches/safari-608.1-branch/Source/WebKit/ChangeLog (248107 => 248108)


--- branches/safari-608.1-branch/Source/WebKit/ChangeLog	2019-08-01 17:55:45 UTC (rev 248107)
+++ branches/safari-608.1-branch/Source/WebKit/ChangeLog	2019-08-01 17:55:50 UTC (rev 248108)
@@ -1,5 +1,38 @@
 2019-08-01  Kocsen Chung  <kocsen_ch...@apple.com>
 
+        Cherry-pick r247905. rdar://problem/53820893
+
+    Possible use-after-move under NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated()
+    https://bugs.webkit.org/show_bug.cgi?id=200225
+    
+    Reviewed by Brent Fulgham.
+    
+    The code was WTFMove()-ing the method parameter inside of a loop, which means that it could
+    move it several times. Instead of copying the parameters, I opted into sending the statistics
+    only to the network session that matches this WebProcess connection.
+    
+    * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+    (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-29  Chris Dumez  <cdu...@apple.com>
+
+            Possible use-after-move under NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated()
+            https://bugs.webkit.org/show_bug.cgi?id=200225
+
+            Reviewed by Brent Fulgham.
+
+            The code was WTFMove()-ing the method parameter inside of a loop, which means that it could
+            move it several times. Instead of copying the parameters, I opted into sending the statistics
+            only to the network session that matches this WebProcess connection.
+
+            * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+            (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
+
+2019-08-01  Kocsen Chung  <kocsen_ch...@apple.com>
+
         Cherry-pick r247784. rdar://problem/53820819
 
     Crash under WebKit:WTF::Detail::CallableWrapper<WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking(WTF::CompletionHandler<void ()>&&)::$_32::operator()()::'lambda'(), void>::call

Modified: branches/safari-608.1-branch/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (248107 => 248108)


--- branches/safari-608.1-branch/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-08-01 17:55:45 UTC (rev 248107)
+++ branches/safari-608.1-branch/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-08-01 17:55:50 UTC (rev 248108)
@@ -687,13 +687,12 @@
 
 void NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics>&& statistics)
 {
-    for (auto& networkSession : networkProcess().networkSessions().values()) {
-        if (networkSession->sessionID().isEphemeral())
-            continue;
+    auto* networkSession = networkProcess().networkSessionByConnection(connection());
+    if (!networkSession)
+        return;
 
-        if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics())
-            resourceLoadStatistics->resourceLoadStatisticsUpdated(WTFMove(statistics));
-    }
+    if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics())
+        resourceLoadStatistics->resourceLoadStatisticsUpdated(WTFMove(statistics));
 }
 
 void NetworkConnectionToWebProcess::hasStorageAccess(PAL::SessionID sessionID, const RegistrableDomain& subFrameDomain, const RegistrableDomain& topFrameDomain, uint64_t frameID, PageIdentifier pageID, CompletionHandler<void(bool)>&& completionHandler)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to