OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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.h" | 5 #include "base/message_loop.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 work_queue_.pop(); | 360 work_queue_.pop(); |
361 if (!pending_task.delayed_run_time.is_null()) { | 361 if (!pending_task.delayed_run_time.is_null()) { |
362 // We want to delete delayed tasks in the same order in which they would | 362 // We want to delete delayed tasks in the same order in which they would |
363 // normally be deleted in case of any funny dependencies between delayed | 363 // normally be deleted in case of any funny dependencies between delayed |
364 // tasks. | 364 // tasks. |
365 AddToDelayedWorkQueue(pending_task); | 365 AddToDelayedWorkQueue(pending_task); |
366 } else { | 366 } else { |
367 // TODO(darin): Delete all tasks once it is safe to do so. | 367 // TODO(darin): Delete all tasks once it is safe to do so. |
368 // Until it is totally safe, just do it when running purify. | 368 // Until it is totally safe, just do it when running purify. |
369 #ifdef PURIFY | 369 #ifdef PURIFY |
370 delete task; | 370 delete pending_task.task; |
371 #endif // PURIFY | 371 #endif // PURIFY |
372 } | 372 } |
373 } | 373 } |
374 did_work |= !deferred_non_nestable_work_queue_.empty(); | 374 did_work |= !deferred_non_nestable_work_queue_.empty(); |
375 while (!deferred_non_nestable_work_queue_.empty()) { | 375 while (!deferred_non_nestable_work_queue_.empty()) { |
376 // TODO(darin): Delete all tasks once it is safe to do so. | 376 // TODO(darin): Delete all tasks once it is safe to do so. |
377 // Until it is totaly safe, just delete them to keep purify happy. | 377 // Until it is totaly safe, just delete them to keep purify happy. |
378 #ifdef PURIFY | 378 #ifdef PURIFY |
379 Task* task = deferred_non_nestable_work_queue_.front().task; | 379 Task* task = deferred_non_nestable_work_queue_.front().task; |
380 #endif | 380 #endif |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 Watcher *delegate) { | 608 Watcher *delegate) { |
609 return pump_libevent()->WatchFileDescriptor( | 609 return pump_libevent()->WatchFileDescriptor( |
610 fd, | 610 fd, |
611 persistent, | 611 persistent, |
612 static_cast<base::MessagePumpLibevent::Mode>(mode), | 612 static_cast<base::MessagePumpLibevent::Mode>(mode), |
613 controller, | 613 controller, |
614 delegate); | 614 delegate); |
615 } | 615 } |
616 | 616 |
617 #endif | 617 #endif |
OLD | NEW |