Changeset 206913 in webkit
- Timestamp:
- Oct 7, 2016 9:32:42 AM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r206909 r206913 1 2016-10-07 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Network Session: Allow NetworkDataTask decide what to do when override is allowed for a download 4 https://bugs.webkit.org/show_bug.cgi?id=163010 5 6 Reviewed by Alex Christensen. 7 8 Current code always deletes the file before starting a download when allow override is True. In soup backend we 9 use glib API that takes care of it and tries to ensure that the original file is not deleted if the new file 10 creation fails for whatever reason. 11 12 * NetworkProcess/Downloads/DownloadManager.cpp: 13 (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Pass allowOverride to setPendingDownloadLocation(). 14 * NetworkProcess/NetworkDataTask.h: 15 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: 16 (WebKit::NetworkDataTask::setPendingDownloadLocation): Delete the destination file if exists and allowOverride 17 is True. 18 1 19 2016-10-07 Tomas Popela <tpopela@redhat.com> 2 20 -
trunk/Source/WebKit2/NetworkProcess/Downloads/DownloadManager.cpp
r206583 r206913 129 129 return; 130 130 131 networkDataTask->setPendingDownloadLocation(destination, sandboxExtensionHandle); 132 133 if (allowOverwrite && fileExists(destination)) 134 deleteFile(destination); 135 131 networkDataTask->setPendingDownloadLocation(destination, sandboxExtensionHandle, allowOverwrite); 136 132 completionHandler(PolicyDownload); 137 133 -
trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.h
r206355 r206913 122 122 m_pendingDownload = &pendingDownload; 123 123 } 124 void setPendingDownloadLocation(const String& filename, const SandboxExtension::Handle& );124 void setPendingDownloadLocation(const String& filename, const SandboxExtension::Handle&, bool allowOverwrite); 125 125 const String& pendingDownloadLocation() { return m_pendingDownloadLocation; } 126 126 -
trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
r206355 r206913 37 37 #import <WebCore/AuthenticationChallenge.h> 38 38 #import <WebCore/CFNetworkSPI.h> 39 #import <WebCore/FileSystem.h> 39 40 #import <WebCore/NetworkStorageSession.h> 40 41 #import <WebCore/ResourceRequest.h> … … 269 270 } 270 271 271 void NetworkDataTask::setPendingDownloadLocation(const WTF::String& filename, const SandboxExtension::Handle& sandboxExtensionHandle )272 void NetworkDataTask::setPendingDownloadLocation(const WTF::String& filename, const SandboxExtension::Handle& sandboxExtensionHandle, bool allowOverwrite) 272 273 { 273 274 ASSERT(!m_sandboxExtension); … … 278 279 m_pendingDownloadLocation = filename; 279 280 m_task.get()._pathToDownloadTaskFile = filename; 281 282 if (allowOverwrite && WebCore::fileExists(filename)) 283 WebCore::deleteFile(filename); 280 284 } 281 285
Note: See TracChangeset
for help on using the changeset viewer.