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

Side by Side Diff: content/child/scheduler/task_queue_manager.h

Issue 1025323003: Introduce a SchedulerHelper in content/child/scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
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 CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 5 #ifndef CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 6 #define CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
7 7
8 #include "base/atomic_sequence_num.h" 8 #include "base/atomic_sequence_num.h"
9 #include "base/debug/task_annotator.h" 9 #include "base/debug/task_annotator.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // Tasks posted to an incoming queue with a MANUAL will not be 62 // Tasks posted to an incoming queue with a MANUAL will not be
63 // automatically scheduled for execution or transferred to the work queue. 63 // automatically scheduled for execution or transferred to the work queue.
64 // Instead, the selector should call PumpQueue() when necessary to bring 64 // Instead, the selector should call PumpQueue() when necessary to bring
65 // in new tasks for execution. 65 // in new tasks for execution.
66 MANUAL 66 MANUAL
67 }; 67 };
68 68
69 // Create a task queue manager with |task_queue_count| task queues. 69 // Create a task queue manager with |task_queue_count| task queues.
70 // |main_task_runner| identifies the thread on which where the tasks are 70 // |main_task_runner| identifies the thread on which where the tasks are
71 // eventually run. |selector| is used to choose which task queue to service. 71 // eventually run. |selector| is used to choose which task queue to service.
72 // It should outlive this class. 72 // It should outlive this class. Category strings must have application
73 // lifetime (statics or literals). They may not include " chars.
73 TaskQueueManager( 74 TaskQueueManager(
74 size_t task_queue_count, 75 size_t task_queue_count,
75 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner, 76 scoped_refptr<NestableSingleThreadTaskRunner> main_task_runner,
76 TaskQueueSelector* selector); 77 TaskQueueSelector* selector,
78 const char* disabled_by_default_tracing_category);
77 ~TaskQueueManager(); 79 ~TaskQueueManager();
78 80
79 // Returns the task runner which targets the queue selected by |queue_index|. 81 // Returns the task runner which targets the queue selected by |queue_index|.
80 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForQueue( 82 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForQueue(
81 size_t queue_index) const; 83 size_t queue_index) const;
82 84
83 // Sets the pump policy for the |queue_index| to |pump_policy|. By 85 // Sets the pump policy for the |queue_index| to |pump_policy|. By
84 // default queues are created with AUTO_PUMP_POLICY. 86 // default queues are created with AUTO_PUMP_POLICY.
85 void SetPumpPolicy(size_t queue_index, PumpPolicy pump_policy); 87 void SetPumpPolicy(size_t queue_index, PumpPolicy pump_policy);
86 88
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // The pending_dowork_count_ is only tracked on the main thread since that's 189 // The pending_dowork_count_ is only tracked on the main thread since that's
188 // where re-entrant problems happen. 190 // where re-entrant problems happen.
189 int pending_dowork_count_; 191 int pending_dowork_count_;
190 192
191 int work_batch_size_; 193 int work_batch_size_;
192 194
193 scoped_refptr<cc::TestNowSource> time_source_; 195 scoped_refptr<cc::TestNowSource> time_source_;
194 196
195 ObserverList<base::MessageLoop::TaskObserver> task_observers_; 197 ObserverList<base::MessageLoop::TaskObserver> task_observers_;
196 198
199 const char* disabled_by_default_tracing_category_;
200
197 base::WeakPtrFactory<TaskQueueManager> weak_factory_; 201 base::WeakPtrFactory<TaskQueueManager> weak_factory_;
198 202
199 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager); 203 DISALLOW_COPY_AND_ASSIGN(TaskQueueManager);
200 }; 204 };
201 205
202 } // namespace content 206 } // namespace content
203 207
204 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_ 208 #endif // CONTENT_RENDERER_SCHEDULER_TASK_QUEUE_MANAGER_H_
OLDNEW
« no previous file with comments | « content/child/scheduler/single_thread_idle_task_runner.cc ('k') | content/child/scheduler/task_queue_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698