Changeset 25577 in webkit
- Timestamp:
- Sep 14, 2007, 5:10:45 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r25576 r25577 1 2007-09-14 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Sam and Geoff. 4 5 <rdar://problem/5333272> Cannot upload files when path contains 6 non-ascii/multibyte characters 7 8 We can't use _stat to determine file size on Windows as it may not 9 correctly handle multibyte characters, so we have to use _wstat. 10 11 In deference to the fact that we may one day use the FormDataStreamCFNet.cpp 12 on Mac i've wrapped the call to _wstat with a generic fileSize 13 method in FileSystem.h 14 15 * WebCore.vcproj/WebCore.vcproj: 16 * platform/FileSystem.h: 17 * platform/network/cf/FormDataStreamCFNet.cpp: 18 * platform/win/FileSystemWin.cpp: Added. 19 (WebCore::setHTTPBody): 20 * platform/gdk/TemporaryLinkStubs.cpp: 21 * platform/mac/FileSystemMac.mm: 22 (WebCore::fileSize): 23 * platform/qt/TemporaryLinkStubs.cpp: 24 1 25 2007-09-14 Timothy Hatcher <timothy@apple.com> 2 26 -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r25568 r25577 3028 3028 </File> 3029 3029 <File 3030 RelativePath="..\platform\FileSystem.h" 3031 > 3032 </File> 3033 <File 3030 3034 RelativePath="..\platform\FloatConversion.h" 3031 3035 > … … 3480 3484 <File 3481 3485 RelativePath="..\platform\win\FileChooserWin.cpp" 3486 > 3487 </File> 3488 <File 3489 RelativePath="..\platform\win\FileSystemWin.cpp" 3482 3490 > 3483 3491 </File> -
trunk/WebCore/platform/FileSystem.h
r25081 r25577 36 36 bool fileExists(const String&); 37 37 bool deleteFile(const String&); 38 bool fileSize(const String&, long long& result); 38 39 39 40 } // namespace WebCore -
trunk/WebCore/platform/gdk/TemporaryLinkStubs.cpp
r25572 r25577 183 183 bool fileExists(const String& path) { notImplemented(); return false; } 184 184 bool deleteFile(const String& path) { notImplemented(); return false; } 185 bool fileSize(const String& path, long long& result) { notImplemented(); return false; } 185 186 void callOnMainThread(void (*)()) { notImplemented(); } 186 187 } -
trunk/WebCore/platform/mac/FileSystemMac.mm
r25081 r25577 29 29 #import "FileSystem.h" 30 30 31 #import "NotImplemented.h" 31 32 #import "PlatformString.h" 32 33 … … 57 58 } 58 59 60 bool fileSize(const String& path, long long& result) 61 { 62 notImplemented(); 63 return false; 64 } 65 59 66 } //namespace WebCore -
trunk/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
r23906 r25577 33 33 34 34 #include "CString.h" 35 #include "FileSystem.h" 35 36 #include "FormData.h" 36 37 #include <CFNetwork/CFURLRequestPriv.h> 37 38 #include <CoreFoundation/CFStreamAbstract.h> 38 #include <sys/stat.h>39 39 #include <sys/types.h> 40 40 #include <wtf/Assertions.h> … … 341 341 length += element.m_data.size(); 342 342 else { 343 struct _stat64i32 sb; 344 int statResult = _stat(element.m_filename.utf8().data(), &sb); 345 if (statResult == 0 && (sb.st_mode & S_IFMT) == S_IFREG) 346 length += sb.st_size; 343 long long size; 344 if (fileSize(element.m_filename, size)) 345 length += size; 347 346 else 348 347 haveLength = false; -
trunk/WebCore/platform/qt/TemporaryLinkStubs.cpp
r25572 r25577 84 84 85 85 float userIdleTime() { notImplemented(); return 0.0; } 86 bool fileSize(const String& path, long long& result) { notImplemented(); return false; } 86 87 87 88 } -
trunk/WebCore/platform/win/FileSystemWin.cpp
r25576 r25577 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 #ifndef FileSystem_h 30 #define FileSystem_h 28 29 #include "config.h" 30 31 #include "FileSystem.h" 32 #include "PlatformString.h" 33 34 #include <sys/stat.h> 31 35 32 36 namespace WebCore { 33 37 34 class String; 38 bool fileSize(const String& inFilename, long long& result) 39 { 40 struct _stat64i32 sb; 41 String filename = inFilename; 42 int statResult = _wstat(filename.charactersWithNullTermination(), &sb); 43 if (statResult != 0 || (sb.st_mode & S_IFMT) != S_IFREG) 44 return false; 45 result = sb.st_size; 46 return true; 47 } 35 48 36 bool fileExists(const String&); 37 bool deleteFile(const String&); 38 39 } // namespace WebCore 40 41 #endif // FileSystem_h 49 }
Note:
See TracChangeset
for help on using the changeset viewer.