Fix for bug 10876 that resulted in some refactoring:

The bug originates from extensions being treated case sensitive on Windows and Mac OSX, where they shouldn't be. 

Therefore I added generic static methods to FilePath to compare strings in the same way the file system does, and changed the relevant parts of the code to make use of them.
I tested the methods under Windows and Mac OS X. I also wrote a basic version for Linux/Posix that behaves the same way as the original code, so there should at least be no regression.

Also, while fixing this I found some confusion in the code about whether extensions are used with or without leading dot. For this reason I changed some functions that were taking an extension as parameter to instead take the whole file path. This makes calling these functions easier and the caller doesn't need to know whether the extension is supposed to be with or without dot.

In the same vein, I split DownloadManager::IsExecutable into IsExecutableFile, where one again passes in the whole file and doesn't have to worry about getting the extension right, and IsExecutableExtension, which corresponds to the original functionality. Ideally only the former method should be public, but that again would have required further code scrubbing that was (even more) outside of the original bug fix.

Finally, fixed a wrong comment in the file path tests.


BUG=10876
TEST=FilePathTest.MatchesExtension, .CompareIgnoreCase

Review URL: http://codereview.chromium.org/149796

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30323 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: eccb9d1b07fb140a04ba58b6840f26be99810a94
3 files changed
tree: cc7bf0e1b0666e60d19a30145b6288056a71d8e0
  1. base/
  2. build/
  3. ipc/
  4. testing/