| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010, Google Inc. | 2 * Copyright 2010, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 | 32 |
| 33 // Constants for Posix stats aggregation and uploading | 33 // Constants for Posix stats aggregation and uploading |
| 34 #include "const-mac.h" | 34 #include "const-mac.h" |
| 35 | 35 |
| 36 namespace stats_report { | 36 namespace stats_report { |
| 37 | 37 |
| 38 const char kTimingsKeyName = "Timings"; | 38 const char kTimingsKeyName[] = "Timings"; |
| 39 const char kCountsKeyName = "Counts"; | 39 const char kCountsKeyName[] = "Counts"; |
| 40 const char kIntegersKeyName = "Integers"; | 40 const char kIntegersKeyName[] = "Integers"; |
| 41 const char kBooleansKeyName = "Booleans"; | 41 const char kBooleansKeyName[] = "Booleans"; |
| 42 | 42 |
| 43 static NSString* FindGoogleAppDirectory(void) { | 43 static NSString* FindGoogleAppDirectory(void) { |
| 44 NSString *applicationSupportFolder = | 44 NSString *applicationSupportFolder = |
| 45 [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, | 45 [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, |
| 46 NSUserDomainMask, | 46 NSUserDomainMask, |
| 47 YES) objectAtIndex:0]; | 47 YES) objectAtIndex:0]; |
| 48 | 48 |
| 49 NSString *googleAppSupportPath = | 49 NSString *googleAppSupportPath = |
| 50 [applicationSupportFolder stringByAppendingString:@"/Google"]; | 50 [applicationSupportFolder stringByAppendingString:@"/Google"]; |
| 51 | 51 |
| 52 if (![[NSFileManager defaultManager] fileExistsAtPath:googleAppSupportPath]) | 52 if (![[NSFileManager defaultManager] fileExistsAtPath:googleAppSupportPath]) |
| 53 [[NSFileManager defaultManager] createDirectoryAtPath:googleAppSupportPath | 53 [[NSFileManager defaultManager] createDirectoryAtPath:googleAppSupportPath |
| 54 attributes:nil]; | 54 attributes:nil]; |
| 55 | 55 |
| 56 return googleAppSupportPath; | 56 return googleAppSupportPath; |
| 57 } | 57 } |
| 58 | 58 |
| 59 NSString* O3DStatsPath(void) { | 59 NSString* O3DStatsPath(void) { |
| 60 static NSString* the_path = NULL; | 60 static NSString* the_path = NULL; |
| 61 if (!the_path) { | 61 if (!the_path) { |
| 62 the_path = [FindGoogleAppDirectory() stringByAppendingString:@"/O3D_Stats"]; | 62 the_path = [FindGoogleAppDirectory() stringByAppendingString:@"/O3D_Stats"]; |
| 63 [the_path retain]; | 63 [the_path retain]; |
| 64 } | 64 } |
| 65 return the_path; | 65 return the_path; |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace stats_report | 68 } // namespace stats_report |
| OLD | NEW |