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

Side by Side Diff: base/threading/worker_pool_posix.cc

Issue 1104053004: Cleanup: removing unused descendants information from tracked objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 (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/threading/worker_pool_posix.h" 5 #include "base/threading/worker_pool_posix.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 PlatformThread::SetName(name.c_str()); 80 PlatformThread::SetName(name.c_str());
81 81
82 for (;;) { 82 for (;;) {
83 PendingTask pending_task = pool_->WaitForTask(); 83 PendingTask pending_task = pool_->WaitForTask();
84 if (pending_task.task.is_null()) 84 if (pending_task.task.is_null())
85 break; 85 break;
86 TRACE_EVENT2("toplevel", "WorkerThread::ThreadMain::Run", 86 TRACE_EVENT2("toplevel", "WorkerThread::ThreadMain::Run",
87 "src_file", pending_task.posted_from.file_name(), 87 "src_file", pending_task.posted_from.file_name(),
88 "src_func", pending_task.posted_from.function_name()); 88 "src_func", pending_task.posted_from.function_name());
89 89
90 tracked_objects::ThreadData::PrepareForStartOfRun(pending_task.birth_tally);
91 tracked_objects::TaskStopwatch stopwatch; 90 tracked_objects::TaskStopwatch stopwatch;
92 stopwatch.Start(); 91 stopwatch.Start();
93 pending_task.task.Run(); 92 pending_task.task.Run();
94 stopwatch.Stop(); 93 stopwatch.Stop();
95 94
96 tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking( 95 tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking(
97 pending_task.birth_tally, pending_task.time_posted, stopwatch); 96 pending_task.birth_tally, pending_task.time_posted, stopwatch);
98 } 97 }
99 98
100 // The WorkerThread is non-joinable, so it deletes itself. 99 // The WorkerThread is non-joinable, so it deletes itself.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 return PendingTask(FROM_HERE, base::Closure()); 184 return PendingTask(FROM_HERE, base::Closure());
186 } 185 }
187 } 186 }
188 187
189 PendingTask pending_task = pending_tasks_.front(); 188 PendingTask pending_task = pending_tasks_.front();
190 pending_tasks_.pop(); 189 pending_tasks_.pop();
191 return pending_task; 190 return pending_task;
192 } 191 }
193 192
194 } // namespace base 193 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698