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

Side by Side Diff: base/mac/foundation_util.mm

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 months 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/ios/device_util.mm ('k') | base/mac/launch_services_util.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/foundation_util.h" 5 #include "base/mac/foundation_util.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 376 }
377 377
378 } // namespace mac 378 } // namespace mac
379 } // namespace base 379 } // namespace base
380 380
381 std::ostream& operator<<(std::ostream& o, const CFStringRef string) { 381 std::ostream& operator<<(std::ostream& o, const CFStringRef string) {
382 return o << base::SysCFStringRefToUTF8(string); 382 return o << base::SysCFStringRefToUTF8(string);
383 } 383 }
384 384
385 std::ostream& operator<<(std::ostream& o, const CFErrorRef err) { 385 std::ostream& operator<<(std::ostream& o, const CFErrorRef err) {
386 base::mac::ScopedCFTypeRef<CFStringRef> desc(CFErrorCopyDescription(err)); 386 base::ScopedCFTypeRef<CFStringRef> desc(CFErrorCopyDescription(err));
387 base::mac::ScopedCFTypeRef<CFDictionaryRef> user_info( 387 base::ScopedCFTypeRef<CFDictionaryRef> user_info(CFErrorCopyUserInfo(err));
388 CFErrorCopyUserInfo(err));
389 CFStringRef errorDesc = NULL; 388 CFStringRef errorDesc = NULL;
390 if (user_info.get()) { 389 if (user_info.get()) {
391 errorDesc = reinterpret_cast<CFStringRef>( 390 errorDesc = reinterpret_cast<CFStringRef>(
392 CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey)); 391 CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey));
393 } 392 }
394 o << "Code: " << CFErrorGetCode(err) 393 o << "Code: " << CFErrorGetCode(err)
395 << " Domain: " << CFErrorGetDomain(err) 394 << " Domain: " << CFErrorGetDomain(err)
396 << " Desc: " << desc.get(); 395 << " Desc: " << desc.get();
397 if(errorDesc) { 396 if(errorDesc) {
398 o << "(" << errorDesc << ")"; 397 o << "(" << errorDesc << ")";
399 } 398 }
400 return o; 399 return o;
401 } 400 }
OLDNEW
« no previous file with comments | « base/ios/device_util.mm ('k') | base/mac/launch_services_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698