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

Unified Diff: base/base_paths_posix.cc

Issue 449048: Move some XDG code from chrome to base. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linux base_unittest Created 11 years 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 | « base/base_paths.h ('k') | base/linux_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base_paths_posix.cc
===================================================================
--- base/base_paths_posix.cc (revision 33536)
+++ base/base_paths_posix.cc (working copy)
@@ -2,15 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// This is really Posix minus Mac. Mac code is in base_paths_mac.mm.
+
#include "base/base_paths.h"
#include <unistd.h>
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/linux_util.h"
#include "base/logging.h"
#include "base/path_service.h"
-#include "base/string_piece.h"
+#include "base/scoped_ptr.h"
#include "base/sys_string_conversions.h"
namespace base {
@@ -56,6 +59,13 @@
LOG(ERROR) << "Couldn't find your source root. "
<< "Try running from your chromium/src directory.";
return false;
+ case base::DIR_USER_CACHE:
+ scoped_ptr<base::EnvironmentVariableGetter> env(
+ base::EnvironmentVariableGetter::Create());
+ FilePath cache_dir(base::GetXDGDirectory(env.get(), "XDG_CACHE_HOME",
+ ".cache"));
+ *result = cache_dir;
+ return true;
}
return false;
}
« no previous file with comments | « base/base_paths.h ('k') | base/linux_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698