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> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 // Called when we received a response to a http request that was served | 91 // Called when we received a response to a http request that was served |
92 // from a proxy using SPDY. | 92 // from a proxy using SPDY. |
93 void OnReceivedSpdyProxiedHttpResponse(int child_id, int route_id); | 93 void OnReceivedSpdyProxiedHttpResponse(int child_id, int route_id); |
94 | 94 |
95 // Client functions: | 95 // Client functions: |
96 | 96 |
97 // Returns true if at least one client is currently loading. | 97 // Returns true if at least one client is currently loading. |
98 bool HasLoadingClients() const; | 98 bool HasLoadingClients() const; |
99 | 99 |
100 // Update the priority for |request|. Modifies request->priority(), and may | 100 // Updates the priority for |request|. Modifies request->priority(), and may |
101 // start the request loading if it wasn't already started. | 101 // start the request loading if it wasn't already started. |
| 102 // If the scheduler does not know about the request, |new_priority| is set but |
| 103 // |intra_priority_value| is ignored. |
102 void ReprioritizeRequest(net::URLRequest* request, | 104 void ReprioritizeRequest(net::URLRequest* request, |
103 net::RequestPriority new_priority, | 105 net::RequestPriority new_priority, |
104 int intra_priority_value); | 106 int intra_priority_value); |
| 107 // Same as above, but keeps the existing intra priority value. |
| 108 void ReprioritizeRequest(net::URLRequest* request, |
| 109 net::RequestPriority new_priority); |
105 | 110 |
106 private: | 111 private: |
107 // Returns the maximum number of delayable requests to all be in-flight at | 112 // Returns the maximum number of delayable requests to all be in-flight at |
108 // any point in time (across all hosts). | 113 // any point in time (across all hosts). |
109 size_t max_num_delayable_requests() const { | 114 size_t max_num_delayable_requests() const { |
110 return max_num_delayable_requests_; | 115 return max_num_delayable_requests_; |
111 } | 116 } |
112 | 117 |
113 class RequestQueue; | 118 class RequestQueue; |
114 class ScheduledResourceRequest; | 119 class ScheduledResourceRequest; |
(...skipping 29 matching lines...) Expand all Loading... |
144 // start resource requests. | 149 // start resource requests. |
145 bool yielding_scheduler_enabled_; | 150 bool yielding_scheduler_enabled_; |
146 int max_requests_before_yielding_; | 151 int max_requests_before_yielding_; |
147 | 152 |
148 DISALLOW_COPY_AND_ASSIGN(ResourceScheduler); | 153 DISALLOW_COPY_AND_ASSIGN(ResourceScheduler); |
149 }; | 154 }; |
150 | 155 |
151 } // namespace content | 156 } // namespace content |
152 | 157 |
153 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ | 158 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ |
OLD | NEW |