Changeset 100569 in webkit


Ignore:
Timestamp:
Nov 16, 2011, 11:59:04 PM (14 years ago)
Author:
Carlos Garcia Campos
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.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r100549 r100569  
     12011-11-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Use a URI instead of local path to create download destination in WebKit2
     4        https://bugs.webkit.org/show_bug.cgi?id=72500
     5
     6        Reviewed by Philippe Normand.
     7
     8        * WebProcess/Downloads/soup/DownloadSoup.cpp:
     9        (WebKit::DownloadClient::didReceiveResponse): Use
     10        g_file_new_for_uri() instad of g_file_new_for_path(). Also use
     11        adoptGRef to fix a memory leak.
     12
    1132011-11-16  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    214
  • trunk/Source/WebKit2/WebProcess/Downloads/soup/DownloadSoup.cpp

    r100284 r100569  
    6565
    6666        bool overwrite;
    67         String filename = m_download->decideDestinationWithSuggestedFilename(suggestedFilename.utf8().data(), overwrite);
    68         if (filename.isEmpty()) {
    69             downloadFailed(downloadDestinationError(response, _("Cannot determine destination filename")));
     67        String destinationURI = m_download->decideDestinationWithSuggestedFilename(suggestedFilename.utf8().data(), overwrite);
     68        if (destinationURI.isEmpty()) {
     69            GOwnPtr<char> errorMessage(g_strdup_printf(_("Cannot determine destination URI for download with suggested filename %s"),
     70                                                       suggestedFilename.utf8().data()));
     71            downloadFailed(downloadDestinationError(response, errorMessage.get());
    7072            return;
    7173        }
    7274
    73         GRefPtr<GFile> file(g_file_new_for_path(filename.utf8().data()));
     75        GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(destinationURI.utf8().data()));
    7476        GOwnPtr<GError> error;
    7577        m_outputStream = adoptGRef(g_file_replace(file.get(), 0, TRUE, G_FILE_CREATE_NONE, 0, &error.outPtr()));
Note: See TracChangeset for help on using the changeset viewer.