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

Side by Side Diff: content/browser/loader/resource_scheduler.h

Issue 1117923004: Run load state update timer only when needed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cpu
Patch Set: Fixes for mmenke Created 5 years, 7 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 (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 <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // from a proxy using SPDY. 143 // from a proxy using SPDY.
144 void OnReceivedSpdyProxiedHttpResponse(int child_id, int route_id); 144 void OnReceivedSpdyProxiedHttpResponse(int child_id, int route_id);
145 145
146 // Client functions: 146 // Client functions:
147 147
148 // Called to check if all user observable tabs have completed loading. 148 // Called to check if all user observable tabs have completed loading.
149 bool active_clients_loaded() const { return active_clients_loading_ == 0; } 149 bool active_clients_loaded() const { return active_clients_loading_ == 0; }
150 150
151 bool IsClientVisibleForTesting(int child_id, int route_id); 151 bool IsClientVisibleForTesting(int child_id, int route_id);
152 152
153 // Returns true if at least one client is currently loading.
154 bool HasLoadingClients() const;
155
153 private: 156 private:
154 enum ClientState { 157 enum ClientState {
155 // Observable client. 158 // Observable client.
156 ACTIVE, 159 ACTIVE,
157 // Non-observable client. 160 // Non-observable client.
158 BACKGROUND, 161 BACKGROUND,
159 // No client found. 162 // No client found.
160 UNKNOWN, 163 UNKNOWN,
161 }; 164 };
162 165
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 size_t active_clients_loading_; 226 size_t active_clients_loading_;
224 size_t coalesced_clients_; 227 size_t coalesced_clients_;
225 // This is a repeating timer to initiate requests on COALESCED Clients. 228 // This is a repeating timer to initiate requests on COALESCED Clients.
226 scoped_ptr<base::Timer> coalescing_timer_; 229 scoped_ptr<base::Timer> coalescing_timer_;
227 RequestSet unowned_requests_; 230 RequestSet unowned_requests_;
228 }; 231 };
229 232
230 } // namespace content 233 } // namespace content
231 234
232 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ 235 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698