diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-13 23:44:20 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-13 23:44:20 +0000 |
commit | 2902738f2a36d4f0ef22e25369e653f4eda2a7aa (patch) | |
tree | 582ce3d66406a222edb686625227c1eea475d285 /base/tracked_objects.cc | |
parent | 2d39894da98b2ae12b4052776c4fcf23d1bf2442 (diff) | |
download | chromium_src-2902738f2a36d4f0ef22e25369e653f4eda2a7aa.zip chromium_src-2902738f2a36d4f0ef22e25369e653f4eda2a7aa.tar.gz chromium_src-2902738f2a36d4f0ef22e25369e653f4eda2a7aa.tar.bz2 |
Revert 65996 (test breakage) - Disallow Singleton and LazyInstance on 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
Diffstat (limited to 'base/tracked_objects.cc')
-rw-r--r-- | base/tracked_objects.cc | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc index 9db25ff..4631f34 100644 --- a/base/tracked_objects.cc +++ b/base/tracked_objects.cc @@ -10,7 +10,6 @@ #include "base/message_loop.h" #include "base/string_util.h" #include "base/stringprintf.h" -#include "base/thread_restrictions.h" using base::TimeDelta; @@ -90,13 +89,7 @@ Lock ThreadData::list_lock_; // static ThreadData::Status ThreadData::status_ = ThreadData::UNINITIALIZED; -ThreadData::ThreadData() : next_(NULL) { - // This shouldn't use the MessageLoop::current() LazyInstance since this might - // be used on a non-joinable thread. - // http://crbug.com/62728 - base::ThreadRestrictions::ScopedAllowSingleton scoped_allow_singleton; - message_loop_ = MessageLoop::current(); -} +ThreadData::ThreadData() : next_(NULL), message_loop_(MessageLoop::current()) {} ThreadData::~ThreadData() {} @@ -267,14 +260,8 @@ void ThreadData::WriteHTMLTotalAndSubtotals( } Births* ThreadData::TallyABirth(const Location& location) { - { - // This shouldn't use the MessageLoop::current() LazyInstance since this - // might be used on a non-joinable thread. - // http://crbug.com/62728 - base::ThreadRestrictions::ScopedAllowSingleton scoped_allow_singleton; - if (!message_loop_) // In case message loop wasn't yet around... - message_loop_ = MessageLoop::current(); // Find it now. - } + if (!message_loop_) // In case message loop wasn't yet around... + message_loop_ = MessageLoop::current(); // Find it now. BirthMap::iterator it = birth_map_.find(location); if (it != birth_map_.end()) { @@ -292,12 +279,8 @@ Births* ThreadData::TallyABirth(const Location& location) { void ThreadData::TallyADeath(const Births& lifetimes, const TimeDelta& duration) { - { - // http://crbug.com/62728 - base::ThreadRestrictions::ScopedAllowSingleton scoped_allow_singleton; - if (!message_loop_) // In case message loop wasn't yet around... - message_loop_ = MessageLoop::current(); // Find it now. - } + if (!message_loop_) // In case message loop wasn't yet around... + message_loop_ = MessageLoop::current(); // Find it now. DeathMap::iterator it = death_map_.find(&lifetimes); if (it != death_map_.end()) { |