Changeset 173154 in webkit
- Timestamp:
- Sep 1, 2014 1:35:52 AM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r173144 r173154 1 2014-09-01 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [SOUP] WebKitDownload cannot overwrite existing file 4 https://bugs.webkit.org/show_bug.cgi?id=136322 5 6 Reviewed by Carlos Garcia Campos. 7 8 * Shared/Downloads/soup/DownloadSoup.cpp: 9 (WebKit::DownloadClient::didReceiveResponse): pass a member variable 10 to Download::decideDestinationWithSuggestedFilename instead of a 11 temporary bool, so we can use the result in didFinishLoading. 12 (WebKit::DownloadClient::didFinishLoading): overwrite the destination 13 if Download::decideDestinationWithSuggestedFilename determined we 14 should do so. 15 1 16 2014-08-31 Tim Horton <timothy_horton@apple.com> 2 17 -
trunk/Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp
r169782 r173154 51 51 DownloadClient(Download* download) 52 52 : m_download(download) 53 , m_allowOverwrite(false) 53 54 { 54 55 } … … 89 90 } 90 91 91 bool overwrite; 92 m_destinationURI = m_download->decideDestinationWithSuggestedFilename(suggestedFilename, overwrite); 92 m_destinationURI = m_download->decideDestinationWithSuggestedFilename(suggestedFilename, m_allowOverwrite); 93 93 if (m_destinationURI.isEmpty()) { 94 94 #if PLATFORM(GTK) … … 138 138 GRefPtr<GFile> destinationFile = adoptGRef(g_file_new_for_uri(m_destinationURI.utf8().data())); 139 139 GUniqueOutPtr<GError> error; 140 if (!g_file_move(m_intermediateFile.get(), destinationFile.get(), G_FILE_COPY_NONE, nullptr, nullptr, nullptr, &error.outPtr())) {140 if (!g_file_move(m_intermediateFile.get(), destinationFile.get(), m_allowOverwrite ? G_FILE_COPY_OVERWRITE : G_FILE_COPY_NONE, nullptr, nullptr, nullptr, &error.outPtr())) { 141 141 downloadFailed(platformDownloadDestinationError(m_response, error->message)); 142 142 return; … … 198 198 ResourceResponse m_delayedResponse; 199 199 GMainLoopSource m_handleResponseLater; 200 bool m_allowOverwrite; 200 201 }; 201 202
Note: See TracChangeset
for help on using the changeset viewer.