summaryrefslogtreecommitdiffstats
path: root/base/singleton.h
Commit message (Collapse)AuthorAgeFilesLines
* Comment out unused parameter names in function definitions,joi@chromium.org2011-02-251-1/+1
| | | | | | | | | | | | | | to adhere to the C++ Style Guide. Landing for roubert@google.com, original review http://codereview.chromium.org/6485028/ BUG=none TEST=none Review URL: http://codereview.chromium.org/6580049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76017 0039d316-1c4b-4281-b951-d872f2087c98
* Move base/thread.h to base/threading, fix up callers to use the new location.brettw@chromium.org2011-01-011-1/+1
| | | | | | | | TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6028009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70345 0039d316-1c4b-4281-b951-d872f2087c98
* Move platform_thread to base/threading and put in the base namespace. I left abrettw@chromium.org2010-12-311-2/+2
| | | | | | | | | | | stub and "using" declarations in the old location to avoid having to change the entire project at once. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6001010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70342 0039d316-1c4b-4281-b951-d872f2087c98
* Make members of Singleton<T> private and only visible to the singleton type. ↵satish@chromium.org2010-12-141-33/+34
| | | | | | | | | | | | | | | This enforces that the Singleton<T> pattern can only be used within classes which want singleton-ness. As part of this CL I have also fixed up files which got missed in my previous CLs to use a GetInstance() method and use Singleton<T> from the source file. There are a small number of places where I have also switched to LazyInstance as that was more appropriate for types used in a single source file. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5682008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69107 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 68932 - Make members of Singleton<T> private and only visible to the ↵satish@chromium.org2010-12-111-42/+32
| | | | | | | | | | | | | | | | | | singleton type. This enforces that the Singleton<T> pattern can only be used within classes which want singleton-ness. As part of this CL I have also fixed up files which got missed in my previous CLs to use a GetInstance() method and use Singleton<T> from the source file. There are a small number of places where I have also switched to LazyInstance as that was more appropriate for types used in a single source file. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5682008 TBR=satish@chromium.org Review URL: http://codereview.chromium.org/5721005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68936 0039d316-1c4b-4281-b951-d872f2087c98
* Make members of Singleton<T> private and only visible to the singleton type. ↵satish@chromium.org2010-12-111-32/+42
| | | | | | | | | | | | | | | This enforces that the Singleton<T> pattern can only be used within classes which want singleton-ness. As part of this CL I have also fixed up files which got missed in my previous CLs to use a GetInstance() method and use Singleton<T> from the source file. There are a small number of places where I have also switched to LazyInstance as that was more appropriate for types used in a single source file. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5682008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68932 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unneeded headers from base/ (part 9)thestig@chromium.org2010-11-201-0/+1
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/5091005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66873 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 66791 (change was innocent)willchan@chromium.org2010-11-191-0/+11
| | | | | | | | | | | | | | | | | | | Revert 66719 - Reland r65996. Disallows Singletons on non-joinable thread. Test breakages caused by this change have been fixed here or in other changelists. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/5024003 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5206005 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5242002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66808 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 66719 - Reland r65996. Disallows Singletons on non-joinable thread.willchan@chromium.org2010-11-191-11/+0
| | | | | | | | | | | | | | Test breakages caused by this change have been fixed here or in other changelists. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/5024003 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/5206005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66791 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r65996. Disallows Singletons on non-joinable thread.willchan@chromium.org2010-11-191-0/+11
| | | | | | | | | | | Test breakages caused by this change have been fixed here or in other changelists. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/5024003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66719 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 65996 (test breakage) - Disallow Singleton and LazyInstance on ↵willchan@chromium.org2010-11-131-11/+0
| | | | | | | | | | | | | | | | non-joinable threads. Fix all known instances or explicitly allow them. Usually the fix involves switching from Default traits to Lazy traits. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/4635012 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/4980001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66071 0039d316-1c4b-4281-b951-d872f2087c98
* Disallow Singleton and LazyInstance on non-joinable threads.willchan@chromium.org2010-11-121-0/+11
| | | | | | | | | | | Fix all known instances or explicitly allow them. Usually the fix involves switching from Default traits to Lazy traits. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/4635012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65996 0039d316-1c4b-4281-b951-d872f2087c98
* Make Singleton::OnExit explicity not-threadsafetimurrrr@chromium.org2010-11-091-3/+5
| | | | | | | | | This should help track down Singleton mis-usage, e.g. BUG=61753 TEST=trybots Review URL: http://codereview.chromium.org/4430003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65527 0039d316-1c4b-4281-b951-d872f2087c98
* Removed few unused lines.neb@chromium.org2010-11-081-1/+0
| | | | | | | | | BUG=none TEST=compiles Review URL: http://codereview.chromium.org/4572002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65403 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-261-0/+1
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Use DISALLOW_COPY_AND_ASSIGN instead of DISALLOW_EVIL_CONSTRUCTORS in app ↵tfarina@chromium.org2010-06-041-2/+2
| | | | | | | | | | | and base directories. BUG=None TEST=None Review URL: http://codereview.chromium.org/2654001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48931 0039d316-1c4b-4281-b951-d872f2087c98
* Address requests for more documentation from siggi@chromium.org2010-05-171-0/+17
| | | | | | | | | | | | http://codereview.chromium.org/2023003 and http://codereview.chromium.org/2020002 BUG=none TEST=none Review URL: http://codereview.chromium.org/2094001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47455 0039d316-1c4b-4281-b951-d872f2087c98
* Update dynamic annotations and move them to base/third_partytimurrrr@chromium.org2010-05-141-1/+1
| | | | | | Review URL: http://codereview.chromium.org/1992005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47252 0039d316-1c4b-4281-b951-d872f2087c98
* Add a StaticMemorySingletonTraits class to allow constructing singletons in ↵siggi@chromium.org2010-05-071-1/+48
| | | | | | | | | | | | | | data segment. Change logging_win to use same. BUG=none TEST=Unittests in this change. Review URL: http://codereview.chromium.org/2023003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46686 0039d316-1c4b-4281-b951-d872f2087c98
* linux: call PR_Init on UI threadevan@chromium.org2009-09-021-2/+2
| | | | | | | | | | It complains about being shutdown on the wrong thread otherwise. BUG=18410 Review URL: http://codereview.chromium.org/178062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25259 0039d316-1c4b-4281-b951-d872f2087c98
* Added dynamic annotation files into base/.deanm@chromium.org2009-06-261-1/+12
| | | | | | | | | | | | | | Added annotations for atomic reference counting, LazyInstance and Singleton classes. This changelist is a part of an effort of adding ThreadSanitizer support for Chromium. See http://code.google.com/p/data-race-test/wiki/ThreadSanitizer Patch by Timur Iskhodzhanov. Review URL: http://codereview.chromium.org/147008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19353 0039d316-1c4b-4281-b951-d872f2087c98
* Add Singleton traits for a "leaky singleton" - one that doesmbelshe@google.com2008-12-031-0/+10
| | | | | | | | not clean up at exit. Review URL: http://codereview.chromium.org/13069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6303 0039d316-1c4b-4281-b951-d872f2087c98
* Add a void* parameter to the AtExitManager callbacks.deanm@google.com2008-09-081-11/+5
| | | | | | Review URL: http://codereview.chromium.org/1805 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1835 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Add mime_util and http_chunked_decoder to mac project.ericroman@google.com2008-08-191-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1041 0039d316-1c4b-4281-b951-d872f2087c98
* Even though AtExit should never be called while an object is being accessed, ↵deanm@google.com2008-08-111-3/+2
| | | | | | it is cleaner and a bit safer to doing an AtomicExchange, so instance_ is not kept as the pointer value while we're deleting it. This also moves an unsafe direct access to the AtomicWord to calling through the atomic API. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@640 0039d316-1c4b-4281-b951-d872f2087c98
* Use 0 instead of NULL, since AtomicWord is intptr_t which is not a pointer ↵deanm@google.com2008-08-071-1/+1
| | | | | | type. GCC warns when converting NULL to a non-pointer type. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@505 0039d316-1c4b-4281-b951-d872f2087c98
* Cross platform and cleanup of Singleton classdeanm@google.com2008-08-061-124/+52
| | | | | | | | | - Move away from windows-specific atomic operations to cross platform atopmicops - Remove double new semantics on windows git-svn-id: svn://svn.chromium.org/chrome/trunk/src@424 0039d316-1c4b-4281-b951-d872f2087c98
* Adds new class AtExitManager which manages the dtors of all singletons.cpu@google.com2008-08-011-37/+18
| | | | | | | | | - Previously this job was done by the CRT's atexit() which runs later than we want and under the loader lock. - Had to modify most main() functions for the testing executables so we don't trigger leak detectors. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+293
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98