diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-08 09:06:51 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-08 09:06:51 +0000 |
commit | 9795ec11c994c7750a19aeab79cbf094df0d90dd (patch) | |
tree | 0fa6e92fbba024e5ad495461cfbb49527a2c600d /base/singleton.h | |
parent | 88eb0a862e97af4ec2e7c6fe1b5d32652cb8a854 (diff) | |
download | chromium_src-9795ec11c994c7750a19aeab79cbf094df0d90dd.zip chromium_src-9795ec11c994c7750a19aeab79cbf094df0d90dd.tar.gz chromium_src-9795ec11c994c7750a19aeab79cbf094df0d90dd.tar.bz2 |
Add a void* parameter to the AtExitManager callbacks.
Review URL: http://codereview.chromium.org/1805
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/singleton.h')
-rw-r--r-- | base/singleton.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/base/singleton.h b/base/singleton.h index 9c21d53..c6a1685 100644 --- a/base/singleton.h +++ b/base/singleton.h @@ -2,12 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_SINGLETON_H__ -#define BASE_SINGLETON_H__ - -#include <stdlib.h> - -#include <utility> +#ifndef BASE_SINGLETON_H_ +#define BASE_SINGLETON_H_ #include "base/at_exit.h" #include "base/atomicops.h" @@ -125,7 +121,7 @@ class Singleton { &instance_, reinterpret_cast<base::subtle::AtomicWord>(newval)); if (Traits::kRegisterAtExit) - base::AtExitManager::RegisterCallback(OnExit); + base::AtExitManager::RegisterCallback(OnExit, NULL); return newval; } @@ -159,7 +155,7 @@ class Singleton { private: // Adapter function for use with AtExit(). This should be called single // threaded, but we might as well take the precautions anyway. - static void OnExit() { + static void OnExit(void* unused) { // AtExit should only ever be register after the singleton instance was // created. We should only ever get here with a valid instance_ pointer. Traits::Delete(reinterpret_cast<Type*>( @@ -172,6 +168,4 @@ template <typename Type, typename Traits, typename DifferentiatingType> base::subtle::AtomicWord Singleton<Type, Traits, DifferentiatingType>:: instance_ = 0; - -#endif // BASE_SINGLETON_H__ - +#endif // BASE_SINGLETON_H_ |