diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 20:40:32 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 20:40:32 +0000 |
commit | 569c7609281c7f120dc37c9ee8030d41d7d20794 (patch) | |
tree | 4f8f7a7b3ccacd1afcda0531da1cc44081745b59 /base/threading | |
parent | 641509a1cc961934f53d373e5fdd14ac79389cfa (diff) | |
download | chromium_src-569c7609281c7f120dc37c9ee8030d41d7d20794.zip chromium_src-569c7609281c7f120dc37c9ee8030d41d7d20794.tar.gz chromium_src-569c7609281c7f120dc37c9ee8030d41d7d20794.tar.bz2 |
Kill CleanUpAfterMessageLoopDestruction.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6602047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/threading')
-rw-r--r-- | base/threading/thread.cc | 1 | ||||
-rw-r--r-- | base/threading/thread.h | 1 | ||||
-rw-r--r-- | base/threading/thread_unittest.cc | 14 |
3 files changed, 4 insertions, 12 deletions
diff --git a/base/threading/thread.cc b/base/threading/thread.cc index c0fb537..7a100ca 100644 --- a/base/threading/thread.cc +++ b/base/threading/thread.cc @@ -173,7 +173,6 @@ void Thread::ThreadMain() { message_loop_ = NULL; message_loop_proxy_ = NULL; } - CleanUpAfterMessageLoopDestruction(); thread_id_ = kInvalidThreadId; } diff --git a/base/threading/thread.h b/base/threading/thread.h index 811dd80..379615d 100644 --- a/base/threading/thread.h +++ b/base/threading/thread.h @@ -25,7 +25,6 @@ namespace base { // (1) Thread::CleanUp() // (2) MessageLoop::~MessageLoop // (3.b) MessageLoop::DestructionObserver::WillDestroyCurrentMessageLoop -// (4) Thread::CleanUpAfterMessageLoopDestruction() class Thread : PlatformThread::Delegate { public: struct Options { diff --git a/base/threading/thread_unittest.cc b/base/threading/thread_unittest.cc index 3748fc3..c7cb76a 100644 --- a/base/threading/thread_unittest.cc +++ b/base/threading/thread_unittest.cc @@ -57,7 +57,7 @@ class SleepInsideInitThread : public Thread { enum ThreadEvent { // Thread::Init() was called. - THREAD_EVENT_INIT, + THREAD_EVENT_INIT = 0, // The MessageLoop for the thread was deleted. THREAD_EVENT_MESSAGE_LOOP_DESTROYED, @@ -65,8 +65,8 @@ enum ThreadEvent { // Thread::CleanUp() was called. THREAD_EVENT_CLEANUP, - // Thread::CleanUpAfterMessageLoopDestruction() was called. - THREAD_EVENT_CLEANUP_AFTER_LOOP, + // Keep at end of list. + THREAD_NUM_EVENTS }; typedef std::vector<ThreadEvent> EventList; @@ -93,10 +93,6 @@ class CaptureToEventList : public Thread { event_list_->push_back(THREAD_EVENT_CLEANUP); } - virtual void CleanUpAfterMessageLoopDestruction() { - event_list_->push_back(THREAD_EVENT_CLEANUP_AFTER_LOOP); - } - private: EventList* event_list_; }; @@ -230,7 +226,6 @@ TEST_F(ThreadTest, SleepInsideInit) { // (1) Thread::CleanUp() // (2) MessageLoop::~MessageLoop() // MessageLoop::DestructionObservers called. -// (3) Thread::CleanUpAfterMessageLoopDestruction TEST_F(ThreadTest, CleanUp) { EventList captured_events; CapturingDestructionObserver loop_destruction_observer(&captured_events); @@ -252,9 +247,8 @@ TEST_F(ThreadTest, CleanUp) { } // Check the order of events during shutdown. - ASSERT_EQ(4u, captured_events.size()); + ASSERT_EQ(static_cast<size_t>(THREAD_NUM_EVENTS), captured_events.size()); EXPECT_EQ(THREAD_EVENT_INIT, captured_events[0]); EXPECT_EQ(THREAD_EVENT_CLEANUP, captured_events[1]); EXPECT_EQ(THREAD_EVENT_MESSAGE_LOOP_DESTROYED, captured_events[2]); - EXPECT_EQ(THREAD_EVENT_CLEANUP_AFTER_LOOP, captured_events[3]); } |