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

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

Issue 2785943004: DCHECK tasks posted by TaskRunner::PostTask (Closed)
Patch Set: fix Created 3 years, 8 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 | « base/deferred_sequenced_task_runner.cc ('k') | base/task_scheduler/delayed_task_manager.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 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/incoming_task_queue.h" 5 #include "base/message_loop/incoming_task_queue.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 message_loop_scheduled_(false), 56 message_loop_scheduled_(false),
57 always_schedule_work_(AlwaysNotifyPump(message_loop_->type())), 57 always_schedule_work_(AlwaysNotifyPump(message_loop_->type())),
58 is_ready_for_scheduling_(false) { 58 is_ready_for_scheduling_(false) {
59 } 59 }
60 60
61 bool IncomingTaskQueue::AddToIncomingQueue( 61 bool IncomingTaskQueue::AddToIncomingQueue(
62 const tracked_objects::Location& from_here, 62 const tracked_objects::Location& from_here,
63 Closure task, 63 Closure task,
64 TimeDelta delay, 64 TimeDelta delay,
65 bool nestable) { 65 bool nestable) {
66 DCHECK(task);
66 DLOG_IF(WARNING, 67 DLOG_IF(WARNING,
67 delay.InSeconds() > kTaskDelayWarningThresholdInSeconds) 68 delay.InSeconds() > kTaskDelayWarningThresholdInSeconds)
68 << "Requesting super-long task delay period of " << delay.InSeconds() 69 << "Requesting super-long task delay period of " << delay.InSeconds()
69 << " seconds from here: " << from_here.ToString(); 70 << " seconds from here: " << from_here.ToString();
70 71
71 PendingTask pending_task(from_here, std::move(task), 72 PendingTask pending_task(from_here, std::move(task),
72 CalculateDelayedRuntime(delay), nestable); 73 CalculateDelayedRuntime(delay), nestable);
73 #if defined(OS_WIN) 74 #if defined(OS_WIN)
74 // We consider the task needs a high resolution timer if the delay is 75 // We consider the task needs a high resolution timer if the delay is
75 // more than 0 and less than 32ms. This caps the relative error to 76 // more than 0 and less than 32ms. This caps the relative error to
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // that wants to post a task will be blocked until this thread switches back 192 // that wants to post a task will be blocked until this thread switches back
192 // in and releases |incoming_queue_lock_|. 193 // in and releases |incoming_queue_lock_|.
193 if (schedule_work) 194 if (schedule_work)
194 message_loop_->ScheduleWork(); 195 message_loop_->ScheduleWork();
195 196
196 return true; 197 return true;
197 } 198 }
198 199
199 } // namespace internal 200 } // namespace internal
200 } // namespace base 201 } // namespace base
OLDNEW
« no previous file with comments | « base/deferred_sequenced_task_runner.cc ('k') | base/task_scheduler/delayed_task_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698