In WebCore/platform/posix/FileSystemPOSIX.cpp all the functions that access the filesystem (e.g. fileExists, deleteFile) and take a WebCore::String representing the file path run that string through fileSystemRepresentation() before using it, except for openFile(). This causes openFile to fail on Android, where the call to fileSystemRepresentation is very important. I'd like to change openFile() to make this call. I think the existing FileReader tests in LayoutTests/fast/files should suffice here. Patch to follow.
Created attachment 57338 [details] Patch.
Comment on attachment 57338 [details] Patch. > + if (!fsRep.data() || fsRep.data()[0] == '\0') > + return invalidPlatformFileHandle; I understand the check for null here, but: 1) I suggest using the isNull function instead. 2) Why the check for the empty string? I don't think there's a need to optimize that case, and I expect open to give an error. r=me
(In reply to comment #2) > (From update of attachment 57338 [details]) > > + if (!fsRep.data() || fsRep.data()[0] == '\0') > > + return invalidPlatformFileHandle; > > I understand the check for null here, but: > > 1) I suggest using the isNull function instead. > 2) Why the check for the empty string? I don't think there's a need to optimize that case, and I expect open to give an error. > > r=me Thanks for the review Darin! When checking the value of the return of the fileSystemRepresentation function I was following the standard pattern of other functions in the file - they all perform a null and empty string check in this way. Having said that, I think you're correct - isNull() is better and open should be able to handle the empty string. I'll make your suggested changes and land this patch manually. Cheers, Ben
Sending WebCore/ChangeLog Sending WebCore/platform/posix/FileSystemPOSIX.cpp Transmitting file data .. Committed revision 60374.