Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (208399 => 208400)
--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2016-11-04 21:54:44 UTC (rev 208399)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2016-11-04 22:02:19 UTC (rev 208400)
@@ -158,7 +158,7 @@
// Abort the load now, as the WebProcess won't be able to respond to messages any more which might lead
// to leaked loader resources (connections, threads, etc).
loader->abort();
- ASSERT(!m_networkResourceLoaders.contains(identifier) || loader->isBecomingDownload());
+ ASSERT(!m_networkResourceLoaders.contains(identifier));
}
void NetworkConnectionToWebProcess::setDefersLoading(ResourceLoadIdentifier identifier, bool defers)
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (208399 => 208400)
--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2016-11-04 21:54:44 UTC (rev 208399)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2016-11-04 22:02:19 UTC (rev 208400)
@@ -286,19 +286,10 @@
{
ASSERT(m_didConvertToDownload);
ASSERT(m_networkLoad);
- cleanup();
+ m_networkLoad = nullptr;
}
#endif
-bool NetworkResourceLoader::isBecomingDownload() const
-{
-#if USE(NETWORK_SESSION)
- return m_networkLoad && m_didConvertToDownload;
-#else
- return false;
-#endif
-}
-
void NetworkResourceLoader::abort()
{
ASSERT(RunLoop::isMain());
@@ -317,9 +308,6 @@
m_networkLoad->cancel();
}
- if (isBecomingDownload())
- return;
-
cleanup();
}
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp (208399 => 208400)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp 2016-11-04 21:54:44 UTC (rev 208399)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp 2016-11-04 22:02:19 UTC (rev 208400)
@@ -515,8 +515,6 @@
{
test->m_download = download;
test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(download));
- g_signal_connect(download, "decide-destination", G_CALLBACK(downloadDecideDestinationCallback), test);
- g_signal_connect(download, "finished", G_CALLBACK(downloadFinishedCallback), test);
test->quitMainLoop();
}
@@ -541,8 +539,6 @@
{
GUniquePtr<char> destination(g_build_filename(Test::dataDirectory(), suggestedFilename, nullptr));
GUniquePtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
- if (test->m_shouldDelayDecideDestination)
- g_usleep(0.2 * G_USEC_PER_SEC);
webkit_download_set_destination(download, destinationURI.get());
return TRUE;
}
@@ -554,11 +550,12 @@
void waitUntilDownloadFinished()
{
+ g_signal_connect(m_download.get(), "decide-destination", G_CALLBACK(downloadDecideDestinationCallback), this);
+ g_signal_connect(m_download.get(), "finished", G_CALLBACK(downloadFinishedCallback), this);
g_main_loop_run(m_mainLoop);
}
GRefPtr<WebKitDownload> m_download;
- bool m_shouldDelayDecideDestination { false };
};
static void testWebViewDownloadURI(WebViewDownloadTest* test, gconstpointer)
@@ -607,10 +604,8 @@
static void testPolicyResponseDownload(PolicyResponseDownloadTest* test, gconstpointer)
{
+ // Test that a download started by the the policy checker contains the web view.
CString requestURI = kServer->getURIForPath("/test.pdf").data();
- // Delay the DecideDestination to ensure that the load is aborted before the network task has became a download.
- // See https://bugs.webkit.org/show_bug.cgi?id=164220.
- test->m_shouldDelayDecideDestination = true;
test->loadURI(requestURI.data());
test->waitUntilDownloadStarted();
@@ -619,25 +614,6 @@
ASSERT_CMP_CSTRING(webkit_uri_request_get_uri(request), ==, requestURI);
g_assert(test->m_webView == webkit_download_get_web_view(test->m_download.get()));
- test->waitUntilDownloadFinished();
-
- GRefPtr<GFile> downloadFile = adoptGRef(g_file_new_for_uri(webkit_download_get_destination(test->m_download.get())));
- GRefPtr<GFileInfo> downloadFileInfo = adoptGRef(g_file_query_info(downloadFile.get(), G_FILE_ATTRIBUTE_STANDARD_SIZE, static_cast<GFileQueryInfoFlags>(0), nullptr, nullptr));
- g_assert_cmpint(g_file_info_get_size(downloadFileInfo.get()), >, 0);
- g_file_delete(downloadFile.get(), nullptr, nullptr);
-}
-
-static void testPolicyResponseDownloadCancel(PolicyResponseDownloadTest* test, gconstpointer)
-{
- CString requestURI = kServer->getURIForPath("/test.pdf").data();
- test->loadURI(requestURI.data());
- test->waitUntilDownloadStarted();
-
- WebKitURIRequest* request = webkit_download_get_request(test->m_download.get());
- g_assert(request);
- ASSERT_CMP_CSTRING(webkit_uri_request_get_uri(request), ==, requestURI);
-
- g_assert(test->m_webView == webkit_download_get_web_view(test->m_download.get()));
test->cancelDownloadAndWaitUntilFinished();
}
@@ -681,7 +657,6 @@
DownloadErrorTest::add("Downloads", "remote-file-error", testDownloadRemoteFileError);
WebViewDownloadTest::add("WebKitWebView", "download-uri", testWebViewDownloadURI);
PolicyResponseDownloadTest::add("Downloads", "policy-decision-download", testPolicyResponseDownload);
- PolicyResponseDownloadTest::add("Downloads", "policy-decision-download-cancel", testPolicyResponseDownloadCancel);
DownloadTest::add("Downloads", "mime-type", testDownloadMIMEType);
}