| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/threading/thread.h" | 5 #include "base/threading/thread.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 running_ = false; | 255 running_ = false; |
| 256 } | 256 } |
| 257 | 257 |
| 258 // Let the thread do extra cleanup. | 258 // Let the thread do extra cleanup. |
| 259 CleanUp(); | 259 CleanUp(); |
| 260 | 260 |
| 261 #if defined(OS_WIN) | 261 #if defined(OS_WIN) |
| 262 com_initializer.reset(); | 262 com_initializer.reset(); |
| 263 #endif | 263 #endif |
| 264 | 264 |
| 265 // Assert that MessageLoop::QuitWhenIdle was called by ThreadQuitHelper. | 265 if (message_loop->type() != MessageLoop::TYPE_CUSTOM) { |
| 266 DCHECK(GetThreadWasQuitProperly()); | 266 // Assert that MessageLoop::QuitWhenIdle was called by ThreadQuitHelper. |
| 267 // Don't check for custom message pumps, because their shutdown might not |
| 268 // allow this. |
| 269 DCHECK(GetThreadWasQuitProperly()); |
| 270 } |
| 267 | 271 |
| 268 // We can't receive messages anymore. | 272 // We can't receive messages anymore. |
| 269 // (The message loop is destructed at the end of this block) | 273 // (The message loop is destructed at the end of this block) |
| 270 message_loop_ = nullptr; | 274 message_loop_ = nullptr; |
| 271 } | 275 } |
| 272 | 276 |
| 273 } // namespace base | 277 } // namespace base |
| OLD | NEW |