| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ | 5 #ifndef CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ |
| 6 #define CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ | 6 #define CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 ~ChromeNSSCryptoModuleDelegate() override; | 34 ~ChromeNSSCryptoModuleDelegate() override; |
| 35 | 35 |
| 36 // Must be called on IO thread. Creates a delegate and returns it | 36 // Must be called on IO thread. Creates a delegate and returns it |
| 37 // synchronously or asynchronously to |callback|. If the delegate could not be | 37 // synchronously or asynchronously to |callback|. If the delegate could not be |
| 38 // created, |callback| is called with NULL. | 38 // created, |callback| is called with NULL. |
| 39 static void CreateForResourceContext( | 39 static void CreateForResourceContext( |
| 40 chrome::CryptoModulePasswordReason reason, | 40 chrome::CryptoModulePasswordReason reason, |
| 41 const net::HostPortPair& server, | 41 const net::HostPortPair& server, |
| 42 content::ResourceContext* context, | 42 content::ResourceContext* context, |
| 43 const base::Callback<void(scoped_ptr<ChromeNSSCryptoModuleDelegate>)>& | 43 const base::Callback< |
| 44 callback); | 44 void(std::unique_ptr<ChromeNSSCryptoModuleDelegate>)>& callback); |
| 45 | 45 |
| 46 // crypto::NSSCryptoModuleDelegate implementation. | 46 // crypto::NSSCryptoModuleDelegate implementation. |
| 47 crypto::ScopedPK11Slot RequestSlot() override; | 47 crypto::ScopedPK11Slot RequestSlot() override; |
| 48 | 48 |
| 49 // crypto::CryptoModuleBlockingPasswordDelegate implementation. | 49 // crypto::CryptoModuleBlockingPasswordDelegate implementation. |
| 50 std::string RequestPassword(const std::string& slot_name, | 50 std::string RequestPassword(const std::string& slot_name, |
| 51 bool retry, | 51 bool retry, |
| 52 bool* cancelled) override; | 52 bool* cancelled) override; |
| 53 | 53 |
| 54 private: | 54 private: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 73 DISALLOW_COPY_AND_ASSIGN(ChromeNSSCryptoModuleDelegate); | 73 DISALLOW_COPY_AND_ASSIGN(ChromeNSSCryptoModuleDelegate); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 // Create a delegate which only handles unlocking slots. | 76 // Create a delegate which only handles unlocking slots. |
| 77 crypto::CryptoModuleBlockingPasswordDelegate* | 77 crypto::CryptoModuleBlockingPasswordDelegate* |
| 78 CreateCryptoModuleBlockingPasswordDelegate( | 78 CreateCryptoModuleBlockingPasswordDelegate( |
| 79 chrome::CryptoModulePasswordReason reason, | 79 chrome::CryptoModulePasswordReason reason, |
| 80 const net::HostPortPair& server); | 80 const net::HostPortPair& server); |
| 81 | 81 |
| 82 #endif // CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ | 82 #endif // CHROME_BROWSER_UI_CRYPTO_MODULE_DELEGATE_NSS_H_ |
| OLD | NEW |