Title: [100569] trunk/Source/WebKit2
Revision
100569
Author
[email protected]
Date
2011-11-16 23:59:04 -0800 (Wed, 16 Nov 2011)

Log Message

[GTK] Use a URI instead of local path to create download destination in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=72500

Reviewed by Philippe Normand.

* WebProcess/Downloads/soup/DownloadSoup.cpp:
(WebKit::DownloadClient::didReceiveResponse): Use
g_file_new_for_uri() instad of g_file_new_for_path(). Also use
adoptGRef to fix a memory leak.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (100568 => 100569)


--- trunk/Source/WebKit2/ChangeLog	2011-11-17 07:50:07 UTC (rev 100568)
+++ trunk/Source/WebKit2/ChangeLog	2011-11-17 07:59:04 UTC (rev 100569)
@@ -1,3 +1,15 @@
+2011-11-16  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Use a URI instead of local path to create download destination in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=72500
+
+        Reviewed by Philippe Normand.
+
+        * WebProcess/Downloads/soup/DownloadSoup.cpp:
+        (WebKit::DownloadClient::didReceiveResponse): Use
+        g_file_new_for_uri() instad of g_file_new_for_path(). Also use
+        adoptGRef to fix a memory leak.
+
 2011-11-16  Caio Marcelo de Oliveira Filho  <[email protected]>
 
         [Qt] Fix build after WTR AX support

Modified: trunk/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp (100568 => 100569)


--- trunk/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp	2011-11-17 07:50:07 UTC (rev 100568)
+++ trunk/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp	2011-11-17 07:59:04 UTC (rev 100569)
@@ -64,13 +64,15 @@
         }
 
         bool overwrite;
-        String filename = m_download->decideDestinationWithSuggestedFilename(suggestedFilename.utf8().data(), overwrite);
-        if (filename.isEmpty()) {
-            downloadFailed(downloadDestinationError(response, _("Cannot determine destination filename")));
+        String destinationURI = m_download->decideDestinationWithSuggestedFilename(suggestedFilename.utf8().data(), overwrite);
+        if (destinationURI.isEmpty()) {
+            GOwnPtr<char> errorMessage(g_strdup_printf(_("Cannot determine destination URI for download with suggested filename %s"),
+                                                       suggestedFilename.utf8().data()));
+            downloadFailed(downloadDestinationError(response, errorMessage.get());
             return;
         }
 
-        GRefPtr<GFile> file(g_file_new_for_path(filename.utf8().data()));
+        GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(destinationURI.utf8().data()));
         GOwnPtr<GError> error;
         m_outputStream = adoptGRef(g_file_replace(file.get(), 0, TRUE, G_FILE_CREATE_NONE, 0, &error.outPtr()));
         if (!m_outputStream) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to