| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 PrerenderContents* prerender_contents); | 533 PrerenderContents* prerender_contents); |
| 534 | 534 |
| 535 bool DoesRateLimitAllowPrerender(Origin origin) const; | 535 bool DoesRateLimitAllowPrerender(Origin origin) const; |
| 536 | 536 |
| 537 // Deletes old WebContents that have been replaced by prerendered ones. This | 537 // Deletes old WebContents that have been replaced by prerendered ones. This |
| 538 // is needed because they're replaced in a callback from the old WebContents, | 538 // is needed because they're replaced in a callback from the old WebContents, |
| 539 // so cannot immediately be deleted. | 539 // so cannot immediately be deleted. |
| 540 void DeleteOldWebContents(); | 540 void DeleteOldWebContents(); |
| 541 | 541 |
| 542 // Get information associated with a possible prefetch of |url|. | 542 // Get information associated with a possible prefetch of |url|. |
| 543 // |origin| may be null, in which case the origin is not returned. |
| 543 void GetPrefetchInformation(const GURL& url, | 544 void GetPrefetchInformation(const GURL& url, |
| 544 base::TimeDelta* prefetch_age, | 545 base::TimeDelta* prefetch_age, |
| 545 Origin* origin); | 546 Origin* origin); |
| 546 | 547 |
| 548 // Called when a prefetch has been used. Prefetches avoid cache revalidation |
| 549 // only once. |
| 550 void OnPrefetchUsed(const GURL& url); |
| 551 |
| 547 // Cleans up old NavigationRecord's. | 552 // Cleans up old NavigationRecord's. |
| 548 void CleanUpOldNavigations(std::vector<NavigationRecord>* navigations, | 553 void CleanUpOldNavigations(std::vector<NavigationRecord>* navigations, |
| 549 base::TimeDelta max_age); | 554 base::TimeDelta max_age); |
| 550 | 555 |
| 551 // Arrange for the given WebContents to be deleted asap. Delete |deleter| as | 556 // Arrange for the given WebContents to be deleted asap. Delete |deleter| as |
| 552 // well. | 557 // well. |
| 553 void ScheduleDeleteOldWebContents(std::unique_ptr<content::WebContents> tab, | 558 void ScheduleDeleteOldWebContents(std::unique_ptr<content::WebContents> tab, |
| 554 OnCloseWebContentsDeleter* deleter); | 559 OnCloseWebContentsDeleter* deleter); |
| 555 | 560 |
| 556 // Adds to the history list. | 561 // Adds to the history list. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 std::vector<std::unique_ptr<PrerenderManagerObserver>> observers_; | 649 std::vector<std::unique_ptr<PrerenderManagerObserver>> observers_; |
| 645 | 650 |
| 646 base::WeakPtrFactory<PrerenderManager> weak_factory_; | 651 base::WeakPtrFactory<PrerenderManager> weak_factory_; |
| 647 | 652 |
| 648 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 653 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 649 }; | 654 }; |
| 650 | 655 |
| 651 } // namespace prerender | 656 } // namespace prerender |
| 652 | 657 |
| 653 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 658 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |