OLD | NEW |
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 #ifndef NET_BASE_PRIORITIZED_DISPATCHER_H_ | 5 #ifndef NET_BASE_PRIORITIZED_DISPATCHER_H_ |
6 #define NET_BASE_PRIORITIZED_DISPATCHER_H_ | 6 #define NET_BASE_PRIORITIZED_DISPATCHER_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 |
8 #include <vector> | 10 #include <vector> |
9 | 11 |
| 12 #include "base/macros.h" |
10 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
11 #include "net/base/priority_queue.h" | 14 #include "net/base/priority_queue.h" |
12 | 15 |
13 namespace net { | 16 namespace net { |
14 | 17 |
15 // A priority-based dispatcher of jobs. Dispatch order is by priority (highest | 18 // A priority-based dispatcher of jobs. Dispatch order is by priority (highest |
16 // first) and then FIFO. The dispatcher enforces limits on the number of running | 19 // first) and then FIFO. The dispatcher enforces limits on the number of running |
17 // jobs. It never revokes a job once started. The job must call OnJobFinished | 20 // jobs. It never revokes a job once started. The job must call OnJobFinished |
18 // once it finishes in order to dispatch further jobs. | 21 // once it finishes in order to dispatch further jobs. |
19 // | 22 // |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 std::vector<size_t> max_running_jobs_; | 132 std::vector<size_t> max_running_jobs_; |
130 // Total number of running jobs. | 133 // Total number of running jobs. |
131 size_t num_running_jobs_; | 134 size_t num_running_jobs_; |
132 | 135 |
133 DISALLOW_COPY_AND_ASSIGN(PrioritizedDispatcher); | 136 DISALLOW_COPY_AND_ASSIGN(PrioritizedDispatcher); |
134 }; | 137 }; |
135 | 138 |
136 } // namespace net | 139 } // namespace net |
137 | 140 |
138 #endif // NET_BASE_PRIORITIZED_DISPATCHER_H_ | 141 #endif // NET_BASE_PRIORITIZED_DISPATCHER_H_ |
OLD | NEW |