summaryrefslogtreecommitdiffstats
path: root/base/lazy_instance.h
Commit message (Collapse)AuthorAgeFilesLines
* Isolate tests by running AtExit callbacks between them.phajdan.jr@chromium.org2009-11-191-0/+4
| | | | | | | | | | | | | | | | | | | | For now, this is only for base_unittests. The plan is to enable it for all unit tests. This should finally fix mysterious problems cause by Singletons surviving after one test etc. This change also adapts LazyInstance so that it can be reused after being destroyed. It is used very frequently, for example each time a MessageLoop is used. It is also worth noting that we had some problems in the past related to the MessageLoop being destroyed and re-instantiated in the same test executable. This patch should also fix that. TEST=none BUG=12710 Review URL: http://codereview.chromium.org/372057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32507 0039d316-1c4b-4281-b951-d872f2087c98
* Added dynamic annotation files into base/.deanm@chromium.org2009-06-261-0/+9
| | | | | | | | | | | | | | 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
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-1/+1
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a typo in a comment.deanm@chromium.org2009-01-131-1/+1
| | | | | | | Review URL: http://codereview.chromium.org/17630 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7923 0039d316-1c4b-4281-b951-d872f2087c98
* Just by implementing a destructor (even if it's not doing anything), MSVC ↵deanm@google.com2008-09-081-2/+4
| | | | | | | | will register a static initializer as to register the empty destructor. Pretty awesome. Verified that the c++ initializer is no longer in the __xc_a array. Review URL: http://codereview.chromium.org/1812 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1841 0039d316-1c4b-4281-b951-d872f2087c98
* Add a DISALLOW_COPY_AND_ASSIGN to LazyInstanceHelper.deanm@google.com2008-09-081-0/+3
| | | | | | Review URL: http://codereview.chromium.org/1811 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1839 0039d316-1c4b-4281-b951-d872f2087c98
* Create a LazyInstance abstraction for avoiding static constructors by lazily ↵deanm@google.com2008-09-081-0/+105
creating an instance of an object on first access. This is like Singleton, but without the Singleton property of sharing instances. This also preallocates space for the object to avoid the heap to try to help fragmentation and creation performance. Review URL: http://codereview.chromium.org/1608 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1837 0039d316-1c4b-4281-b951-d872f2087c98