Index: base/base_paths_mac.mm |
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm |
index 56f3ecb9a91e9be5c8888e2f9e53fc04a4cbf64a..9ca04d2b83289f8fa3e670d029601c11020e54e9 100644 |
--- a/base/base_paths_mac.mm |
+++ b/base/base_paths_mac.mm |
@@ -59,8 +59,20 @@ 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: |
+ case base::DIR_APP_DATA: { |
+#if defined(OS_IOS) |
rohitrao (ping after 24h)
2012/07/18 16:01:34
bool success = base::mac::GetUserDirectory(NSAppli
chenyu
2012/07/18 16:43:32
Done. I keep the if-def for now and will remove it
|
+ // On IOS, this directory does not exist unless it is created explicitly. |
+ bool success = base::mac::GetUserDirectory(NSApplicationSupportDirectory, |
+ result); |
+ if (success && !file_util::PathExists(*result) && |
+ !file_util::CreateDirectory(*result)) { |
+ return false; |
+ } |
+ return success; |
+#else |
return base::mac::GetUserDirectory(NSApplicationSupportDirectory, result); |
+#endif // defined(OS_IOS) |
+ } |
case base::DIR_SOURCE_ROOT: { |
// Go through PathService to catch overrides. |
if (!PathService::Get(base::FILE_EXE, result)) |