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

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

Issue 1021053003: Delivering the FIRST_NONEMPTY_PAINT phase changing event to base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@phase_splitting
Patch Set: asvitkine@ comments. Created 5 years, 8 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 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, pending_task.time_posted, stopwatch); 105 pending_task.time_posted, stopwatch, pending_task.birth_tally);
106 } 106 }
107 107
108 // The WorkerThread is non-joinable, so it deletes itself. 108 // The WorkerThread is non-joinable, so it deletes itself.
109 delete this; 109 delete this;
110 } 110 }
111 111
112 } // namespace 112 } // namespace
113 113
114 // static 114 // static
115 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
193 return PendingTask(FROM_HERE, base::Closure()); 193 return PendingTask(FROM_HERE, base::Closure());
194 } 194 }
195 } 195 }
196 196
197 PendingTask pending_task = pending_tasks_.front(); 197 PendingTask pending_task = pending_tasks_.front();
198 pending_tasks_.pop(); 198 pending_tasks_.pop();
199 return pending_task; 199 return pending_task;
200 } 200 }
201 201
202 } // namespace base 202 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698