OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_NSS_CONTEXT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_NSS_CONTEXT_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "content/common/content_export.h" |
| 12 #include "crypto/scoped_nss_types.h" |
| 13 |
| 14 namespace net { |
| 15 class NSSCertDatabase; |
| 16 } |
| 17 |
| 18 namespace content { |
| 19 |
| 20 class ResourceContext; |
| 21 |
| 22 #if defined(OS_CHROMEOS) |
| 23 // Set the username hash of the user associated with the given |context|. This |
| 24 // should be called during profile initialization. |
| 25 CONTENT_EXPORT void SetChromeOSUserForResourceContext( |
| 26 ResourceContext* context, |
| 27 const std::string username_hash); |
| 28 |
| 29 // Return the username hash of the user associated with the given |context|. |
| 30 CONTENT_EXPORT std::string GetChromeOSUserForResourceContext( |
| 31 ResourceContext* context); |
| 32 #endif |
| 33 |
| 34 // Runs |callback| with the private slot handle when the private slot is loaded. |
| 35 // If the slot is already loaded, the |callback| will be run synchronously. |
| 36 // Should be called only on the IO thread. |
| 37 CONTENT_EXPORT void OnPrivateNSSKeySlotForResourceContextReady( |
| 38 ResourceContext* context, |
| 39 const base::Callback<void(crypto::ScopedPK11Slot)>& callback); |
| 40 |
| 41 // Runs |callback| with the public and private slot handles when the slots are |
| 42 // loaded. If the slots are already loaded, the |callback| will be run |
| 43 // synchronously. Should be called only on the IO thread. |
| 44 CONTENT_EXPORT void OnNSSKeySlotsForResourceContextReady( |
| 45 ResourceContext* context, |
| 46 const base::Callback< |
| 47 void(crypto::ScopedPK11Slot, crypto::ScopedPK11Slot)>& callback); |
| 48 |
| 49 // Get a NSSCertDatabase for the given |context|. Should be called only on the |
| 50 // IO thread. |
| 51 CONTENT_EXPORT void GetNSSCertDatabaseForResourceContext( |
| 52 ResourceContext* context, |
| 53 const base::Callback<void(net::NSSCertDatabase*)>& callback); |
| 54 |
| 55 } // namespace content |
| 56 |
| 57 #endif // CONTENT_PUBLIC_BROWSER_NSS_CONTEXT_H_ |
OLD | NEW |