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

Unified Diff: chrome/common/chrome_paths.cc

Issue 174253002: Initialize chrome::DIR_USER_DATA early on for service processes, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use dynamic_annotations_win64 for common_constants_win64. Created 6 years, 10 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 | « chrome/common/chrome_paths.h ('k') | chrome/common_constants.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_paths.cc
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
index 2333da1fd2489182bccbddf3f90b2d042d9b2699..d34e2479ca45d95c15aac3efa8c56fa2d27700e9 100644
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -5,6 +5,7 @@
#include "chrome/common/chrome_paths.h"
#include "base/file_util.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/path_service.h"
@@ -94,9 +95,8 @@ const base::FilePath::CharType kFilepathSinglePrefExtensions[] =
#endif // defined(GOOGLE_CHROME_BUILD)
#endif // defined(OS_LINUX)
-} // namespace
-
-namespace chrome {
+static base::LazyInstance<base::FilePath>
+ g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER;
// Gets the path for internal plugins.
bool GetInternalPluginsDirectory(base::FilePath* result) {
@@ -116,6 +116,10 @@ bool GetInternalPluginsDirectory(base::FilePath* result) {
return PathService::Get(base::DIR_MODULE, result);
}
+} // namespace
+
+namespace chrome {
+
bool PathProvider(int key, base::FilePath* result) {
// Some keys are just aliases...
switch (key) {
@@ -551,4 +555,12 @@ void RegisterPathProvider() {
PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
}
+void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) {
+ g_invalid_specified_user_data_dir.Get() = user_data_dir;
+}
+
+const base::FilePath& GetInvalidSpecifiedUserDataDir() {
+ return g_invalid_specified_user_data_dir.Get();
+}
+
} // namespace chrome
« no previous file with comments | « chrome/common/chrome_paths.h ('k') | chrome/common_constants.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698