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 CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 void RecordNetworkBytes(Origin origin, bool used, int64 prerender_bytes); | 361 void RecordNetworkBytes(Origin origin, bool used, int64 prerender_bytes); |
362 | 362 |
363 // Add to the running tally of bytes transferred over the network for this | 363 // Add to the running tally of bytes transferred over the network for this |
364 // profile if prerendering is currently enabled. | 364 // profile if prerendering is currently enabled. |
365 void AddProfileNetworkBytesIfEnabled(int64 bytes); | 365 void AddProfileNetworkBytesIfEnabled(int64 bytes); |
366 | 366 |
367 // Registers a new ProcessHost performing a prerender. Called by | 367 // Registers a new ProcessHost performing a prerender. Called by |
368 // PrerenderContents. | 368 // PrerenderContents. |
369 void AddPrerenderProcessHost(content::RenderProcessHost* process_host); | 369 void AddPrerenderProcessHost(content::RenderProcessHost* process_host); |
370 | 370 |
371 bool IsProcessPrerendering(content::RenderProcessHost* process_host); | 371 // Returns whether or not |process_host| may be reused for new navigations |
| 372 // from a prerendering perspective. Currently, if Prerender Cookie Stores are |
| 373 // enabled, prerenders must be in their own processes that may not be shared. |
| 374 bool MayReuseProcessHost(content::RenderProcessHost* process_host); |
372 | 375 |
373 // content::RenderProcessHostObserver implementation. | 376 // content::RenderProcessHostObserver implementation. |
374 virtual void RenderProcessHostDestroyed( | 377 virtual void RenderProcessHostDestroyed( |
375 content::RenderProcessHost* host) OVERRIDE; | 378 content::RenderProcessHost* host) OVERRIDE; |
376 | 379 |
377 // To be called once the cookie store for this profile has been loaded. | 380 // To be called once the cookie store for this profile has been loaded. |
378 void OnCookieStoreLoaded(); | 381 void OnCookieStoreLoaded(); |
379 | 382 |
380 // For testing purposes. Issues a callback once the cookie store has been | 383 // For testing purposes. Issues a callback once the cookie store has been |
381 // loaded. | 384 // loaded. |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 bool cookie_store_loaded_; | 759 bool cookie_store_loaded_; |
757 | 760 |
758 base::Closure on_cookie_store_loaded_cb_for_testing_; | 761 base::Closure on_cookie_store_loaded_cb_for_testing_; |
759 | 762 |
760 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 763 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
761 }; | 764 }; |
762 | 765 |
763 } // namespace prerender | 766 } // namespace prerender |
764 | 767 |
765 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 768 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
OLD | NEW |