Title: [249805] trunk/Source/WebKit
Revision
249805
Author
pecor...@apple.com
Date
2019-09-12 03:59:09 -0700 (Thu, 12 Sep 2019)

Log Message

Web Inspector: Crashes when intercept response continues with original content
https://bugs.webkit.org/show_bug.cgi?id=201707
<rdar://problem/55261857>

Reviewed by David Kilzer.

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveData):
Copy the data for the callback since the deferral may run it much later.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (249804 => 249805)


--- trunk/Source/WebKit/ChangeLog	2019-09-12 10:53:59 UTC (rev 249804)
+++ trunk/Source/WebKit/ChangeLog	2019-09-12 10:59:09 UTC (rev 249805)
@@ -1,3 +1,15 @@
+2019-09-12  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Crashes when intercept response continues with original content
+        https://bugs.webkit.org/show_bug.cgi?id=201707
+        <rdar://problem/55261857>
+
+        Reviewed by David Kilzer.
+
+        * WebProcess/Network/WebResourceLoader.cpp:
+        (WebKit::WebResourceLoader::didReceiveData):
+        Copy the data for the callback since the deferral may run it much later.
+
 2019-09-12  Youenn Fablet  <you...@apple.com>
 
         Use typed identifiers for IDB connection identifiers

Modified: trunk/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp (249804 => 249805)


--- trunk/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp	2019-09-12 10:53:59 UTC (rev 249804)
+++ trunk/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp	2019-09-12 10:59:09 UTC (rev 249805)
@@ -184,7 +184,9 @@
     ASSERT_WITH_MESSAGE(!m_isProcessingNetworkResponse, "Network process should not send data until we've validated the response");
 
     if (UNLIKELY(m_interceptController.isIntercepting(m_coreLoader->identifier()))) {
-        m_interceptController.defer(m_coreLoader->identifier(), [this, protectedThis = makeRef(*this), data, encodedDataLength]() mutable {
+        auto buffer = WebCore::SharedBuffer::create(data.data(), data.size());
+        m_interceptController.defer(m_coreLoader->identifier(), [this, protectedThis = makeRef(*this), buffer = WTFMove(buffer), encodedDataLength]() mutable {
+            IPC::DataReference data(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size());
             if (m_coreLoader)
                 didReceiveData(data, encodedDataLength);
         });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to