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

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

Issue 2721553004: Remove auto raw pointer deduction from non-linux specific code. (Closed)
Patch Set: rebase Created 3 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 | « ash/system/chromeos/screen_layout_observer_unittest.cc ('k') | base/time/time_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.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"
11 #include "base/threading/thread_local.h" 11 #include "base/threading/thread_local.h"
12 #include "base/trace_event/trace_event.h" 12 #include "base/trace_event/trace_event.h"
13 #include "base/tracked_objects.h" 13 #include "base/tracked_objects.h"
14 14
15 namespace base { 15 namespace base {
16 16
17 namespace { 17 namespace {
18 18
19 ThreadLocalBoolean* GetWorkerPoolRunningOnThisThread() { 19 ThreadLocalBoolean* GetWorkerPoolRunningOnThisThread() {
20 static auto thread_local_boolean = new ThreadLocalBoolean(); 20 static auto* thread_local_boolean = new ThreadLocalBoolean();
21 return thread_local_boolean; 21 return thread_local_boolean;
22 } 22 }
23 23
24 DWORD CALLBACK WorkItemCallback(void* param) { 24 DWORD CALLBACK WorkItemCallback(void* param) {
25 PendingTask* pending_task = static_cast<PendingTask*>(param); 25 PendingTask* pending_task = static_cast<PendingTask*>(param);
26 TRACE_TASK_EXECUTION("WorkerThread::ThreadMain::Run", *pending_task); 26 TRACE_TASK_EXECUTION("WorkerThread::ThreadMain::Run", *pending_task);
27 27
28 GetWorkerPoolRunningOnThisThread()->Set(true); 28 GetWorkerPoolRunningOnThisThread()->Set(true);
29 29
30 tracked_objects::TaskStopwatch stopwatch; 30 tracked_objects::TaskStopwatch stopwatch;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 PendingTask* pending_task = new PendingTask(from_here, task); 64 PendingTask* pending_task = new PendingTask(from_here, task);
65 return PostTaskInternal(pending_task, task_is_slow); 65 return PostTaskInternal(pending_task, task_is_slow);
66 } 66 }
67 67
68 // static 68 // static
69 bool WorkerPool::RunsTasksOnCurrentThread() { 69 bool WorkerPool::RunsTasksOnCurrentThread() {
70 return GetWorkerPoolRunningOnThisThread()->Get(); 70 return GetWorkerPoolRunningOnThisThread()->Get();
71 } 71 }
72 72
73 } // namespace base 73 } // namespace base
OLDNEW
« no previous file with comments | « ash/system/chromeos/screen_layout_observer_unittest.cc ('k') | base/time/time_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698