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

Side by Side Diff: cc/test/ordered_simple_task_runner.h

Issue 2296923003: Make TestSimpleTaskRunner thread-safe. (Closed)
Patch Set: fix asan error Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 5 #ifndef CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_
6 #define CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 6 #define CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <limits> 10 #include <limits>
11 #include <memory> 11 #include <memory>
12 #include <set> 12 #include <set>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/test/simple_test_tick_clock.h" 18 #include "base/test/simple_test_tick_clock.h"
19 #include "base/test/test_simple_task_runner.h" 19 #include "base/test/test_simple_task_runner.h"
20 #include "base/threading/thread_checker.h"
20 #include "base/trace_event/trace_event.h" 21 #include "base/trace_event/trace_event.h"
21 22
22 namespace cc { 23 namespace cc {
23 24
24 // Subclass of TestPendingTask which has a unique ID for every task, supports 25 // Subclass of TestPendingTask which has a unique ID for every task, supports
25 // being used inside a std::set and has debug tracing support. 26 // being used inside a std::set and has debug tracing support.
26 class TestOrderablePendingTask : public base::TestPendingTask { 27 class TestOrderablePendingTask : public base::TestPendingTask {
27 public: 28 public:
28 TestOrderablePendingTask(); 29 TestOrderablePendingTask();
29 TestOrderablePendingTask(const tracked_objects::Location& location, 30 TestOrderablePendingTask(const tracked_objects::Location& location,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 bool inside_run_tasks_until_; 150 bool inside_run_tasks_until_;
150 std::set<TestOrderablePendingTask> pending_tasks_; 151 std::set<TestOrderablePendingTask> pending_tasks_;
151 152
152 private: 153 private:
153 DISALLOW_COPY_AND_ASSIGN(OrderedSimpleTaskRunner); 154 DISALLOW_COPY_AND_ASSIGN(OrderedSimpleTaskRunner);
154 }; 155 };
155 156
156 } // namespace cc 157 } // namespace cc
157 158
158 #endif // CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_ 159 #endif // CC_TEST_ORDERED_SIMPLE_TASK_RUNNER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698