Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: base/file_util_win.cc

Issue 6883102: Add one-time randomization support for FieldTrial, and the ability to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/metrics/OWNERS » ('j') | base/metrics/field_trial.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | base/metrics/OWNERS » ('j') | base/metrics/field_trial.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698