| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_POLICY_CORE_COMMON_MAC_UTIL_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_MAC_UTIL_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_MAC_UTIL_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_MAC_UTIL_H_ |
| 7 | 7 |
| 8 #include <CoreFoundation/CoreFoundation.h> | 8 #include <CoreFoundation/CoreFoundation.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include <memory> |
| 11 |
| 11 #include "components/policy/policy_export.h" | 12 #include "components/policy/policy_export.h" |
| 12 | 13 |
| 13 // This file contains utilities shared by both Mac OS X and iOS. | 14 // This file contains utilities shared by both Mac OS X and iOS. |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 class Value; | 17 class Value; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace policy { | 20 namespace policy { |
| 20 | 21 |
| 21 // Converts a CFPropertyListRef to the equivalent base::Value. CFDictionary | 22 // Converts a CFPropertyListRef to the equivalent base::Value. CFDictionary |
| 22 // entries whose key is not a CFStringRef are ignored. | 23 // entries whose key is not a CFStringRef are ignored. |
| 23 // Returns NULL if an invalid CFType was found, such as CFDate or CFData. | 24 // Returns NULL if an invalid CFType was found, such as CFDate or CFData. |
| 24 // NSDictionary is toll-free bridged to CFDictionaryRef, which is a | 25 // NSDictionary is toll-free bridged to CFDictionaryRef, which is a |
| 25 // CFPropertyListRef, so it can also be passed directly here. Same for the | 26 // CFPropertyListRef, so it can also be passed directly here. Same for the |
| 26 // other NS* classes that map to CF* properties. | 27 // other NS* classes that map to CF* properties. |
| 27 POLICY_EXPORT scoped_ptr<base::Value> PropertyToValue( | 28 POLICY_EXPORT std::unique_ptr<base::Value> PropertyToValue( |
| 28 CFPropertyListRef property); | 29 CFPropertyListRef property); |
| 29 | 30 |
| 30 } // namespace policy | 31 } // namespace policy |
| 31 | 32 |
| 32 #endif // COMPONENTS_POLICY_CORE_COMMON_MAC_UTIL_H_ | 33 #endif // COMPONENTS_POLICY_CORE_COMMON_MAC_UTIL_H_ |
| OLD | NEW |