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

Unified Diff: crypto/scoped_capi_types.h

Issue 7776025: Remove a static initializer from ScopedCAPIHandle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/scoped_capi_types.h
diff --git a/crypto/scoped_capi_types.h b/crypto/scoped_capi_types.h
index f565121059da687b3d5c3ac532435cfc9603aafd..51e2f72eb6c37f0f38e31968b4163369f9420085 100644
--- a/crypto/scoped_capi_types.h
+++ b/crypto/scoped_capi_types.h
@@ -51,12 +51,13 @@ class ScopedCAPIHandle {
explicit ScopedCAPIHandle(CAPIHandle handle = NULL) : handle_(handle) {}
~ScopedCAPIHandle() {
- free_(handle_);
+ reset();
wtc 2011/08/31 21:15:28 Just to make sure I understand this correctly: thi
}
void reset(CAPIHandle handle = NULL) {
if (handle_ != handle) {
- free_(handle_);
+ FreeProc free_proc;
+ free_proc(handle_);
handle_ = handle;
}
}
@@ -91,14 +92,10 @@ class ScopedCAPIHandle {
private:
CAPIHandle handle_;
- static const FreeProc free_;
DISALLOW_COPY_AND_ASSIGN(ScopedCAPIHandle);
};
-template<class CH, typename FP>
-const FP ScopedCAPIHandle<CH, FP>::free_ = FP();
-
template<class CH, typename FP> inline
bool operator==(CH h, const ScopedCAPIHandle<CH, FP>& b) {
return h == b.get();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698