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

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

Issue 148613014: CC: Add 'cc-benchmark' traces for minimal tracing in benchmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minimum overhead toplevel tracing. Created 6 years, 10 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
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 "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if (!message_loop_) { 123 if (!message_loop_) {
124 pending_task->task.Reset(); 124 pending_task->task.Reset();
125 return false; 125 return false;
126 } 126 }
127 127
128 // Initialize the sequence number. The sequence number is used for delayed 128 // Initialize the sequence number. The sequence number is used for delayed
129 // tasks (to faciliate FIFO sorting when two tasks have the same 129 // tasks (to faciliate FIFO sorting when two tasks have the same
130 // delayed_run_time value) and for identifying the task in about:tracing. 130 // delayed_run_time value) and for identifying the task in about:tracing.
131 pending_task->sequence_num = next_sequence_num_++; 131 pending_task->sequence_num = next_sequence_num_++;
132 132
133 TRACE_EVENT_FLOW_BEGIN0(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"), 133 TRACE_EVENT_FLOW_BEGIN0(TRACE_DISABLED_BY_DEFAULT("task.flow"),
134 "MessageLoop::PostTask", 134 "MessageLoop::PostTask",
135 TRACE_ID_MANGLE(message_loop_->GetTaskTraceID(*pending_task))); 135 TRACE_ID_MANGLE(message_loop_->GetTaskTraceID(*pending_task)));
136 136
137 bool was_empty = incoming_queue_.empty(); 137 bool was_empty = incoming_queue_.empty();
138 incoming_queue_.push(*pending_task); 138 incoming_queue_.push(*pending_task);
139 pending_task->task.Reset(); 139 pending_task->task.Reset();
140 140
141 // Wake up the pump. 141 // Wake up the pump.
142 message_loop_->ScheduleWork(was_empty); 142 message_loop_->ScheduleWork(was_empty);
143 143
144 return true; 144 return true;
145 } 145 }
146 146
147 } // namespace internal 147 } // namespace internal
148 } // namespace base 148 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698