Changeset 87704 in webkit
- Timestamp:
- May 30, 2011 6:44:55 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87703 r87704 1 2011-05-30 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Alexey Proskuryakov. 4 5 Audio and video files saved to the Application Cache should preserve the original file extension 6 https://bugs.webkit.org/show_bug.cgi?id=61750 7 <rdar://9524922> 8 9 No new tests, it isn't possible to check the name of the file in the cache from within 10 DRT. Changes verified manually. 11 12 * loader/appcache/ApplicationCacheStorage.cpp: 13 (WebCore::ApplicationCacheStorage::store): Append the original file extension to the cache 14 file name. 15 (WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory): Add extension parameter. 16 * loader/appcache/ApplicationCacheStorage.h: 17 1 18 2011-05-30 Jer Noble <jer.noble@apple.com> 2 19 -
trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
r86397 r87704 804 804 String flatFileDirectory = pathByAppendingComponent(m_cacheDirectory, flatFileSubdirectory); 805 805 makeAllDirectories(flatFileDirectory); 806 807 String extension; 808 809 String fileName = resource->response().suggestedFilename(); 810 size_t dotIndex = fileName.reverseFind('.'); 811 if (dotIndex != notFound && dotIndex < (fileName.length() - 1)) 812 extension = fileName.substring(dotIndex); 813 806 814 String path; 807 if (!writeDataToUniqueFileInDirectory(resource->data(), flatFileDirectory, path ))815 if (!writeDataToUniqueFileInDirectory(resource->data(), flatFileDirectory, path, extension)) 808 816 return false; 809 817 … … 1232 1240 } 1233 1241 1234 bool ApplicationCacheStorage::writeDataToUniqueFileInDirectory(SharedBuffer* data, const String& directory, String& path )1242 bool ApplicationCacheStorage::writeDataToUniqueFileInDirectory(SharedBuffer* data, const String& directory, String& path, const String& fileExtension) 1235 1243 { 1236 1244 String fullPath; 1237 1245 1238 1246 do { 1239 path = encodeForFileName(createCanonicalUUIDString()) ;1247 path = encodeForFileName(createCanonicalUUIDString()) + fileExtension; 1240 1248 // Guard against the above function being called on a platform which does not implement 1241 1249 // createCanonicalUUIDString(). -
trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.h
r82000 r87704 116 116 bool shouldStoreResourceAsFlatFile(ApplicationCacheResource*); 117 117 void deleteTables(); 118 bool writeDataToUniqueFileInDirectory(SharedBuffer*, const String& directory, String& outFilename );118 bool writeDataToUniqueFileInDirectory(SharedBuffer*, const String& directory, String& outFilename, const String& fileExtension); 119 119 120 120 void loadManifestHostHashes();
Note: See TracChangeset
for help on using the changeset viewer.