WebKit Bugzilla
Attachment 372009 Details for
Bug 198814
: WebResourceLoadStatisticsStore should not use its network session if invalidated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198814-20190612174047.patch (text/plain), 4.29 KB, created by
youenn fablet
on 2019-06-12 17:40:47 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-06-12 17:40:47 PDT
Size:
4.29 KB
patch
obsolete
>Subversion Revision: 246347 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index e5cfe169a2a9f109b253018825df1c3f3ce75fae..b88f7f980d58044ba783c35f5903b38d5bc5e381 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,19 @@ >+2019-06-12 Youenn Fablet <youenn@apple.com> >+ >+ WebResourceLoadStatisticsStore should not use its network session if invalidated >+ https://bugs.webkit.org/show_bug.cgi?id=198814 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Tell WebResourceLoadStatisticsStore that its network session is invalidated. >+ WebResourceLoadStatisticsStore will then clear its reference to the network session. >+ >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: >+ (WebKit::WebResourceLoadStatisticsStore::invalidateAndCancel): >+ * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: >+ * NetworkProcess/NetworkSession.cpp: >+ (WebKit::NetworkSession::invalidateAndCancel): >+ > 2019-06-12 Youenn Fablet <youenn@apple.com> > > Use NSURLSession for WebSocket >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >index 914d35bde8a003dae0d61b06491a08b720c0bdaa..b668df23075ba1728b7f4b6b53b21ab9bf78b3fc 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp >@@ -1021,6 +1021,11 @@ NetworkSession* WebResourceLoadStatisticsStore::networkSession() > return m_networkSession.get(); > } > >+void WebResourceLoadStatisticsStore::invalidateAndCancel() >+{ >+ m_networkSession = nullptr; >+} >+ > void WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains(OptionSet<WebsiteDataType> dataTypes, HashMap<RegistrableDomain, WebsiteDataToRemove>&& domainsToRemoveWebsiteDataFor, bool shouldNotifyPage, CompletionHandler<void(const HashSet<RegistrableDomain>&)>&& completionHandler) > { > ASSERT(RunLoop::isMain()); >diff --git a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >index a8c23e09b3f727848c11a77a7ee5f1925573f5b3..f19a73d6fbc2ea258bc998ead5d2275c2fca09a1 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >+++ b/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h >@@ -176,6 +176,7 @@ public: > void notifyResourceLoadStatisticsProcessed(); > > NetworkSession* networkSession(); >+ void invalidateAndCancel(); > > void sendDiagnosticMessageWithValue(const String& message, const String& description, unsigned value, unsigned sigDigits, WebCore::ShouldSample) const; > void notifyPageStatisticsTelemetryFinished(unsigned totalPrevalentResources, unsigned totalPrevalentResourcesWithUserInteraction, unsigned top3SubframeUnderTopFrameOrigins) const; >diff --git a/Source/WebKit/NetworkProcess/NetworkSession.cpp b/Source/WebKit/NetworkProcess/NetworkSession.cpp >index 3544fa4cc5f83e9744f4dff36415e2caa42a459e..8d4626edecaf4f9f2596e467c6342e2801659883 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSession.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkSession.cpp >@@ -100,11 +100,19 @@ void NetworkSession::invalidateAndCancel() > { > for (auto* task : m_dataTaskSet) > task->invalidateAndCancel(); >+#if ENABLE(RESOURCE_LOAD_STATISTICS) >+ if (m_resourceLoadStatistics) >+ m_resourceLoadStatistics->invalidateAndCancel(); >+#endif >+#if !ASSERT_DISABLED >+ m_isInvalidated = true; >+#endif > } > > #if ENABLE(RESOURCE_LOAD_STATISTICS) > void NetworkSession::setResourceLoadStatisticsEnabled(bool enable) > { >+ ASSERT(!m_isInvalidated); > if (!enable) { > m_resourceLoadStatistics = nullptr; > return; >diff --git a/Source/WebKit/NetworkProcess/NetworkSession.h b/Source/WebKit/NetworkProcess/NetworkSession.h >index f9d22ab0aeb8a7b8f1ff7a86c266f1d3d9ba74e9..d97775fe6b319bb48b302e7218118739bc9bffa8 100644 >--- a/Source/WebKit/NetworkProcess/NetworkSession.h >+++ b/Source/WebKit/NetworkProcess/NetworkSession.h >@@ -127,6 +127,9 @@ protected: > PrefetchCache m_prefetchCache; > > Ref<StorageManager> m_storageManager; >+#if !ASSERT_DISABLED >+ bool m_isInvalidated { false }; >+#endif > }; > > } // namespace WebKit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198814
:
372002
|
372009
|
372135