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

Unified Diff: base/base_paths_mac.mm

Issue 10795010: Add an iOS implementation for base::PathService::Get() with path key DIR_APP_DATA. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move comments to ios block Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base_paths_mac.mm
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm
index 56f3ecb9a91e9be5c8888e2f9e53fc04a4cbf64a..ee6c03f6d10ad74bd61eab338e3b3890b319d176 100644
--- a/base/base_paths_mac.mm
+++ b/base/base_paths_mac.mm
@@ -59,8 +59,16 @@ bool PathProviderMac(int key, FilePath* result) {
reinterpret_cast<const void*>(&base::PathProviderMac));
case base::DIR_CACHE:
return base::mac::GetUserDirectory(NSCachesDirectory, result);
- case base::DIR_APP_DATA:
- return base::mac::GetUserDirectory(NSApplicationSupportDirectory, result);
+ case base::DIR_APP_DATA: {
+ bool success = base::mac::GetUserDirectory(NSApplicationSupportDirectory,
+ result);
+#if defined(OS_IOS)
Mark Mentovai 2012/07/31 23:04:13 I would say that you don’t have to #ifdef this. It
rohitrao (ping after 24h) 2012/07/31 23:08:18 Ok, will leave this as-is. It's a two-line CL if
+ // On IOS, this directory does not exist unless it is created explicitly.
+ if (success && !file_util::PathExists(*result))
+ success = file_util::CreateDirectory(*result);
+#endif // defined(OS_IOS)
+ return success;
+ }
case base::DIR_SOURCE_ROOT: {
// Go through PathService to catch overrides.
if (!PathService::Get(base::FILE_EXE, result))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698