OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 return false; | 425 return false; |
426 | 426 |
427 PendingTask pending_task = deferred_non_nestable_work_queue_.front(); | 427 PendingTask pending_task = deferred_non_nestable_work_queue_.front(); |
428 deferred_non_nestable_work_queue_.pop(); | 428 deferred_non_nestable_work_queue_.pop(); |
429 | 429 |
430 RunTask(pending_task); | 430 RunTask(pending_task); |
431 return true; | 431 return true; |
432 } | 432 } |
433 | 433 |
434 void MessageLoop::RunTask(const PendingTask& pending_task) { | 434 void MessageLoop::RunTask(const PendingTask& pending_task) { |
435 UNSHIPPED_TRACE_EVENT2("task", "MessageLoop::RunTask", | 435 TRACE_EVENT2("task", "MessageLoop::RunTask", |
436 "src_file", pending_task.posted_from.file_name(), | 436 "src_file", pending_task.posted_from.file_name(), |
437 "src_func", pending_task.posted_from.function_name()); | 437 "src_func", pending_task.posted_from.function_name()); |
438 DCHECK(nestable_tasks_allowed_); | 438 DCHECK(nestable_tasks_allowed_); |
439 // Execute the task and assume the worst: It is probably not reentrant. | 439 // Execute the task and assume the worst: It is probably not reentrant. |
440 nestable_tasks_allowed_ = false; | 440 nestable_tasks_allowed_ = false; |
441 | 441 |
442 // Before running the task, store the program counter where it was posted | 442 // Before running the task, store the program counter where it was posted |
443 // and deliberately alias it to ensure it is on the stack if the task | 443 // and deliberately alias it to ensure it is on the stack if the task |
444 // crashes. Be careful not to assume that the variable itself will have the | 444 // crashes. Be careful not to assume that the variable itself will have the |
445 // expected value when displayed by the optimizer in an optimized build. | 445 // expected value when displayed by the optimizer in an optimized build. |
446 // Look at a memory dump of the stack. | 446 // Look at a memory dump of the stack. |
447 const void* program_counter = | 447 const void* program_counter = |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 Watcher *delegate) { | 807 Watcher *delegate) { |
808 return pump_libevent()->WatchFileDescriptor( | 808 return pump_libevent()->WatchFileDescriptor( |
809 fd, | 809 fd, |
810 persistent, | 810 persistent, |
811 static_cast<base::MessagePumpLibevent::Mode>(mode), | 811 static_cast<base::MessagePumpLibevent::Mode>(mode), |
812 controller, | 812 controller, |
813 delegate); | 813 delegate); |
814 } | 814 } |
815 | 815 |
816 #endif | 816 #endif |
OLD | NEW |