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 // Updates the priority for |request|. Modifies request->priority(), and may | 100 // Update 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. | |
104 void ReprioritizeRequest(net::URLRequest* request, | 102 void ReprioritizeRequest(net::URLRequest* request, |
105 net::RequestPriority new_priority, | 103 net::RequestPriority new_priority, |
106 int intra_priority_value); | 104 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); | |
110 | 105 |
111 private: | 106 private: |
112 // Returns the maximum number of delayable requests to all be in-flight at | 107 // Returns the maximum number of delayable requests to all be in-flight at |
113 // any point in time (across all hosts). | 108 // any point in time (across all hosts). |
114 size_t max_num_delayable_requests() const { | 109 size_t max_num_delayable_requests() const { |
115 return max_num_delayable_requests_; | 110 return max_num_delayable_requests_; |
116 } | 111 } |
117 | 112 |
118 class RequestQueue; | 113 class RequestQueue; |
119 class ScheduledResourceRequest; | 114 class ScheduledResourceRequest; |
(...skipping 29 matching lines...) Expand all Loading... |
149 // start resource requests. | 144 // start resource requests. |
150 bool yielding_scheduler_enabled_; | 145 bool yielding_scheduler_enabled_; |
151 int max_requests_before_yielding_; | 146 int max_requests_before_yielding_; |
152 | 147 |
153 DISALLOW_COPY_AND_ASSIGN(ResourceScheduler); | 148 DISALLOW_COPY_AND_ASSIGN(ResourceScheduler); |
154 }; | 149 }; |
155 | 150 |
156 } // namespace content | 151 } // namespace content |
157 | 152 |
158 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ | 153 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ |
OLD | NEW |