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

Unified Diff: chrome/install_static/install_util.h

Issue 2487783002: Make Crashpad use the user data dir, rather than always default location (Closed)
Patch Set: . Created 4 years, 1 month 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
Index: chrome/install_static/install_util.h
diff --git a/chrome/install_static/install_util.h b/chrome/install_static/install_util.h
index 1aece7c27199fcecdfae42550204d7dae2952a12..15aff926e2ce50dde42304f15c791bc11596ebe8 100644
--- a/chrome/install_static/install_util.h
+++ b/chrome/install_static/install_util.h
@@ -60,12 +60,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 |exe_path| points to a Chrome installed in an SxS
// installation.
@@ -108,19 +106,30 @@ 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.
+bool GetUserDataDirectory(const std::wstring& user_data_dir_from_command_line,
+ std::wstring* result);
+
+// 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);
+
+// 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
@@ -220,8 +229,8 @@ bool CompareVersionStrings(const std::string& version1,
// 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);
// Caches the |ProcessType| of the current process.
extern ProcessType g_process_type;

Powered by Google App Engine
This is Rietveld 408576698