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

Issue 10795010: Add an iOS implementation for base::PathService::Get() with path key DIR_APP_DATA. (Closed)

Created:
8 years, 5 months ago by Chen Yu
Modified:
3 years, 10 months ago
CC:
chromium-reviews, erikwright (departed), brettw-cc_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add an iOS implementation for base::PathService::Get() with path key DIR_APP_DATA. This implementation creates a DIR_APP_DATA directory if it does not exist. This is needed for iOS because on iOS NSApplicationSupportDirectory directory does not exist unless it is created explicitly. BUG=NONE TEST=NONE Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=149331

Patch Set 1 #

Patch Set 2 : add a comment #

Total comments: 2

Patch Set 3 : Address review comments #

Total comments: 1

Patch Set 4 : Move comments to ios block #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -2 lines) Patch
M base/base_paths_mac.mm View 1 2 3 1 chunk +10 lines, -2 lines 2 comments Download

Messages

Total messages: 11 (0 generated)
rohitrao (ping after 24h)
https://chromiumcodereview.appspot.com/10795010/diff/2001/base/base_paths_mac.mm File base/base_paths_mac.mm (right): https://chromiumcodereview.appspot.com/10795010/diff/2001/base/base_paths_mac.mm#newcode63 base/base_paths_mac.mm:63: #if defined(OS_IOS) bool success = base::mac::GetUserDirectory(NSApplicationSupportDirectory, result); #if defined(OS_IOS) ...
8 years, 5 months ago (2012-07-18 16:01:34 UTC) #1
chenyu
https://chromiumcodereview.appspot.com/10795010/diff/2001/base/base_paths_mac.mm File base/base_paths_mac.mm (right): https://chromiumcodereview.appspot.com/10795010/diff/2001/base/base_paths_mac.mm#newcode63 base/base_paths_mac.mm:63: #if defined(OS_IOS) Done. I keep the if-def for now ...
8 years, 5 months ago (2012-07-18 16:43:32 UTC) #2
rohitrao (ping after 24h)
Can you add a section to the CL description talking about the change to create ...
8 years, 5 months ago (2012-07-25 14:45:51 UTC) #3
Chen Yu
8 years, 4 months ago (2012-07-30 08:51:00 UTC) #4
Chen Yu
Done On 2012/07/25 14:45:51, rohitrao wrote: > Can you add a section to the CL ...
8 years, 4 months ago (2012-07-30 08:51:55 UTC) #5
rohitrao (ping after 24h)
+Mark Mark, the Application Support directory doesn't exist inside the iOS sandbox by default, so ...
8 years, 4 months ago (2012-07-31 14:41:47 UTC) #6
Mark Mentovai
LGTM https://chromiumcodereview.appspot.com/10795010/diff/9001/base/base_paths_mac.mm File base/base_paths_mac.mm (right): https://chromiumcodereview.appspot.com/10795010/diff/9001/base/base_paths_mac.mm#newcode65 base/base_paths_mac.mm:65: #if defined(OS_IOS) I would say that you don’t ...
8 years, 4 months ago (2012-07-31 23:04:13 UTC) #7
rohitrao (ping after 24h)
https://chromiumcodereview.appspot.com/10795010/diff/9001/base/base_paths_mac.mm File base/base_paths_mac.mm (right): https://chromiumcodereview.appspot.com/10795010/diff/9001/base/base_paths_mac.mm#newcode65 base/base_paths_mac.mm:65: #if defined(OS_IOS) On 2012/07/31 23:04:13, Mark Mentovai wrote: > ...
8 years, 4 months ago (2012-07-31 23:08:18 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/chenyu@chromium.org/10795010/9001
8 years, 4 months ago (2012-07-31 23:10:21 UTC) #9
commit-bot: I haz the power
Change committed as 149331
8 years, 4 months ago (2012-08-01 00:29:17 UTC) #10
2005daga_gmail.com
3 years, 10 months ago (2017-02-02 23:40:36 UTC) #11
Message was sent while issue was closed.

El lunes, 30 de julio de 2012, 3:51:00 (UTC-5), che...@chromium.org 
escribió:
>
> Reviewers: rohitrao, 
>
> Description: 
> Add an iOS implementation for base::PathService::Get() with path key 
> DIR_APP_DATA. 
>
> This implementation creates a DIR_APP_DATA directory if it does not exist. 
>   
> This 
> is needed for IOS because on iOS NSApplicationSupportDirectory directory   
> does 
> not exist unless it is created explicitly. 
>
> BUG=NONE 
> TEST=NONE 
>
> Please review this at https://chromiumcodereview.appspot.com/10795010/ 
>
> SVN Base: http://git.chromium.org/chromium/src.git@master 
>
> Affected files: 
>    M base/base_paths_mac.mm 
>
>
> 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) 
> +      // 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)) 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698