OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 } | 231 } |
232 | 232 |
233 CFTypeRef GetValueFromDictionary(CFDictionaryRef dict, | 233 CFTypeRef GetValueFromDictionary(CFDictionaryRef dict, |
234 CFStringRef key, | 234 CFStringRef key, |
235 CFTypeID expected_type) { | 235 CFTypeID expected_type) { |
236 CFTypeRef value = CFDictionaryGetValue(dict, key); | 236 CFTypeRef value = CFDictionaryGetValue(dict, key); |
237 if (!value) | 237 if (!value) |
238 return value; | 238 return value; |
239 | 239 |
240 if (CFGetTypeID(value) != expected_type) { | 240 if (CFGetTypeID(value) != expected_type) { |
241 std::string expected_type_name = base::SysCFStringRefToUTF8( | 241 ScopedCFTypeRef<CFStringRef> expected_type_name( |
242 CFCopyTypeIDDescription(expected_type)); | 242 CFCopyTypeIDDescription(expected_type)); |
| 243 std::string expected_type_utf8 = |
| 244 base::SysCFStringRefToUTF8(expected_type_name); |
243 DLOG(WARNING) << GetValueFromDictionaryErrorMessage(key, | 245 DLOG(WARNING) << GetValueFromDictionaryErrorMessage(key, |
244 expected_type_name, | 246 expected_type_utf8, |
245 value); | 247 value); |
246 return NULL; | 248 return NULL; |
247 } | 249 } |
248 | 250 |
249 return value; | 251 return value; |
250 } | 252 } |
251 | 253 |
252 void NSObjectRetain(void* obj) { | 254 void NSObjectRetain(void* obj) { |
253 id<NSObject> nsobj = static_cast<id<NSObject> >(obj); | 255 id<NSObject> nsobj = static_cast<id<NSObject> >(obj); |
254 [nsobj retain]; | 256 [nsobj retain]; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey)); | 396 CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey)); |
395 } | 397 } |
396 o << "Code: " << CFErrorGetCode(err) | 398 o << "Code: " << CFErrorGetCode(err) |
397 << " Domain: " << CFErrorGetDomain(err) | 399 << " Domain: " << CFErrorGetDomain(err) |
398 << " Desc: " << desc.get(); | 400 << " Desc: " << desc.get(); |
399 if(errorDesc) { | 401 if(errorDesc) { |
400 o << "(" << errorDesc << ")"; | 402 o << "(" << errorDesc << ")"; |
401 } | 403 } |
402 return o; | 404 return o; |
403 } | 405 } |
OLD | NEW |