Index: chrome/install_static/install_util.h |
diff --git a/chrome/install_static/install_util.h b/chrome/install_static/install_util.h |
index 4ded522138c89312a068eb05c9114dd39e8ea36c..28310de1c8224f36ca370a5105fda5a3530e9b2e 100644 |
--- a/chrome/install_static/install_util.h |
+++ b/chrome/install_static/install_util.h |
@@ -42,12 +42,10 @@ extern const wchar_t kRtlLocale[]; |
// TODO(ananta) |
// https://crbug.com/604923 |
// Unify these constants with those defined in content_switches.h. |
-extern const char kGpuProcess[]; |
-extern const char kPpapiPluginProcess[]; |
-extern const char kRendererProcess[]; |
-extern const char kUtilityProcess[]; |
-extern const char kProcessType[]; |
-extern const char kCrashpadHandler[]; |
+extern const wchar_t kCrashpadHandler[]; |
+extern const wchar_t kProcessType[]; |
+extern const wchar_t kUserDataDirSwitch[]; |
+extern const wchar_t kUtilityProcess[]; |
// Returns true if Chrome is running at system level. |
bool IsSystemInstall(); |
@@ -81,19 +79,45 @@ void InitializeProcessType(); |
bool IsNonBrowserProcess(); |
// Populates |result| with the default User Data directory for the current |
-// user.This may be overidden by a command line option.Returns false if all |
-// attempts at locating a User Data directory fail |
+// user. Returns false if all attempts at locating a User Data directory fail. |
// TODO(ananta) |
// http://crbug.com/604923 |
// Unify this with the Browser Distribution code. |
bool GetDefaultUserDataDirectory(std::wstring* result); |
-// Populates |crash_dir| with the default crash dump location regardless of |
-// whether DIR_USER_DATA or DIR_CRASH_DUMPS has been overridden. |
+// Populates |result| with the user data dir, respecting various overrides in |
+// the manner of chrome_main_delegate.cc InitializeUserDataDir(). This includes |
+// overrides on the command line, overrides by registry policy, and fallback to |
+// the default User Data dir if the directory is invalid or unspecified. |
+// |
+// If a directory was given by the user (either on the command line, or by |
+// registry policy), but it was invalid or unusable, then |
+// |invalid_supplied_directory| will be filled with the value that was unusable |
+// for reporting an error to the user. |
+// |
+// Other than in test situations, it is generally only appropriate to call this |
+// function once on startup and use the result for subsequent callers, otherwise |
+// there's a race with registry modification (which could cause a different |
+// derivation) so different subsystems would see different values). In normal |
+// usage, this will be called once at startup and saved into InstallDetails |
+// from where it should be retrieved. |
+bool GetUserDataDirectory(const std::wstring& user_data_dir_from_command_line, |
+ std::wstring* result, |
+ std::wstring* invalid_supplied_directory); |
+ |
+// The same as GetUserDataDirectory(), but directly queries the global command |
+// line object for the --user-data-dir flag. This is the more commonly used |
+// function, where GetUserDataDirectory() is used primiarily for testing. |
+bool GetUserDataDirectoryUsingProcessCommandLine( |
+ std::wstring* result, |
+ std::wstring* invalid_supplied_directory); |
+ |
+// Populates |crash_dir| with the crash dump location, respecting modifications |
+// to user-data-dir. |
// TODO(ananta) |
// http://crbug.com/604923 |
// Unify this with the Browser Distribution code. |
-bool GetDefaultCrashDumpLocation(std::wstring* crash_dir); |
+bool GetCrashDumpLocation(std::wstring* crash_dir); |
// Returns the contents of the specified |variable_name| from the environment |
// block of the calling process. Returns an empty string if the variable does |
@@ -168,8 +192,8 @@ std::vector<std::wstring> TokenizeString16(const std::wstring& str, |
// We assume that the command line |command_line| contains multiple switches |
// with the format --<switch name>=<switch value>. This function returns the |
// value of the |switch_name| passed in. |
-std::string GetSwitchValueFromCommandLine(const std::string& command_line, |
- const std::string& switch_name); |
+std::wstring GetSwitchValueFromCommandLine(const std::wstring& command_line, |
+ const std::wstring& switch_name); |
// Returns the unadorned channel name based on the channel strategy for the |
// install mode. |