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

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

Issue 846663002: Use ThreadData::Now() for TrackingInfo::time_posted initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary expectation Created 5 years, 11 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
« no previous file with comments | « base/message_loop/message_loop_unittest.cc ('k') | base/threading/worker_pool_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 "src_file", pending_task.posted_from.file_name(), 95 "src_file", pending_task.posted_from.file_name(),
96 "src_func", pending_task.posted_from.function_name()); 96 "src_func", pending_task.posted_from.function_name());
97 97
98 tracked_objects::ThreadData::PrepareForStartOfRun(pending_task.birth_tally); 98 tracked_objects::ThreadData::PrepareForStartOfRun(pending_task.birth_tally);
99 tracked_objects::TaskStopwatch stopwatch; 99 tracked_objects::TaskStopwatch stopwatch;
100 stopwatch.Start(); 100 stopwatch.Start();
101 pending_task.task.Run(); 101 pending_task.task.Run();
102 stopwatch.Stop(); 102 stopwatch.Stop();
103 103
104 tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking( 104 tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking(
105 pending_task.birth_tally, TrackedTime(pending_task.time_posted), 105 pending_task.birth_tally, pending_task.time_posted, stopwatch);
106 stopwatch);
107 } 106 }
108 107
109 // The WorkerThread is non-joinable, so it deletes itself. 108 // The WorkerThread is non-joinable, so it deletes itself.
110 delete this; 109 delete this;
111 } 110 }
112 111
113 } // namespace 112 } // namespace
114 113
115 // static 114 // static
116 bool WorkerPool::PostTask(const tracked_objects::Location& from_here, 115 bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 return PendingTask(FROM_HERE, base::Closure()); 193 return PendingTask(FROM_HERE, base::Closure());
195 } 194 }
196 } 195 }
197 196
198 PendingTask pending_task = pending_tasks_.front(); 197 PendingTask pending_task = pending_tasks_.front();
199 pending_tasks_.pop(); 198 pending_tasks_.pop();
200 return pending_task; 199 return pending_task;
201 } 200 }
202 201
203 } // namespace base 202 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_loop_unittest.cc ('k') | base/threading/worker_pool_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698