Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(797)

Side by Side Diff: chrome/browser/net/nss_slot_factory.h

Issue 18121007: *WIP* Store NSS slots per profile. Move keygen to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanups, add test for chrome keygen class Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 CHROME_BROWSER_NET_NSS_SLOT_FACTORY_H_
6 #define CHROME_BROWSER_NET_NSS_SLOT_FACTORY_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/memory/singleton.h"
10 #include "components/browser_context_keyed_service/browser_context_keyed_service _factory.h"
11 #include "crypto/scoped_nss_types.h"
12
13 namespace content {
14 class BrowserContext;
15 }
16
17 // Singleton that associates NSS slots with BrowserContexts. Listens for the
18 // BrowserContext's destruction notification and cleans up the associated
19 // PK11SlotInfo references.
20 class NSSSlotFactory : public BrowserContextKeyedServiceFactory {
21 public:
22 // Returns a reference to the public slot for |context|.
23 static crypto::ScopedPK11Slot GetPublicSlotForBrowserContext(
24 content::BrowserContext* context);
25 // Returns a reference to the private slot for |context|.
26 static crypto::ScopedPK11Slot GetPrivateSlotForBrowserContext(
27 content::BrowserContext* context);
28
29 static NSSSlotFactory* GetInstance();
30
31 protected:
32 // BrowserContextKeyedServiceFactory:
33 virtual BrowserContextKeyedService* BuildServiceInstanceFor(
34 content::BrowserContext* context) const OVERRIDE;
35 virtual content::BrowserContext* GetBrowserContextToUse(
36 content::BrowserContext* context) const OVERRIDE;
37
38 private:
39 friend struct DefaultSingletonTraits<NSSSlotFactory>;
40
41 NSSSlotFactory();
42 virtual ~NSSSlotFactory();
43 };
44
45 #endif // CHROME_BROWSER_NET_NSS_SLOT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698