Title: [248056] branches/safari-608-branch/Source/WebKit
Revision
248056
Author
[email protected]
Date
2019-07-31 13:56:11 -0700 (Wed, 31 Jul 2019)

Log Message

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

    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-branch/Source/WebKit/ChangeLog (248055 => 248056)


--- branches/safari-608-branch/Source/WebKit/ChangeLog	2019-07-31 20:56:08 UTC (rev 248055)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog	2019-07-31 20:56:11 UTC (rev 248056)
@@ -1,5 +1,38 @@
 2019-07-31  Alan Coon  <[email protected]>
 
+        Cherry-pick r247905. rdar://problem/53764224
+
+    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  <[email protected]>
+
+            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-07-31  Alan Coon  <[email protected]>
+
         Apply patch. rdar://problem/53764240
 
     2019-07-31  Ryosuke Niwa  <[email protected]>

Modified: branches/safari-608-branch/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (248055 => 248056)


--- branches/safari-608-branch/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-07-31 20:56:08 UTC (rev 248055)
+++ branches/safari-608-branch/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-07-31 20:56:11 UTC (rev 248056)
@@ -696,13 +696,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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to