Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 } | 128 } |
| 129 | 129 |
| 130 MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump) | 130 MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump) |
| 131 : MessageLoop(TYPE_CUSTOM, Bind(&ReturnPump, Passed(&pump))) { | 131 : MessageLoop(TYPE_CUSTOM, Bind(&ReturnPump, Passed(&pump))) { |
| 132 BindToCurrentThread(); | 132 BindToCurrentThread(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 MessageLoop::~MessageLoop() { | 135 MessageLoop::~MessageLoop() { |
| 136 // current() could be NULL if this message loop is destructed before it is | 136 // current() could be NULL if this message loop is destructed before it is |
| 137 // bound to a thread. | 137 // bound to a thread. |
| 138 DCHECK(current() == this || !current()); | 138 DCHECK(current() == this || !pump_); |
|
danakj
2016/01/05 19:40:15
This no longer captures that current() is either |
Sami
2016/01/06 10:56:19
You're right, I just noticed the same thing while
| |
| 139 | 139 |
| 140 // iOS just attaches to the loop, it doesn't Run it. | 140 // iOS just attaches to the loop, it doesn't Run it. |
| 141 // TODO(stuartmorgan): Consider wiring up a Detach(). | 141 // TODO(stuartmorgan): Consider wiring up a Detach(). |
| 142 #if !defined(OS_IOS) | 142 #if !defined(OS_IOS) |
| 143 DCHECK(!run_loop_); | 143 DCHECK(!run_loop_); |
| 144 #endif | 144 #endif |
| 145 | 145 |
| 146 #if defined(OS_WIN) | 146 #if defined(OS_WIN) |
| 147 if (in_high_res_mode_) | 147 if (in_high_res_mode_) |
| 148 Time::ActivateHighResolutionTimer(false); | 148 Time::ActivateHighResolutionTimer(false); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 754 persistent, | 754 persistent, |
| 755 mode, | 755 mode, |
| 756 controller, | 756 controller, |
| 757 delegate); | 757 delegate); |
| 758 } | 758 } |
| 759 #endif | 759 #endif |
| 760 | 760 |
| 761 #endif // !defined(OS_NACL_SFI) | 761 #endif // !defined(OS_NACL_SFI) |
| 762 | 762 |
| 763 } // namespace base | 763 } // namespace base |
| OLD | NEW |