Skip to content

Commit

Permalink
browser(webkit): speculative downloads-related crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman committed Jun 11, 2020
1 parent 6f04843 commit bd56f9d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion browser_patches/webkit/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1275
1276
10 changes: 8 additions & 2 deletions browser_patches/webkit/patches/bootstrap.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/downloadsPath.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('browserType.launch({downloadsPath})', function() {
await removeFolderAsync(state.downloadsPath);
});

it('should keep downloadsPath folder', async({browser, downloadsPath, server}) => {
fit('should keep downloadsPath folder', async({browser, downloadsPath, server}) => {
const page = await browser.newPage();
await page.setContent(`<a href="${server.PREFIX}/download">download</a>`);
const [ download ] = await Promise.all([
Expand Down

0 comments on commit bd56f9d

Please sign in to comment.