Title: [208174] trunk
Revision
208174
Author
ryanhad...@apple.com
Date
2016-10-31 14:31:16 -0700 (Mon, 31 Oct 2016)

Log Message

Unreviewed, rolling out r208154.

This change caused an assertion failure during API tests on
macOS.

Reverted changeset:

"NetworkSession: Network process crash when converting main
resource to download"
https://bugs.webkit.org/show_bug.cgi?id=164220
http://trac.webkit.org/changeset/208154

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (208173 => 208174)


--- trunk/Source/WebKit2/ChangeLog	2016-10-31 21:03:56 UTC (rev 208173)
+++ trunk/Source/WebKit2/ChangeLog	2016-10-31 21:31:16 UTC (rev 208174)
@@ -1,3 +1,17 @@
+2016-10-31  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r208154.
+
+        This change caused an assertion failure during API tests on
+        macOS.
+
+        Reverted changeset:
+
+        "NetworkSession: Network process crash when converting main
+        resource to download"
+        https://bugs.webkit.org/show_bug.cgi?id=164220
+        http://trac.webkit.org/changeset/208154
+
 2016-10-28  Brent Fulgham  <bfulg...@apple.com>
 
         Do a better job of protecting Frame objects in the context of _javascript_ calls

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (208173 => 208174)


--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp	2016-10-31 21:03:56 UTC (rev 208173)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp	2016-10-31 21:31:16 UTC (rev 208174)
@@ -284,7 +284,7 @@
 {
     ASSERT(m_didConvertToDownload);
     ASSERT(m_networkLoad);
-    cleanup();
+    m_networkLoad = nullptr;
 }
 #endif
 
@@ -306,11 +306,6 @@
         m_networkLoad->cancel();
     }
 
-#if USE(NETWORK_SESSION)
-    if (m_networkLoad && m_didConvertToDownload)
-        return;
-#endif
-
     cleanup();
 }
 

Modified: trunk/Tools/ChangeLog (208173 => 208174)


--- trunk/Tools/ChangeLog	2016-10-31 21:03:56 UTC (rev 208173)
+++ trunk/Tools/ChangeLog	2016-10-31 21:31:16 UTC (rev 208174)
@@ -1,3 +1,17 @@
+2016-10-31  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r208154.
+
+        This change caused an assertion failure during API tests on
+        macOS.
+
+        Reverted changeset:
+
+        "NetworkSession: Network process crash when converting main
+        resource to download"
+        https://bugs.webkit.org/show_bug.cgi?id=164220
+        http://trac.webkit.org/changeset/208154
+
 2016-10-31  Said Abou-Hallawa  <sabouhall...@apple.com>
 
         Unreviewed, change my status to be a WebKit reviewer

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp (208173 => 208174)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp	2016-10-31 21:03:56 UTC (rev 208173)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp	2016-10-31 21:31:16 UTC (rev 208174)
@@ -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);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to