| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 int frame_id, | 338 int frame_id, |
| 339 const GURL& url, | 339 const GURL& url, |
| 340 const GURL& frame_url, | 340 const GURL& frame_url, |
| 341 PrerenderContents::CookieEvent event, | 341 PrerenderContents::CookieEvent event, |
| 342 const net::CookieList* cookie_list); | 342 const net::CookieList* cookie_list); |
| 343 | 343 |
| 344 // Arranges for all session storage merges to hang indefinitely. This is used | 344 // Arranges for all session storage merges to hang indefinitely. This is used |
| 345 // to reliably test various swap abort cases. | 345 // to reliably test various swap abort cases. |
| 346 static void HangSessionStorageMergesForTesting(); | 346 static void HangSessionStorageMergesForTesting(); |
| 347 | 347 |
| 348 // Notification that a prerender has completed and its bytes should be |
| 349 // recorded. |
| 350 void RecordNetworkBytes(bool used, int64 prerender_bytes); |
| 351 |
| 352 // Add to the running tally of bytes transferred over the network for this |
| 353 // profile if prerendering is currently enabled. |
| 354 void AddProfileNetworkBytesIfEnabled(int64 bytes); |
| 355 |
| 348 protected: | 356 protected: |
| 349 class PendingSwap; | 357 class PendingSwap; |
| 350 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { | 358 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { |
| 351 public: | 359 public: |
| 352 struct OrderByExpiryTime; | 360 struct OrderByExpiryTime; |
| 353 | 361 |
| 354 PrerenderData(PrerenderManager* manager, | 362 PrerenderData(PrerenderManager* manager, |
| 355 PrerenderContents* contents, | 363 PrerenderContents* contents, |
| 356 base::TimeTicks expiry_time); | 364 base::TimeTicks expiry_time); |
| 357 | 365 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 // browser data deletion. We do not use this for actual lookups, but only | 694 // browser data deletion. We do not use this for actual lookups, but only |
| 687 // to query cookie data for domains we know there was a login before. | 695 // to query cookie data for domains we know there was a login before. |
| 688 // This is required to avoid a large number of cookie lookups on bulk | 696 // This is required to avoid a large number of cookie lookups on bulk |
| 689 // deletion of cookies. | 697 // deletion of cookies. |
| 690 scoped_ptr<LoggedInStateMap> logged_in_state_; | 698 scoped_ptr<LoggedInStateMap> logged_in_state_; |
| 691 | 699 |
| 692 content::NotificationRegistrar notification_registrar_; | 700 content::NotificationRegistrar notification_registrar_; |
| 693 | 701 |
| 694 CancelableRequestConsumer query_url_consumer_; | 702 CancelableRequestConsumer query_url_consumer_; |
| 695 | 703 |
| 704 // The number of bytes transferred over the network for the profile this |
| 705 // PrerenderManager is attached to. |
| 706 int64 profile_network_bytes_; |
| 707 |
| 708 // The value of profile_network_bytes_ that was last recorded. |
| 709 int64 last_recorded_profile_network_bytes_; |
| 710 |
| 696 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 711 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 697 }; | 712 }; |
| 698 | 713 |
| 699 } // namespace prerender | 714 } // namespace prerender |
| 700 | 715 |
| 701 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 716 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |