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

Side by Side Diff: base/mac_util.mm

Issue 387016: For the immediate milestone, exclude History and Thumbnails from being backed... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « base/mac_util.h ('k') | base/mac_util_unittest.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 (c) 2008-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008-2009 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 "base/mac_util.h" 5 #include "base/mac_util.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 !it->compare(it->length() - kExtLength, kExtLength, kExt, kExtLength)) 230 !it->compare(it->length() - kExtLength, kExtLength, kExt, kExtLength))
231 return FilePath(bundle_name); 231 return FilePath(bundle_name);
232 232
233 // Separate this component from the next one. 233 // Separate this component from the next one.
234 bundle_name += '/'; 234 bundle_name += '/';
235 } 235 }
236 236
237 return FilePath(); 237 return FilePath();
238 } 238 }
239 239
240 bool SetFileBackupExclusion(const FilePath& file_path, bool exclude) {
241 NSString* filePath =
TVL 2009/11/11 02:51:02 CHECK/DCHECK for file_path.IsAbsolute()?
242 [NSString stringWithUTF8String:file_path.value().c_str()];
243 NSURL* url = [NSURL fileURLWithPath:filePath];
244 // Note that we always set CSBackupSetItemExcluded's excludeByPath param
245 // to true. This prevents a problem with toggling the setting: if the file
246 // is excluded with excludeByPath set to true then excludeByPath must
247 // also be true when un-excluding the file, otherwise the un-excluding
248 // will be ignored.
249 bool success =
250 CSBackupSetItemExcluded((CFURLRef)url, exclude, true) == noErr;
TVL 2009/11/11 02:51:02 drive by: don't the docs talk about needing to run
251 if (!success)
252 LOG(WARNING) << "Failed to set backup excluson for file '"
253 << file_path.value().c_str() << "'. Continuing.";
254 return success;
255 }
256
257
240 } // namespace mac_util 258 } // namespace mac_util
OLDNEW
« no previous file with comments | « base/mac_util.h ('k') | base/mac_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698