Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

browser(webkit): speculative downloads-related crash fix (#2535)

Pavel Feldmande893c652e76
diff --git a/browser_patches/webkit/BUILD_NUMBER b/browser_patches/webkit/BUILD_NUMBER
index 9c113c6f75..4b809f8d5b 100644
--- a/browser_patches/webkit/BUILD_NUMBER
+++ b/browser_patches/webkit/BUILD_NUMBER
@@ -1 +1 @@
-1275
+1276
diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff
index e3e6a7ac86..def1177a86 100644
--- a/browser_patches/webkit/patches/bootstrap.diff
+++ b/browser_patches/webkit/patches/bootstrap.diff
@@ -8675,7 +8675,7 @@ index d7695088e7cfc4f638f157338754f9f157489749..d7ed4f58f033ebfc13142f2d6e8814d6
bool m_isBackingStoreDiscardable { true };
std::unique_ptr<BackingStore> m_backingStore;
diff --git a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp
-index c5de4e7d0f59194f43a023b089e372c58cf8ee06..5eeb2e9ec737efbb27d0f4e4c160eca6e6dbc0a8 100644
+index c5de4e7d0f59194f43a023b089e372c58cf8ee06..c0f38eccf578c14d13cb3b42788f988b9917e7ac 100644
--- a/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp
+++ b/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp
@@ -42,8 +42,10 @@
@@ -8741,7 +8741,13 @@ index c5de4e7d0f59194f43a023b089e372c58cf8ee06..5eeb2e9ec737efbb27d0f4e4c160eca6
// This can cause the DownloadProxy object to be deleted.
m_downloadProxyMap.downloadFinished(*this);
-@@ -237,6 +260,8 @@ void DownloadProxy::didCancel(const IPC::DataReference& resumeData)
+@@ -234,9 +257,14 @@ void DownloadProxy::didFail(const ResourceError& error, const IPC::DataReference
+
+ void DownloadProxy::didCancel(const IPC::DataReference& resumeData)
+ {
++ if (!m_processPool)
++ return;
++
m_resumeData = createData(resumeData);
m_processPool->downloadClient().didCancel(*this);