Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/message_loop.h" | 5 #include "base/message_loop/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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 451 PendingTask pending_task = deferred_non_nestable_work_queue_.front(); | 451 PendingTask pending_task = deferred_non_nestable_work_queue_.front(); |
| 452 deferred_non_nestable_work_queue_.pop(); | 452 deferred_non_nestable_work_queue_.pop(); |
| 453 | 453 |
| 454 RunTask(pending_task); | 454 RunTask(pending_task); |
| 455 return true; | 455 return true; |
| 456 } | 456 } |
| 457 | 457 |
| 458 void MessageLoop::RunTask(const PendingTask& pending_task) { | 458 void MessageLoop::RunTask(const PendingTask& pending_task) { |
| 459 TRACE_EVENT_FLOW_END0("task", "MessageLoop::PostTask", | 459 TRACE_EVENT_FLOW_END0("task", "MessageLoop::PostTask", |
| 460 TRACE_ID_MANGLE(GetTaskTraceID(pending_task, this))); | 460 TRACE_ID_MANGLE(GetTaskTraceID(pending_task, this))); |
| 461 TRACE_EVENT2("task", "MessageLoop::RunTask", | 461 // RunTask has special memory tracing needs. The file name where the task |
| 462 "src_file", pending_task.posted_from.file_name(), | 462 // was posted is much more useful than "MessageLoop::RunTask" so we invoke |
|
nduca
2013/06/20 20:09:29
lets pull this out to another followup patch.. its
James Cook
2013/06/29 00:02:42
OK. I pulled this section out.
| |
| 463 "src_func", pending_task.posted_from.function_name()); | 463 // the tracing macros separately with different strings. |
| 464 // TODO(jamescook): Use TRACE_MEMORY2 here when it is implemented. | |
| 465 TRACE_MEMORY("task", pending_task.posted_from.file_name()); | |
| 466 INTERNAL_TRACE_EVENT_ADD_SCOPED("task", "MessageLoop::RunTask", | |
|
dsinclair
2013/06/18 15:30:15
This makes me sad. If we're going to be using it o
James Cook
2013/06/29 00:02:42
Yeah. The only reason this was here was to support
| |
| 467 "src_file", pending_task.posted_from.file_name(), | |
| 468 "src_func", pending_task.posted_from.function_name()); | |
| 464 DCHECK(nestable_tasks_allowed_); | 469 DCHECK(nestable_tasks_allowed_); |
| 465 // Execute the task and assume the worst: It is probably not reentrant. | 470 // Execute the task and assume the worst: It is probably not reentrant. |
| 466 nestable_tasks_allowed_ = false; | 471 nestable_tasks_allowed_ = false; |
| 467 | 472 |
| 468 // Before running the task, store the program counter where it was posted | 473 // Before running the task, store the program counter where it was posted |
| 469 // and deliberately alias it to ensure it is on the stack if the task | 474 // and deliberately alias it to ensure it is on the stack if the task |
| 470 // crashes. Be careful not to assume that the variable itself will have the | 475 // crashes. Be careful not to assume that the variable itself will have the |
| 471 // expected value when displayed by the optimizer in an optimized build. | 476 // expected value when displayed by the optimizer in an optimized build. |
| 472 // Look at a memory dump of the stack. | 477 // Look at a memory dump of the stack. |
| 473 const void* program_counter = | 478 const void* program_counter = |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 825 fd, | 830 fd, |
| 826 persistent, | 831 persistent, |
| 827 mode, | 832 mode, |
| 828 controller, | 833 controller, |
| 829 delegate); | 834 delegate); |
| 830 } | 835 } |
| 831 | 836 |
| 832 #endif | 837 #endif |
| 833 | 838 |
| 834 } // namespace base | 839 } // namespace base |
| OLD | NEW |