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

Side by Side Diff: base/task_scheduler/task_tracker.cc

Issue 2215193003: DO NOT COMMIT -- Very confusing patch... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b1_dcheckfailedcatch
Patch Set: rebase Created 4 years, 4 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 | base/task_scheduler/task_tracker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/task_scheduler/task_tracker.h" 5 #include "base/task_scheduler/task_tracker.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/atomicops.h" 9 #include "base/atomicops.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 const Task* task = sequence->PeekTask(); 185 const Task* task = sequence->PeekTask();
186 186
187 const TaskShutdownBehavior shutdown_behavior = 187 const TaskShutdownBehavior shutdown_behavior =
188 task->traits.shutdown_behavior(); 188 task->traits.shutdown_behavior();
189 if (!BeforeRunTask(shutdown_behavior)) 189 if (!BeforeRunTask(shutdown_behavior))
190 return; 190 return;
191 191
192 // All tasks run through here and the scheduler itself doesn't use singletons. 192 // All tasks run through here and the scheduler itself doesn't use singletons.
193 // Therefore, it isn't necessary to reset the singleton allowed bit after 193 // Therefore, it isn't necessary to reset the singleton allowed bit after
194 // running the task. 194 // running the task.
195 ThreadRestrictions::SetSingletonAllowed( 195 ThreadRestrictions::SetIOAllowed(
196 task->traits.shutdown_behavior() != 196 task->traits.shutdown_behavior() !=
197 TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN); 197 TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN);
198 198
199 { 199 {
200 // Set up SequenceToken as expected for the scope of the task. 200 // Set up SequenceToken as expected for the scope of the task.
201 ScopedSetSequenceTokenForCurrentThread 201 ScopedSetSequenceTokenForCurrentThread
202 scoped_set_sequence_token_for_current_thread(sequence->token()); 202 scoped_set_sequence_token_for_current_thread(sequence->token());
203 203
204 // Set up TaskRunnerHandle as expected for the scope of the task. 204 // Set up TaskRunnerHandle as expected for the scope of the task.
205 std::unique_ptr<SequencedTaskRunnerHandle> sequenced_task_runner_handle; 205 std::unique_ptr<SequencedTaskRunnerHandle> sequenced_task_runner_handle;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 // This method can only be called after shutdown has started. 331 // This method can only be called after shutdown has started.
332 DCHECK(state_->HasShutdownStarted()); 332 DCHECK(state_->HasShutdownStarted());
333 DCHECK(shutdown_event_); 333 DCHECK(shutdown_event_);
334 334
335 shutdown_event_->Signal(); 335 shutdown_event_->Signal();
336 } 336 }
337 337
338 } // namespace internal 338 } // namespace internal
339 } // namespace base 339 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/task_scheduler/task_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698