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

Side by Side Diff: crypto/capi_util.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 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
« no previous file with comments | « content/renderer/render_widget.cc ('k') | crypto/cssm_init.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "crypto/capi_util.h" 5 #include "crypto/capi_util.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 10
11 namespace { 11 namespace {
12 12
13 class CAPIUtilSingleton { 13 class CAPIUtilSingleton {
14 public: 14 public:
15 static CAPIUtilSingleton* GetInstance() { 15 static CAPIUtilSingleton* GetInstance() {
16 return Singleton<CAPIUtilSingleton>::get(); 16 return base::Singleton<CAPIUtilSingleton>::get();
17 } 17 }
18 18
19 // Returns a lock to guard calls to CryptAcquireContext with 19 // Returns a lock to guard calls to CryptAcquireContext with
20 // CRYPT_DELETEKEYSET or CRYPT_NEWKEYSET. 20 // CRYPT_DELETEKEYSET or CRYPT_NEWKEYSET.
21 base::Lock& acquire_context_lock() { 21 base::Lock& acquire_context_lock() {
22 return acquire_context_lock_; 22 return acquire_context_lock_;
23 } 23 }
24 24
25 private: 25 private:
26 friend class Singleton<CAPIUtilSingleton>; 26 friend class base::Singleton<CAPIUtilSingleton>;
27 friend struct DefaultSingletonTraits<CAPIUtilSingleton>; 27 friend struct base::DefaultSingletonTraits<CAPIUtilSingleton>;
28 28
29 CAPIUtilSingleton() {} 29 CAPIUtilSingleton() {}
30 30
31 base::Lock acquire_context_lock_; 31 base::Lock acquire_context_lock_;
32 32
33 DISALLOW_COPY_AND_ASSIGN(CAPIUtilSingleton); 33 DISALLOW_COPY_AND_ASSIGN(CAPIUtilSingleton);
34 }; 34 };
35 35
36 } // namespace 36 } // namespace
37 37
(...skipping 10 matching lines...) Expand all
48 48
49 void* WINAPI CryptAlloc(size_t size) { 49 void* WINAPI CryptAlloc(size_t size) {
50 return malloc(size); 50 return malloc(size);
51 } 51 }
52 52
53 void WINAPI CryptFree(void* p) { 53 void WINAPI CryptFree(void* p) {
54 free(p); 54 free(p);
55 } 55 }
56 56
57 } // namespace crypto 57 } // namespace crypto
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | crypto/cssm_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698