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

Side by Side Diff: cc/raster/single_thread_task_graph_runner.h

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 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
« no previous file with comments | « cc/raster/scoped_gpu_raster_unittest.cc ('k') | cc/raster/staging_buffer_pool.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CC_RASTER_SINGLE_THREAD_TASK_GRAPH_RUNNER_H_ 5 #ifndef CC_RASTER_SINGLE_THREAD_TASK_GRAPH_RUNNER_H_
6 #define CC_RASTER_SINGLE_THREAD_TASK_GRAPH_RUNNER_H_ 6 #define CC_RASTER_SINGLE_THREAD_TASK_GRAPH_RUNNER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include <memory>
9
9 #include "base/synchronization/condition_variable.h" 10 #include "base/synchronization/condition_variable.h"
10 #include "base/threading/simple_thread.h" 11 #include "base/threading/simple_thread.h"
11 #include "cc/raster/task_graph_runner.h" 12 #include "cc/raster/task_graph_runner.h"
12 #include "cc/raster/task_graph_work_queue.h" 13 #include "cc/raster/task_graph_work_queue.h"
13 14
14 namespace base { 15 namespace base {
15 class SimpleThread; 16 class SimpleThread;
16 } 17 }
17 18
18 namespace cc { 19 namespace cc {
(...skipping 17 matching lines...) Expand all
36 void Run() override; 37 void Run() override;
37 38
38 void Start(const std::string& thread_name, 39 void Start(const std::string& thread_name,
39 const base::SimpleThread::Options& thread_options); 40 const base::SimpleThread::Options& thread_options);
40 void Shutdown(); 41 void Shutdown();
41 42
42 private: 43 private:
43 // Returns true if there was a task to run. 44 // Returns true if there was a task to run.
44 bool RunTaskWithLockAcquired(); 45 bool RunTaskWithLockAcquired();
45 46
46 scoped_ptr<base::SimpleThread> thread_; 47 std::unique_ptr<base::SimpleThread> thread_;
47 48
48 // Lock to exclusively access all the following members that are used to 49 // Lock to exclusively access all the following members that are used to
49 // implement the TaskRunner interfaces. 50 // implement the TaskRunner interfaces.
50 base::Lock lock_; 51 base::Lock lock_;
51 52
52 // Stores the actual tasks to be run by this runner, sorted by priority. 53 // Stores the actual tasks to be run by this runner, sorted by priority.
53 TaskGraphWorkQueue work_queue_; 54 TaskGraphWorkQueue work_queue_;
54 55
55 // Condition variable that is waited on by Run() until new tasks are ready to 56 // Condition variable that is waited on by Run() until new tasks are ready to
56 // run or shutdown starts. 57 // run or shutdown starts.
57 base::ConditionVariable has_ready_to_run_tasks_cv_; 58 base::ConditionVariable has_ready_to_run_tasks_cv_;
58 59
59 // Condition variable that is waited on by origin threads until a namespace 60 // Condition variable that is waited on by origin threads until a namespace
60 // has finished running all associated tasks. 61 // has finished running all associated tasks.
61 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_; 62 base::ConditionVariable has_namespaces_with_finished_running_tasks_cv_;
62 63
63 // Set during shutdown. Tells Run() to return when no more tasks are pending. 64 // Set during shutdown. Tells Run() to return when no more tasks are pending.
64 bool shutdown_; 65 bool shutdown_;
65 }; 66 };
66 67
67 } // namespace cc 68 } // namespace cc
68 69
69 #endif // CC_RASTER_SINGLE_THREAD_TASK_GRAPH_RUNNER_H_ 70 #endif // CC_RASTER_SINGLE_THREAD_TASK_GRAPH_RUNNER_H_
OLDNEW
« no previous file with comments | « cc/raster/scoped_gpu_raster_unittest.cc ('k') | cc/raster/staging_buffer_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698