Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2010 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 NET_BASE_PK11_SLOT_H_ | |
| 6 #define NET_BASE_PK11_SLOT_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/ref_counted.h" | |
| 13 | |
| 14 #if defined(USE_NSS) | |
| 15 typedef struct PK11SlotInfoStr PK11SlotInfo; | |
| 16 #endif | |
| 17 | |
| 18 namespace net { | |
| 19 | |
| 20 class PK11Slot; | |
| 21 | |
| 22 typedef std::vector<scoped_refptr<PK11Slot> > PK11SlotList; | |
| 23 | |
| 24 class PK11Slot : public base::RefCountedThreadSafe<PK11Slot> { | |
|
wtc
2010/12/15 20:54:36
PK11Slot may not need to be ref-counted.
| |
| 25 public: | |
| 26 #if defined(USE_NSS) | |
| 27 typedef PK11SlotInfo* OSSlotHandle; | |
| 28 #else | |
| 29 typedef void* OSSlotHandle; | |
| 30 #endif | |
| 31 | |
| 32 OSSlotHandle os_slot_handle() const { return slot_handle_; } | |
| 33 | |
| 34 std::string GetTokenName() const; | |
| 35 | |
| 36 static PK11Slot* CreateFromHandle(OSSlotHandle handle); | |
| 37 | |
| 38 private: | |
| 39 friend class base::RefCountedThreadSafe<PK11Slot>; | |
| 40 | |
| 41 explicit PK11Slot(OSSlotHandle handle); | |
| 42 ~PK11Slot(); | |
| 43 | |
| 44 OSSlotHandle slot_handle_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(PK11Slot); | |
| 47 }; | |
| 48 | |
| 49 } // namespace net | |
| 50 | |
| 51 #endif // NET_BASE_PK11_SLOT_H_ | |
| OLD | NEW |