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 CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ |
6 #define CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include <map> | 11 #include <map> |
9 #include <set> | 12 #include <set> |
10 | 13 |
11 #include "base/basictypes.h" | |
12 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
14 #include "base/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
15 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
16 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
17 #include "net/base/priority_queue.h" | 20 #include "net/base/priority_queue.h" |
18 #include "net/base/request_priority.h" | 21 #include "net/base/request_priority.h" |
19 | 22 |
20 namespace net { | 23 namespace net { |
21 class HostPortPair; | 24 class HostPortPair; |
22 class URLRequest; | 25 class URLRequest; |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 214 |
212 class RequestQueue; | 215 class RequestQueue; |
213 class ScheduledResourceRequest; | 216 class ScheduledResourceRequest; |
214 struct RequestPriorityParams; | 217 struct RequestPriorityParams; |
215 struct ScheduledResourceSorter { | 218 struct ScheduledResourceSorter { |
216 bool operator()(const ScheduledResourceRequest* a, | 219 bool operator()(const ScheduledResourceRequest* a, |
217 const ScheduledResourceRequest* b) const; | 220 const ScheduledResourceRequest* b) const; |
218 }; | 221 }; |
219 class Client; | 222 class Client; |
220 | 223 |
221 typedef int64 ClientId; | 224 typedef int64_t ClientId; |
222 typedef std::map<ClientId, Client*> ClientMap; | 225 typedef std::map<ClientId, Client*> ClientMap; |
223 typedef std::set<ScheduledResourceRequest*> RequestSet; | 226 typedef std::set<ScheduledResourceRequest*> RequestSet; |
224 | 227 |
225 // Called when a ScheduledResourceRequest is destroyed. | 228 // Called when a ScheduledResourceRequest is destroyed. |
226 void RemoveRequest(ScheduledResourceRequest* request); | 229 void RemoveRequest(ScheduledResourceRequest* request); |
227 | 230 |
228 // These calls may update the ThrottleState of all clients, and have the | 231 // These calls may update the ThrottleState of all clients, and have the |
229 // potential to be re-entrant. | 232 // potential to be re-entrant. |
230 // Called when a Client newly becomes active loading. | 233 // Called when a Client newly becomes active loading. |
231 void IncrementActiveClientsLoading(); | 234 void IncrementActiveClientsLoading(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // This is a repeating timer to initiate requests on COALESCED Clients. | 274 // This is a repeating timer to initiate requests on COALESCED Clients. |
272 scoped_ptr<base::Timer> coalescing_timer_; | 275 scoped_ptr<base::Timer> coalescing_timer_; |
273 RequestSet unowned_requests_; | 276 RequestSet unowned_requests_; |
274 | 277 |
275 DISALLOW_COPY_AND_ASSIGN(ResourceScheduler); | 278 DISALLOW_COPY_AND_ASSIGN(ResourceScheduler); |
276 }; | 279 }; |
277 | 280 |
278 } // namespace content | 281 } // namespace content |
279 | 282 |
280 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ | 283 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ |
OLD | NEW |