Chromium Code Reviews| Index: base/file_util_win.cc |
| diff --git a/base/file_util_win.cc b/base/file_util_win.cc |
| index 368961459b3efdf46cbba4422a6ae21d3a82ea35..748002f58919be0ed4976c0651c614b46a3642f3 100644 |
| --- a/base/file_util_win.cc |
| +++ b/base/file_util_win.cc |
| @@ -558,6 +558,19 @@ bool GetShmemTempDir(FilePath* path) { |
| return GetTempDir(path); |
| } |
| +FilePath GetHomeDir() { |
|
jar (doing other things)
2011/04/21 01:03:50
I don't think this is a good source of entropy. .
Jói
2011/04/21 19:50:33
2011/04/21 01:03:50, jar wrote:
|
| + wchar_t temp_path[MAX_PATH + 1]; |
| + HRESULT hr = ::SHGetFolderPath( |
| + NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, temp_path); |
| + // No error handling should be necessary for CSIDL_PROFILE; it must |
| + // always exist (after all, we store Chrome data in a subdirectory of it) |
| + // and it is not invalid. Use a hard CHECK to make sure we know if this |
| + // assumption is broken in the wild. |
| + CHECK(SUCCEEDED(hr)); |
| + |
| + return FilePath(temp_path); |
| +} |
| + |
| bool CreateTemporaryFile(FilePath* path) { |
| base::ThreadRestrictions::AssertIOAllowed(); |