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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 void GetPrefetchInformation(const GURL& url, | 543 void GetPrefetchInformation(const GURL& url, |
544 base::TimeDelta* prefetch_age, | 544 base::TimeDelta* prefetch_age, |
545 Origin* origin); | 545 Origin* origin); |
546 | 546 |
| 547 // Called when a prefetch has been used. Prefetches avoid cache revalidation |
| 548 // only once. |
| 549 void OnPrefetchUsed(const GURL& url); |
| 550 |
547 // Cleans up old NavigationRecord's. | 551 // Cleans up old NavigationRecord's. |
548 void CleanUpOldNavigations(std::vector<NavigationRecord>* navigations, | 552 void CleanUpOldNavigations(std::vector<NavigationRecord>* navigations, |
549 base::TimeDelta max_age); | 553 base::TimeDelta max_age); |
550 | 554 |
551 // Arrange for the given WebContents to be deleted asap. Delete |deleter| as | 555 // Arrange for the given WebContents to be deleted asap. Delete |deleter| as |
552 // well. | 556 // well. |
553 void ScheduleDeleteOldWebContents(std::unique_ptr<content::WebContents> tab, | 557 void ScheduleDeleteOldWebContents(std::unique_ptr<content::WebContents> tab, |
554 OnCloseWebContentsDeleter* deleter); | 558 OnCloseWebContentsDeleter* deleter); |
555 | 559 |
556 // Adds to the history list. | 560 // 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_; | 648 std::vector<std::unique_ptr<PrerenderManagerObserver>> observers_; |
645 | 649 |
646 base::WeakPtrFactory<PrerenderManager> weak_factory_; | 650 base::WeakPtrFactory<PrerenderManager> weak_factory_; |
647 | 651 |
648 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 652 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
649 }; | 653 }; |
650 | 654 |
651 } // namespace prerender | 655 } // namespace prerender |
652 | 656 |
653 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 657 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
OLD | NEW |