Title: [235495] trunk/Source/WebKit
Revision
235495
Author
[email protected]
Date
2018-08-29 20:39:59 -0700 (Wed, 29 Aug 2018)

Log Message

Avoid code duplication in ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords()
https://bugs.webkit.org/show_bug.cgi?id=189130

Reviewed by Youenn Fablet.

Move if check inside the lambda instead of outside to avoid code duplication.

* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (235494 => 235495)


--- trunk/Source/WebKit/ChangeLog	2018-08-30 02:26:02 UTC (rev 235494)
+++ trunk/Source/WebKit/ChangeLog	2018-08-30 03:39:59 UTC (rev 235495)
@@ -1,3 +1,15 @@
+2018-08-29  Chris Dumez  <[email protected]>
+
+        Avoid code duplication in ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords()
+        https://bugs.webkit.org/show_bug.cgi?id=189130
+
+        Reviewed by Youenn Fablet.
+
+        Move if check inside the lambda instead of outside to avoid code duplication.
+
+        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
+        (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
+
 2018-08-29  Alex Christensen  <[email protected]>
 
         Revert some of r235398

Modified: trunk/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp (235494 => 235495)


--- trunk/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp	2018-08-30 02:26:02 UTC (rev 235494)
+++ trunk/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp	2018-08-30 03:39:59 UTC (rev 235495)
@@ -345,31 +345,22 @@
         }
     }
 
-    if (m_parameters.shouldNotifyPagesWhenDataRecordsWereScanned) {
-        removeDataRecords([this, weakThis = makeWeakPtr(*this)] {
-            ASSERT(!RunLoop::isMain());
-            if (!weakThis)
-                return;
+    removeDataRecords([this, weakThis = makeWeakPtr(*this)] {
+        ASSERT(!RunLoop::isMain());
+        if (!weakThis)
+            return;
 
-            pruneStatisticsIfNeeded();
-            if (m_persistentStorage)
-                m_persistentStorage->scheduleOrWriteMemoryStore(ResourceLoadStatisticsPersistentStorage::ForceImmediateWrite::No);
+        pruneStatisticsIfNeeded();
+        if (m_persistentStorage)
+            m_persistentStorage->scheduleOrWriteMemoryStore(ResourceLoadStatisticsPersistentStorage::ForceImmediateWrite::No);
 
-            RunLoop::main().dispatch([] {
-                WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed();
-            });
-        });
-    } else {
-        removeDataRecords([this, weakThis = makeWeakPtr(*this)] {
-            ASSERT(!RunLoop::isMain());
-            if (!weakThis)
-                return;
+        if (!m_parameters.shouldNotifyPagesWhenDataRecordsWereScanned)
+            return;
 
-            pruneStatisticsIfNeeded();
-            if (m_persistentStorage)
-                m_persistentStorage->scheduleOrWriteMemoryStore(ResourceLoadStatisticsPersistentStorage::ForceImmediateWrite::No);
+        RunLoop::main().dispatch([] {
+            WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed();
         });
-    }
+    });
 }
 
 void ResourceLoadStatisticsMemoryStore::hasStorageAccess(const String& subFramePrimaryDomain, const String& topFramePrimaryDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&& completionHandler)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to