Resource Load Statistics: Merge of dataRecordsRemoved should use std::max()
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Aug 2017 00:03:55 +0000 (00:03 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Aug 2017 00:03:55 +0000 (00:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175348
<rdar://problem/33785695>

Reviewed by Chris Dumez.

No new tests. Online change of a statistic that doesn't affect logic flow.

* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::merge):
    Now uses std::max() instead of addition.

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

Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadStatistics.cpp

index d483fe9..08028af 100644 (file)
@@ -1,3 +1,17 @@
+2017-08-08  John Wilander  <wilander@apple.com>
+
+        Resource Load Statistics: Merge of dataRecordsRemoved should use std::max()
+        https://bugs.webkit.org/show_bug.cgi?id=175348
+        <rdar://problem/33785695>
+
+        Reviewed by Chris Dumez.
+
+        No new tests. Online change of a statistic that doesn't affect logic flow.
+
+        * loader/ResourceLoadStatistics.cpp:
+        (WebCore::ResourceLoadStatistics::merge):
+            Now uses std::max() instead of addition.
+
 2017-08-08  Brent Fulgham  <bfulgham@apple.com>
 
         Sandbox flags do not support document.domain control
index 5ff9eba..49b4d24 100644 (file)
@@ -226,7 +226,7 @@ void ResourceLoadStatistics::merge(const ResourceLoadStatistics& other)
     
     // Prevalent resource stats
     isPrevalentResource |= other.isPrevalentResource;
-    dataRecordsRemoved += other.dataRecordsRemoved;
+    dataRecordsRemoved = std::max(dataRecordsRemoved, other.dataRecordsRemoved);
     
     // In-memory only
     isMarkedForCookiePartitioning |= other.isMarkedForCookiePartitioning;