Title: [245517] trunk
Revision
245517
Author
[email protected]
Date
2019-05-20 10:14:33 -0700 (Mon, 20 May 2019)

Log Message

[ Mac WK2 iOS Sim] Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196307
<rdar://problem/49345360>

Reviewed by Alex Christensen.

Source/WebKit:

Delay dumping statistics if there is data being removed.

* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::removeDataRecords):
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
(WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::dumpResourceLoadStatistics):
(WebKit::WebResourceLoadStatisticsStore::tryDumpResourceLoadStatistics):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:

LayoutTests:

* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (245516 => 245517)


--- trunk/LayoutTests/ChangeLog	2019-05-20 14:50:54 UTC (rev 245516)
+++ trunk/LayoutTests/ChangeLog	2019-05-20 17:14:33 UTC (rev 245517)
@@ -1,3 +1,14 @@
+2019-05-20  Sihui Liu  <[email protected]>
+
+        [ Mac WK2 iOS Sim] Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=196307
+        <rdar://problem/49345360>
+
+        Reviewed by Alex Christensen.
+
+        * platform/ios-simulator-wk2/TestExpectations:
+        * platform/mac-wk2/TestExpectations:
+
 2019-05-19  Brent Fulgham  <[email protected]>
 
         Wait to get frame until after layout has been run

Modified: trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations (245516 => 245517)


--- trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2019-05-20 14:50:54 UTC (rev 245516)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2019-05-20 17:14:33 UTC (rev 245517)
@@ -69,8 +69,6 @@
 
 webkit.org/b/162975 http/tests/cache/disk-cache/memory-cache-revalidation-updates-disk-cache.html [ Pass Failure ]
 
-webkit.org/b/196307 http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html [ Pass Failure ]
-
 webkit.org/b/196112 imported/w3c/web-platform-tests/mathml/relations/css-styling/mathvariant-bold.html [ Pass ImageOnlyFailure ]
 webkit.org/b/196112 imported/w3c/web-platform-tests/mathml/relations/css-styling/mathvariant-double-struck.html [ Pass ImageOnlyFailure ]
 webkit.org/b/196112 imported/w3c/web-platform-tests/mathml/relations/css-styling/mathvariant-italic.html [ Pass ImageOnlyFailure ]

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (245516 => 245517)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2019-05-20 14:50:54 UTC (rev 245516)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2019-05-20 17:14:33 UTC (rev 245517)
@@ -909,8 +909,6 @@
 
 webkit.org/b/194916 fast/mediastream/MediaStream-video-element.html [ Pass Failure ]
 
-webkit.org/b/196307 http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html [ Pass Failure ]
-
 webkit.org/b/196376 storage/domstorage/localstorage/private-browsing-affects-storage.html [ Pass Failure ]
 
 webkit.org/b/197917 [ Debug ] http/wpt/webauthn/public-key-credential-create-success-hid.https.html [ Skip ]

Modified: trunk/Source/WebKit/ChangeLog (245516 => 245517)


--- trunk/Source/WebKit/ChangeLog	2019-05-20 14:50:54 UTC (rev 245516)
+++ trunk/Source/WebKit/ChangeLog	2019-05-20 17:14:33 UTC (rev 245517)
@@ -1,3 +1,22 @@
+2019-05-20  Sihui Liu  <[email protected]>
+
+        [ Mac WK2 iOS Sim] Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=196307
+        <rdar://problem/49345360>
+
+        Reviewed by Alex Christensen.
+
+        Delay dumping statistics if there is data being removed.
+
+        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
+        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
+        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
+        (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved const):
+        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
+        (WebKit::WebResourceLoadStatisticsStore::dumpResourceLoadStatistics):
+        (WebKit::WebResourceLoadStatisticsStore::tryDumpResourceLoadStatistics):
+        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
+
 2019-05-20  Ludovico de Nittis  <[email protected]>
 
         [WPE][Qt] Use C++17 instead of C++14

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp (245516 => 245517)


--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp	2019-05-20 14:50:54 UTC (rev 245516)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp	2019-05-20 17:14:33 UTC (rev 245517)
@@ -221,6 +221,7 @@
                 }
                 weakThis->incrementRecordsDeletedCountForDomains(WTFMove(domainsWithDeletedWebsiteData));
                 weakThis->setDataRecordsBeingRemoved(false);
+                weakThis->m_store.tryDumpResourceLoadStatistics();
                 completionHandler();
 #if !RELEASE_LOG_DISABLED
                 RELEASE_LOG_INFO_IF(weakThis->m_debugLoggingEnabled, ResourceLoadStatisticsDebug, "Done removing data records.");

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h (245516 => 245517)


--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h	2019-05-20 14:50:54 UTC (rev 245516)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h	2019-05-20 17:14:33 UTC (rev 245517)
@@ -185,6 +185,8 @@
     virtual bool isMemoryStore() const { return false; }
     virtual bool isDatabaseStore()const { return false; }
 
+    bool dataRecordsBeingRemoved() const { return m_dataRecordsBeingRemoved; }
+
 protected:
     static unsigned computeImportance(const WebCore::ResourceLoadStatistics&);
     static Vector<OperatingDate> mergeOperatingDates(const Vector<OperatingDate>& existingDates, Vector<OperatingDate>&& newDates);

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp (245516 => 245517)


--- trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp	2019-05-20 14:50:54 UTC (rev 245516)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp	2019-05-20 17:14:33 UTC (rev 245517)
@@ -615,13 +615,27 @@
     ASSERT(RunLoop::isMain());
 
     postTask([this, completionHandler = WTFMove(completionHandler)]() mutable {
-        String result = m_statisticsStore ? m_statisticsStore->dumpResourceLoadStatistics() : emptyString();
-        postTaskReply([result = result.isolatedCopy(), completionHandler = WTFMove(completionHandler)]() mutable {
-            completionHandler(result);
-        });
+        ASSERT(!m_dumpResourceLoadStatisticsCompletionHandler);
+        m_dumpResourceLoadStatisticsCompletionHandler = WTFMove(completionHandler);
+        if (m_statisticsStore && m_statisticsStore->dataRecordsBeingRemoved())
+            return;
+        tryDumpResourceLoadStatistics();
     });
 }
 
+void WebResourceLoadStatisticsStore::tryDumpResourceLoadStatistics()
+{
+    ASSERT(!RunLoop::isMain());
+
+    if (!m_dumpResourceLoadStatisticsCompletionHandler)
+        return;
+
+    String result = m_statisticsStore ? m_statisticsStore->dumpResourceLoadStatistics() : emptyString();
+    postTaskReply([result = result.isolatedCopy(), completionHandler = WTFMove(m_dumpResourceLoadStatisticsCompletionHandler)]() mutable {
+        completionHandler(result);
+    });
+}
+
 void WebResourceLoadStatisticsStore::isPrevalentResource(const RegistrableDomain& domain, CompletionHandler<void(bool)>&& completionHandler)
 {
     ASSERT(RunLoop::isMain());

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h (245516 => 245517)


--- trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h	2019-05-20 14:50:54 UTC (rev 245516)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h	2019-05-20 17:14:33 UTC (rev 245517)
@@ -127,6 +127,7 @@
     void setPrevalentResource(const RegistrableDomain&, CompletionHandler<void()>&&);
     void setVeryPrevalentResource(const RegistrableDomain&, CompletionHandler<void()>&&);
     void dumpResourceLoadStatistics(CompletionHandler<void(String)>&&);
+    void tryDumpResourceLoadStatistics();
     void isPrevalentResource(const RegistrableDomain&, CompletionHandler<void(bool)>&&);
     void isVeryPrevalentResource(const RegistrableDomain&, CompletionHandler<void(bool)>&&);
     void isRegisteredAsSubresourceUnder(const SubResourceDomain&, const TopFrameDomain&, CompletionHandler<void(bool)>&&);
@@ -205,6 +206,8 @@
     bool m_hasScheduledProcessStats { false };
 
     bool m_firstNetworkProcessCreated { false };
+    
+    CompletionHandler<void(String)> m_dumpResourceLoadStatisticsCompletionHandler;
 };
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to