Commit beed41d8 authored by miu's avatar miu Committed by Commit bot

Increase warning threshold for "super long" delayed tasks.

To reduce debug logging spam, this increases the warning threshold for
posting "super long" delayed tasks to 14 days (was ~18 minutes before).
Also, make the logging message more readable by printing values in terms
of seconds rather than microseconds.

BUG=450045

Review URL: https://codereview.chromium.org/897173004

Cr-Commit-Position: refs/heads/master@{#314778}
parent 6e88a1fd
...@@ -17,11 +17,12 @@ namespace internal { ...@@ -17,11 +17,12 @@ namespace internal {
namespace { namespace {
// Delays larger than this many microseconds are often bogus, and a warning #ifndef NDEBUG
// should be emitted in debug builds to warn developers. // Delays larger than this are often bogus, and a warning should be emitted in
// http://crbug.com/450045 // debug builds to warn developers. http://crbug.com/450045
const int kTaskDelayWarningThresholdInMicroseconds = const int kTaskDelayWarningThresholdInSeconds =
std::numeric_limits<int>::max() / 2; // A little less than 18 minutes. 14 * 24 * 60 * 60; // 14 days.
#endif
// Returns true if MessagePump::ScheduleWork() must be called one // Returns true if MessagePump::ScheduleWork() must be called one
// time for every task that is added to the MessageLoop incoming queue. // time for every task that is added to the MessageLoop incoming queue.
...@@ -52,9 +53,9 @@ bool IncomingTaskQueue::AddToIncomingQueue( ...@@ -52,9 +53,9 @@ bool IncomingTaskQueue::AddToIncomingQueue(
TimeDelta delay, TimeDelta delay,
bool nestable) { bool nestable) {
DLOG_IF(WARNING, DLOG_IF(WARNING,
delay.InMicroseconds() > kTaskDelayWarningThresholdInMicroseconds) delay.InSeconds() > kTaskDelayWarningThresholdInSeconds)
<< "Requesting super-long task delay period of " << delay.InMicroseconds() << "Requesting super-long task delay period of " << delay.InSeconds()
<< " usec from here: " << from_here.ToString(); << " seconds from here: " << from_here.ToString();
AutoLock locked(incoming_queue_lock_); AutoLock locked(incoming_queue_lock_);
PendingTask pending_task( PendingTask pending_task(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment