WebKit Bugzilla
Attachment 346922 Details for
Bug 188479
: Crash under NetworkResourceLoader::convertToDownload()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188479-20180810140747.patch (text/plain), 5.77 KB, created by
Chris Dumez
on 2018-08-10 14:07:47 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-08-10 14:07:47 PDT
Size:
5.77 KB
patch
obsolete
>Subversion Revision: 234753 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index f0fa5642db3a9c9a76cdeefe288d7c96bd119d78..c159a8ab11565c3584f6e4b7069d2a16e928d95e 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2018-08-10 Chris Dumez <cdumez@apple.com> >+ >+ Crash under NetworkResourceLoader::convertToDownload() >+ https://bugs.webkit.org/show_bug.cgi?id=188479 >+ <rdar://problem/42201724> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In NetworkResourceLoader::convertToDownload(), if m_networkLoad is null then we're trying >+ to convert a load that came from the disk cache. Since we do not currently support converting >+ such a load, cancel the current load and start a fresh download. >+ >+ * NetworkProcess/NetworkResourceLoader.cpp: >+ (WebKit::NetworkResourceLoader::convertToDownload): >+ > 2018-08-09 Ben Richards <benton_richards@apple.com> > > We should cache the compiled sandbox profile in a data vault >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >index 77f898903e2d24d14df44b0f0c3cd87e6f3756e4..d97d0394c8480eea535e1c8e55480eafbe3b071f 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >@@ -337,7 +337,13 @@ void NetworkResourceLoader::cleanup(LoadResult result) > > void NetworkResourceLoader::convertToDownload(DownloadID downloadID, const ResourceRequest& request, const ResourceResponse& response) > { >- ASSERT(m_networkLoad); >+ // This can happen if the resource came from the disk cache. >+ if (!m_networkLoad) { >+ NetworkProcess::singleton().downloadManager().startDownload(m_connection.ptr(), m_parameters.sessionID, downloadID, request); >+ abort(); >+ return; >+ } >+ > NetworkProcess::singleton().downloadManager().convertNetworkLoadToDownload(downloadID, std::exchange(m_networkLoad, nullptr), WTFMove(m_fileReferences), request, response); > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1a0f0e2584a0b7cfba52b10c48701b10706ca0e6..113f5e07a32bb135c149fba735bac6e01e5da9f3 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,19 @@ >+2018-08-10 Chris Dumez <cdumez@apple.com> >+ >+ Crash under NetworkResourceLoader::convertToDownload() >+ https://bugs.webkit.org/show_bug.cgi?id=188479 >+ <rdar://problem/42201724> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add layout test coverage which reproduces the crash by: >+ 1. Loading a cacheable plugin while plugins are enabled so that the plugin goes into the disk cache >+ 2. Load the plugin again with plugins disabled so that we try to convert the load to a download >+ >+ * http/tests/download/convert-cached-load-to-download-expected.txt: Added. >+ * http/tests/download/convert-cached-load-to-download.html: Added. >+ * http/tests/plugins/resources/mock-plugin-cacheable.pl: Added. >+ > 2018-08-10 Ross Kirsling <ross.kirsling@sony.com> > > [WinCairo] Unreviewed layout test gardening. >diff --git a/LayoutTests/http/tests/download/convert-cached-load-to-download-expected.txt b/LayoutTests/http/tests/download/convert-cached-load-to-download-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..5eb39e42b7c91d6d4a27f8c93cdf6df2aec9d067 >--- /dev/null >+++ b/LayoutTests/http/tests/download/convert-cached-load-to-download-expected.txt >@@ -0,0 +1,6 @@ >+Download started. >+Downloading URL with suggested filename "mock-plugin-cacheable.pl" >+Download completed. >+The download should succeed. >+ >+Download plugin >diff --git a/LayoutTests/http/tests/download/convert-cached-load-to-download.html b/LayoutTests/http/tests/download/convert-cached-load-to-download.html >new file mode 100644 >index 0000000000000000000000000000000000000000..bf9deaceb98567379f7ada07ccced1d6f4ce64da >--- /dev/null >+++ b/LayoutTests/http/tests/download/convert-cached-load-to-download.html >@@ -0,0 +1,54 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script> >+if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.setShouldLogDownloadCallbacks(true); >+ testRunner.waitUntilDownloadFinished(); >+ testRunner.setShouldDownloadUndisplayableMIMETypes(true); >+} >+</script> >+</head> >+<body> >+<p>The download should succeed.</p> >+<a id="testLink">Download plugin</a> >+<script> >+const testURL = "/plugins/resources/mock-plugin-cacheable.pl"; >+ >+function click(elmt) >+{ >+ if (!window.eventSender) { >+ alert('Click the link to run the test.'); >+ return; >+ } >+ eventSender.mouseMoveTo(elmt.offsetLeft + 5, elmt.offsetTop + 5); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+} >+ >+function cacheTestResource(then) >+{ >+ let frame = document.createElement("iframe"); >+ frame.src = testURL; >+ frame.onload = then; >+ document.body.appendChild(frame); >+} >+ >+function runTest() >+{ >+ cacheTestResource(function() { >+ if (window.testRunner) >+ testRunner.setPluginsEnabled(false); >+ if (window.internals) >+ internals.clearMemoryCache(); >+ >+ let link = document.getElementById("testLink"); >+ testLink.href = testURL; >+ click(link); >+ }); >+} >+runTest(); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/plugins/resources/mock-plugin-cacheable.pl b/LayoutTests/http/tests/plugins/resources/mock-plugin-cacheable.pl >new file mode 100755 >index 0000000000000000000000000000000000000000..c6cb8c43f2a570fe7e621d55479e33ec1d34dbda >--- /dev/null >+++ b/LayoutTests/http/tests/plugins/resources/mock-plugin-cacheable.pl >@@ -0,0 +1,6 @@ >+#!/usr/bin/perl -wT >+use strict; >+ >+print "Cache-Control: max-age=3600\n"; >+print "Content-Type: application/x-webkit-test-netscape\n\n"; >+print "This is a mock plugin. It does pretty much nothing.";
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 188479
:
346922
|
346930
|
346934