OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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_NET_NSS_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_NET_NSS_CONTEXT_H_ |
6 #define CHROME_BROWSER_NET_NSS_CONTEXT_H_ | 6 #define CHROME_BROWSER_NET_NSS_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 crypto::ScopedPK11Slot GetPrivateNSSKeySlotForResourceContext( | 33 crypto::ScopedPK11Slot GetPrivateNSSKeySlotForResourceContext( |
34 content::ResourceContext* context, | 34 content::ResourceContext* context, |
35 const base::Callback<void(crypto::ScopedPK11Slot)>& callback) | 35 const base::Callback<void(crypto::ScopedPK11Slot)>& callback) |
36 WARN_UNUSED_RESULT; | 36 WARN_UNUSED_RESULT; |
37 | 37 |
38 // Returns a pointer to the NSSCertDatabase for the user associated with | 38 // Returns a pointer to the NSSCertDatabase for the user associated with |
39 // |context|, if it is ready. If it is not ready and |callback| is non-null, the | 39 // |context|, if it is ready. If it is not ready and |callback| is non-null, the |
40 // |callback| will be run once the DB is initialized. Ownership is not | 40 // |callback| will be run once the DB is initialized. Ownership is not |
41 // transferred, but the caller may save the pointer, which will remain valid for | 41 // transferred, but the caller may save the pointer, which will remain valid for |
42 // the lifetime of the ResourceContext. | 42 // the lifetime of the ResourceContext. |
43 // Should be called only on the IO thread. | 43 // Must be called only on the IO thread. |
44 net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext( | 44 net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext( |
45 content::ResourceContext* context, | 45 content::ResourceContext* context, |
46 const base::Callback<void(net::NSSCertDatabase*)>& callback) | 46 const base::Callback<void(net::NSSCertDatabase*)>& callback) |
47 WARN_UNUSED_RESULT; | 47 WARN_UNUSED_RESULT; |
48 | 48 |
49 // Gets a pointer to the NSSCertDatabase for the user associated with |context|. | 49 // Gets a pointer to the NSSCertDatabase for the user associated with |context|. |
50 // It's a wrapper around |GetNSSCertDatabaseForResourceContext| which makes | 50 // It's a wrapper around |GetNSSCertDatabaseForResourceContext| which makes |
51 // sure it's called on IO thread (with |profile|'s resource context). The | 51 // sure it's called on IO thread (with |profile|'s resource context). The |
52 // callback will be called on the originating message loop. | 52 // callback will be called on the originating message loop. |
53 // It's accessing profile, so it should be called on the UI thread. | 53 // It's accessing profile, so it should be called on the UI thread. |
54 void GetNSSCertDatabaseForProfile( | 54 void GetNSSCertDatabaseForProfile( |
55 Profile* profile, | 55 Profile* profile, |
56 const base::Callback<void(net::NSSCertDatabase*)>& callback); | 56 const base::Callback<void(net::NSSCertDatabase*)>& callback); |
57 | 57 |
58 #endif // CHROME_BROWSER_NET_NSS_CONTEXT_H_ | 58 #endif // CHROME_BROWSER_NET_NSS_CONTEXT_H_ |
OLD | NEW |