Ensure Document::responseReceived and clearResource are called on the main thread
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Mar 2018 00:39:45 +0000 (00:39 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Mar 2018 00:39:45 +0000 (00:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183709

Reviewed by Chris Dumez.

No change of behavior.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::clearMainResource):

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

Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentLoader.cpp

index 85a9511..c69ada6 100644 (file)
@@ -1,3 +1,16 @@
+2018-03-16  Youenn Fablet  <youenn@apple.com>
+
+        Ensure Document::responseReceived and clearResource are called on the main thread
+        https://bugs.webkit.org/show_bug.cgi?id=183709
+
+        Reviewed by Chris Dumez.
+
+        No change of behavior.
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::responseReceived):
+        (WebCore::DocumentLoader::clearMainResource):
+
 2018-03-16  Chris Dumez  <cdumez@apple.com>
 
         WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
index 327c581..466030d 100644 (file)
@@ -368,6 +368,7 @@ bool DocumentLoader::isLoading() const
 
 void DocumentLoader::notifyFinished(CachedResource& resource)
 {
+    ASSERT(isMainThread());
 #if ENABLE(CONTENT_FILTERING)
     if (m_contentFilter && !m_contentFilter->continueAfterNotifyFinished(resource))
         return;
@@ -1808,6 +1809,7 @@ void DocumentLoader::willContinueMainResourceLoadAfterRedirect(const ResourceReq
 
 void DocumentLoader::clearMainResource()
 {
+    ASSERT(isMainThread());
     if (m_mainResource && m_mainResource->hasClient(*this))
         m_mainResource->removeClient(*this);
 #if ENABLE(CONTENT_FILTERING)