Do some cleanup of file path name handling.

This started trying to cleanup DownloadManager::GenerateFilename which asserts
if your system locale isn't UTF-8 (I ran into this when mine got messed up).
The solution is to have GetSuggestedFilename return a FilePath rather than
calling FromWStringHack.

The rest of the patch is a result of trying to write GetSuggestedFilename in a
reasonable way. I changed ReplaceIllegalCharacters to work on a
FilePath::StringType.

Some places in the code calling these functions got cleaner, some got messier.
I think overall the ones that got messier are the ones doing sketchy things
with paths and the ones that got cleaner are the ones doing things more
properly.

The only code here that gets called a nontrivial number of times is the
weburlloader, and I think the new code does about the same number of string
conversions overall (though on certain platforms the number will be higher or
lower).

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/271056

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


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