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

Unified Diff: chrome/browser/profile.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 | « chrome/browser/process_singleton_win.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile.cc
===================================================================
--- chrome/browser/profile.cc (revision 33536)
+++ chrome/browser/profile.cc (working copy)
@@ -608,10 +608,23 @@
base_cache_path_ = user_cache_path;
}
}
+#elif defined(OS_POSIX) // Posix minus Mac.
+ // See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+ // for a spec on where cache files go. The net effect for most systems is we
+ // use ~/.cache/chromium/ for Chromium and ~/.cache/google-chrome/ for
+ // official builds.
+ if (!PathService::IsOverridden(chrome::DIR_USER_DATA)) {
+#if defined(GOOGLE_CHROME_BUILD)
+ const char kCacheDir[] = "google-chrome";
#else
- if (!PathService::IsOverridden(chrome::DIR_USER_DATA))
- PathService::Get(chrome::DIR_USER_CACHE, &base_cache_path_);
+ const char kCacheDir[] = "chromium";
#endif
+ PathService::Get(base::DIR_USER_CACHE, &base_cache_path_);
+ base_cache_path_ = base_cache_path_.Append(kCacheDir);
+ if (!file_util::PathExists(base_cache_path_))
+ file_util::CreateDirectory(base_cache_path_);
+ }
+#endif
if (base_cache_path_.empty())
base_cache_path_ = path_;
« no previous file with comments | « chrome/browser/process_singleton_win.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698