summaryrefslogtreecommitdiffstats
path: root/base/base_paths_posix.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 08:45:01 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 08:45:01 +0000
commit9e9b6e8ee77229781fa8581b7f46413024404a5f (patch)
tree5b3dfc45e4e65db382138b64e5a63ac3c3b0dad6 /base/base_paths_posix.cc
parent7aadea0cf98791bbbf163b0d2ef078c7697fea4e (diff)
downloadchromium_src-9e9b6e8ee77229781fa8581b7f46413024404a5f.zip
chromium_src-9e9b6e8ee77229781fa8581b7f46413024404a5f.tar.gz
chromium_src-9e9b6e8ee77229781fa8581b7f46413024404a5f.tar.bz2
Move some XDG code from chrome to base, make DIR_USER_CACHE generic rather than Chromium specific, and clean up a few headers.
BUG=none TEST=none Review URL: http://codereview.chromium.org/449048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_paths_posix.cc')
-rw-r--r--base/base_paths_posix.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/base/base_paths_posix.cc b/base/base_paths_posix.cc
index 799c135..bcbc578 100644
--- a/base/base_paths_posix.cc
+++ b/base/base_paths_posix.cc
@@ -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 @@ bool PathProviderPosix(int key, FilePath* result) {
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;
}