Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
nonce_generator.h
Go to the documentation of this file.
1 // Copyright 2013 Google Inc. All Rights Reserved.
14 
16 
17 #ifndef PAGESPEED_KERNEL_UTIL_NONCE_GENERATOR_H_
18 #define PAGESPEED_KERNEL_UTIL_NONCE_GENERATOR_H_
19 
23 
24 namespace net_instaweb {
25 
29  public:
30  virtual ~NonceGenerator();
32  uint64 NewNonce();
33 
34  protected:
36  explicit NonceGenerator(AbstractMutex* mutex) : mutex_(mutex) { }
37 
39  virtual uint64 NewNonceImpl() = 0;
40 
41  private:
43 
44 
45 };
46 
47 }
48 
49 #endif
uint64 NewNonce()
Generate a fresh, ideally cryptographic, nonce. Thread-safe.
Abstract interface for implementing a mutex.
Definition: abstract_mutex.h:28
Definition: scoped_ptr.h:30
virtual uint64 NewNonceImpl()=0
Subclasses must implement this method. Locking is already handled.
Definition: nonce_generator.h:28
NonceGenerator(AbstractMutex *mutex)
Takes ownership of mutex.
Definition: nonce_generator.h:36