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

Side by Side Diff: base/task_scheduler/task_scheduler_impl.h

Issue 2420973002: Plumb Task Scheduler Histograms to the Task Scheduler Internals Page (Closed)
Patch Set: The Return of std::move Created 4 years, 2 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/task_scheduler/task_scheduler.h ('k') | base/task_scheduler/task_scheduler_impl.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ 5 #ifndef BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ 6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string>
12 #include <vector> 11 #include <vector>
13 12
14 #include "base/base_export.h" 13 #include "base/base_export.h"
15 #include "base/callback.h" 14 #include "base/callback.h"
16 #include "base/logging.h" 15 #include "base/logging.h"
17 #include "base/macros.h" 16 #include "base/macros.h"
18 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
19 #include "base/synchronization/atomic_flag.h" 18 #include "base/synchronization/atomic_flag.h"
20 #include "base/task_runner.h" 19 #include "base/task_runner.h"
21 #include "base/task_scheduler/delayed_task_manager.h" 20 #include "base/task_scheduler/delayed_task_manager.h"
22 #include "base/task_scheduler/scheduler_worker_pool_impl.h" 21 #include "base/task_scheduler/scheduler_worker_pool_impl.h"
23 #include "base/task_scheduler/sequence.h" 22 #include "base/task_scheduler/sequence.h"
24 #include "base/task_scheduler/task_scheduler.h" 23 #include "base/task_scheduler/task_scheduler.h"
25 #include "base/task_scheduler/task_tracker.h" 24 #include "base/task_scheduler/task_tracker.h"
26 #include "base/task_scheduler/task_traits.h" 25 #include "base/task_scheduler/task_traits.h"
27 #include "base/threading/thread.h" 26 #include "base/threading/thread.h"
28 27
29 namespace base { 28 namespace base {
30 29
30 class HistogramBase;
31 class SchedulerWorkerPoolParams; 31 class SchedulerWorkerPoolParams;
32 32
33 namespace internal { 33 namespace internal {
34 34
35 class SchedulerServiceThread; 35 class SchedulerServiceThread;
36 36
37 // Default TaskScheduler implementation. This class is thread-safe. 37 // Default TaskScheduler implementation. This class is thread-safe.
38 class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler { 38 class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler {
39 public: 39 public:
40 // Creates and returns an initialized TaskSchedulerImpl. CHECKs on failure. 40 // Creates and returns an initialized TaskSchedulerImpl. CHECKs on failure.
(...skipping 10 matching lines...) Expand all
51 // returned. 51 // returned.
52 ~TaskSchedulerImpl() override; 52 ~TaskSchedulerImpl() override;
53 53
54 // TaskScheduler: 54 // TaskScheduler:
55 void PostTaskWithTraits(const tracked_objects::Location& from_here, 55 void PostTaskWithTraits(const tracked_objects::Location& from_here,
56 const TaskTraits& traits, 56 const TaskTraits& traits,
57 const Closure& task) override; 57 const Closure& task) override;
58 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( 58 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits(
59 const TaskTraits& traits, 59 const TaskTraits& traits,
60 ExecutionMode execution_mode) override; 60 ExecutionMode execution_mode) override;
61 std::vector<const HistogramBase*> GetHistograms() const override;
61 void Shutdown() override; 62 void Shutdown() override;
62 void FlushForTesting() override; 63 void FlushForTesting() override;
63 64
64 // Joins all threads of this scheduler. Tasks that are already running are 65 // Joins all threads of this scheduler. Tasks that are already running are
65 // allowed to complete their execution. This can only be called once. 66 // allowed to complete their execution. This can only be called once.
66 void JoinForTesting(); 67 void JoinForTesting();
67 68
68 private: 69 private:
69 explicit TaskSchedulerImpl(const WorkerPoolIndexForTraitsCallback& 70 explicit TaskSchedulerImpl(const WorkerPoolIndexForTraitsCallback&
70 worker_pool_index_for_traits_callback); 71 worker_pool_index_for_traits_callback);
(...skipping 19 matching lines...) Expand all
90 AtomicFlag join_for_testing_returned_; 91 AtomicFlag join_for_testing_returned_;
91 #endif 92 #endif
92 93
93 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); 94 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl);
94 }; 95 };
95 96
96 } // namespace internal 97 } // namespace internal
97 } // namespace base 98 } // namespace base
98 99
99 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ 100 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « base/task_scheduler/task_scheduler.h ('k') | base/task_scheduler/task_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698