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

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

Issue 501703002: Hook up loading signal to ResourceScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@zhen_visibility
Patch Set: Rebase Created 6 years, 4 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 int child_id, int route_id, net::URLRequest* url_request); 109 int child_id, int route_id, net::URLRequest* url_request);
110 110
111 // Signals from the UI thread, posted as tasks on the IO thread: 111 // Signals from the UI thread, posted as tasks on the IO thread:
112 112
113 // Called when a renderer is created. 113 // Called when a renderer is created.
114 void OnClientCreated(int child_id, int route_id, bool is_visible); 114 void OnClientCreated(int child_id, int route_id, bool is_visible);
115 115
116 // Called when a renderer is destroyed. 116 // Called when a renderer is destroyed.
117 void OnClientDeleted(int child_id, int route_id); 117 void OnClientDeleted(int child_id, int route_id);
118 118
119 // Called when a renderer stops or restarts loading.
sky 2014/08/25 15:24:31 Why are you moving these? Style guide says definit
120 void OnLoadingStateChanged(int child_id, int route_id, bool is_loaded);
121
122 // Called when a Client is shown or hidden.
123 void OnVisibilityChanged(int child_id, int route_id, bool is_visible);
124
119 // Signals from IPC messages directly from the renderers: 125 // Signals from IPC messages directly from the renderers:
120 126
121 // Called when a client navigates to a new main document. 127 // Called when a client navigates to a new main document.
122 void OnNavigate(int child_id, int route_id); 128 void OnNavigate(int child_id, int route_id);
123 129
124 // Called when the client has parsed the <body> element. This is a signal that 130 // Called when the client has parsed the <body> element. This is a signal that
125 // resource loads won't interfere with first paint. 131 // resource loads won't interfere with first paint.
126 void OnWillInsertBody(int child_id, int route_id); 132 void OnWillInsertBody(int child_id, int route_id);
127 133
128 // Signals from the IO thread: 134 // Signals from the IO thread:
129 135
130 // Called when we received a response to a http request that was served 136 // Called when we received a response to a http request that was served
131 // from a proxy using SPDY. 137 // from a proxy using SPDY.
132 void OnReceivedSpdyProxiedHttpResponse(int child_id, int route_id); 138 void OnReceivedSpdyProxiedHttpResponse(int child_id, int route_id);
133 139
134 // Client functions: 140 // Client functions:
135 141
136 // Called to check if all user observable tabs have completed loading. 142 // Called to check if all user observable tabs have completed loading.
137 bool active_clients_loaded() const { return active_clients_loading_ == 0; } 143 bool active_clients_loaded() const { return active_clients_loading_ == 0; }
138 144
139 // Called when a Client starts or stops playing audio. 145 // Called when a Client starts or stops playing audio.
140 void OnAudibilityChanged(int child_id, int route_id, bool is_audible); 146 void OnAudibilityChanged(int child_id, int route_id, bool is_audible);
141 147
142 // Called when a Client is shown or hidden. 148 bool IsClientVisibleForTesting(int child_id, int route_id);
143 void OnVisibilityChanged(int child_id, int route_id, bool is_visible);
144 149
145 void OnLoadingStateChanged(int child_id, int route_id, bool is_loaded); 150 bool IsClientLoadedForTesting(int child_id, int route_id);
146
147 bool IsClientVisibleForTesting(int child_id, int route_id);
148 151
149 private: 152 private:
150 class RequestQueue; 153 class RequestQueue;
151 class ScheduledResourceRequest; 154 class ScheduledResourceRequest;
152 struct RequestPriorityParams; 155 struct RequestPriorityParams;
153 struct ScheduledResourceSorter { 156 struct ScheduledResourceSorter {
154 bool operator()(const ScheduledResourceRequest* a, 157 bool operator()(const ScheduledResourceRequest* a,
155 const ScheduledResourceRequest* b) const; 158 const ScheduledResourceRequest* b) const;
156 }; 159 };
157 class Client; 160 class Client;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 size_t active_clients_loading_; 209 size_t active_clients_loading_;
207 size_t coalesced_clients_; 210 size_t coalesced_clients_;
208 // This is a repeating timer to initiate requests on COALESCED Clients. 211 // This is a repeating timer to initiate requests on COALESCED Clients.
209 scoped_ptr<base::Timer> coalescing_timer_; 212 scoped_ptr<base::Timer> coalescing_timer_;
210 RequestSet unowned_requests_; 213 RequestSet unowned_requests_;
211 }; 214 };
212 215
213 } // namespace content 216 } // namespace content
214 217
215 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ 218 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/loader/resource_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698