Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / common / chrome_paths.cc
index 2333da1..d34e247 100644 (file)
@@ -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