| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "net/cert/test_keychain_search_list_mac.h" | 5 #include "net/cert/test_keychain_search_list_mac.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 bool TestKeychainSearchList::HasInstance() { | 35 bool TestKeychainSearchList::HasInstance() { |
| 36 return !!g_test_keychain_search_list; | 36 return !!g_test_keychain_search_list; |
| 37 } | 37 } |
| 38 | 38 |
| 39 // static | 39 // static |
| 40 TestKeychainSearchList* TestKeychainSearchList::GetInstance() { | 40 TestKeychainSearchList* TestKeychainSearchList::GetInstance() { |
| 41 return g_test_keychain_search_list; | 41 return g_test_keychain_search_list; |
| 42 } | 42 } |
| 43 | 43 |
| 44 OSStatus TestKeychainSearchList::CopySearchList( | 44 OSStatus TestKeychainSearchList::CopySearchList( |
| 45 CFArrayRef* keychain_search_list) const { | 45 base::ScopedCFTypeRef<CFArrayRef>* keychain_search_list) const { |
| 46 *keychain_search_list = | 46 keychain_search_list->reset(CFArrayCreateCopy( |
| 47 CFArrayCreateCopy(kCFAllocatorDefault, scoped_keychain_search_list.get()); | 47 kCFAllocatorDefault, scoped_keychain_search_list.get())); |
| 48 return *keychain_search_list ? 0 : errSecAllocate; | 48 return *keychain_search_list ? 0 : errSecAllocate; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void TestKeychainSearchList::AddKeychain(SecKeychainRef keychain) { | 51 void TestKeychainSearchList::AddKeychain(SecKeychainRef keychain) { |
| 52 CFArrayAppendValue(scoped_keychain_search_list.get(), keychain); | 52 CFArrayAppendValue(scoped_keychain_search_list.get(), keychain); |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace net | 55 } // namespace net |
| OLD | NEW |