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

Side by Side Diff: base/threading/worker_pool_win.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: Created 5 years, 9 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/threading/worker_pool_posix.cc ('k') | base/tracked_objects.h » ('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.h" 5 #include "base/threading/worker_pool.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/logging.h" 9 #include "base/logging.h"
10 #include "base/pending_task.h" 10 #include "base/pending_task.h"
(...skipping 19 matching lines...) Expand all
30 g_worker_pool_running_on_this_thread.Get().Set(true); 30 g_worker_pool_running_on_this_thread.Get().Set(true);
31 31
32 tracked_objects::TaskStopwatch stopwatch; 32 tracked_objects::TaskStopwatch stopwatch;
33 stopwatch.Start(); 33 stopwatch.Start();
34 pending_task->task.Run(); 34 pending_task->task.Run();
35 stopwatch.Stop(); 35 stopwatch.Stop();
36 36
37 g_worker_pool_running_on_this_thread.Get().Set(false); 37 g_worker_pool_running_on_this_thread.Get().Set(false);
38 38
39 tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking( 39 tracked_objects::ThreadData::TallyRunOnWorkerThreadIfTracking(
40 pending_task->birth_tally, pending_task->time_posted, stopwatch); 40 pending_task->time_posted, stopwatch, pending_task->birth_tally);
41 41
42 delete pending_task; 42 delete pending_task;
43 return 0; 43 return 0;
44 } 44 }
45 45
46 // Takes ownership of |pending_task| 46 // Takes ownership of |pending_task|
47 bool PostTaskInternal(PendingTask* pending_task, bool task_is_slow) { 47 bool PostTaskInternal(PendingTask* pending_task, bool task_is_slow) {
48 ULONG flags = 0; 48 ULONG flags = 0;
49 if (task_is_slow) 49 if (task_is_slow)
50 flags |= WT_EXECUTELONGFUNCTION; 50 flags |= WT_EXECUTELONGFUNCTION;
(...skipping 15 matching lines...) Expand all
66 PendingTask* pending_task = new PendingTask(from_here, task); 66 PendingTask* pending_task = new PendingTask(from_here, task);
67 return PostTaskInternal(pending_task, task_is_slow); 67 return PostTaskInternal(pending_task, task_is_slow);
68 } 68 }
69 69
70 // static 70 // static
71 bool WorkerPool::RunsTasksOnCurrentThread() { 71 bool WorkerPool::RunsTasksOnCurrentThread() {
72 return g_worker_pool_running_on_this_thread.Get().Get(); 72 return g_worker_pool_running_on_this_thread.Get().Get();
73 } 73 }
74 74
75 } // namespace base 75 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/worker_pool_posix.cc ('k') | base/tracked_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698