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

Side by Side Diff: ios/chrome/browser/file_metadata_util.mm

Issue 2566993002: [ObjC ARC] Converts ios/chrome/browser:browser to ARC. (Closed)
Patch Set: comments Created 4 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 unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/experimental_flags.mm ('k') | ios/chrome/browser/install_time_util.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ios/chrome/browser/file_metadata_util.h" 5 #include "ios/chrome/browser/file_metadata_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
11 #include "base/threading/thread_restrictions.h" 11 #include "base/threading/thread_restrictions.h"
12 12
13 #if !defined(__has_feature) || !__has_feature(objc_arc)
14 #error "This file requires ARC support."
15 #endif
16
13 void SetSkipSystemBackupAttributeToItem(const base::FilePath& path, 17 void SetSkipSystemBackupAttributeToItem(const base::FilePath& path,
14 bool skip_system_backup) { 18 bool skip_system_backup) {
15 base::ThreadRestrictions::AssertIOAllowed(); 19 base::ThreadRestrictions::AssertIOAllowed();
16 20
17 NSURL* file_url = 21 NSURL* file_url =
18 [NSURL fileURLWithPath:base::SysUTF8ToNSString(path.value())]; 22 [NSURL fileURLWithPath:base::SysUTF8ToNSString(path.value())];
19 DCHECK([[NSFileManager defaultManager] fileExistsAtPath:file_url.path]); 23 DCHECK([[NSFileManager defaultManager] fileExistsAtPath:file_url.path]);
20 24
21 NSError* error = nil; 25 NSError* error = nil;
22 BOOL success = [file_url setResourceValue:(skip_system_backup ? @YES : @NO) 26 BOOL success = [file_url setResourceValue:(skip_system_backup ? @YES : @NO)
23 forKey:NSURLIsExcludedFromBackupKey 27 forKey:NSURLIsExcludedFromBackupKey
24 error:&error]; 28 error:&error];
25 if (!success) { 29 if (!success) {
26 LOG(ERROR) << [[error description] UTF8String]; 30 LOG(ERROR) << [[error description] UTF8String];
27 } 31 }
28 } 32 }
29 33
OLDNEW
« no previous file with comments | « ios/chrome/browser/experimental_flags.mm ('k') | ios/chrome/browser/install_time_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698