Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Side by Side Diff: base/message_loop/message_loop.cc

Issue 1559353002: base: Fix DCHECK when thread creation fails (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698