OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 FinalStatus final_status); | 98 FinalStatus final_status); |
99 | 99 |
100 // For a given TabContents that wants to navigate to the URL supplied, | 100 // For a given TabContents that wants to navigate to the URL supplied, |
101 // determines whether a preloaded version of the URL can be used, | 101 // determines whether a preloaded version of the URL can be used, |
102 // and substitutes the prerendered RVH into the TabContents. Returns | 102 // and substitutes the prerendered RVH into the TabContents. Returns |
103 // whether or not a prerendered RVH could be used or not. | 103 // whether or not a prerendered RVH could be used or not. |
104 bool MaybeUsePreloadedPage(TabContents* tab_contents, const GURL& url); | 104 bool MaybeUsePreloadedPage(TabContents* tab_contents, const GURL& url); |
105 bool MaybeUsePreloadedPageOld(TabContents* tab_contents, const GURL& url); | 105 bool MaybeUsePreloadedPageOld(TabContents* tab_contents, const GURL& url); |
106 | 106 |
107 // Moves a PrerenderContents to the pending delete list from the list of | 107 // Moves a PrerenderContents to the pending delete list from the list of |
108 // active prerenders when prerendering should be cancelled. | 108 // active prerenders when prerendering should be cancelled. Returns true |
109 void MoveEntryToPendingDelete(PrerenderContents* entry); | 109 // on success. If |entry| was not an active prerender, returns false and |
| 110 // does not move |entry| to the pending delete list. |
| 111 bool MoveEntryToPendingDelete(PrerenderContents* entry); |
110 | 112 |
111 // Checks if the PrerenderContents has been added to the pending delete list. | 113 // Checks if the PrerenderContents has been added to the pending delete list. |
112 bool IsPendingDelete(PrerenderContents* entry) const; | 114 bool IsPendingDelete(PrerenderContents* entry) const; |
113 | 115 |
114 // Retrieves the PrerenderContents object for the specified URL, if it | 116 // Retrieves the PrerenderContents object for the specified URL, if it |
115 // has been prerendered. The caller will then have ownership of the | 117 // has been prerendered. The caller will then have ownership of the |
116 // PrerenderContents object and is responsible for freeing it. | 118 // PrerenderContents object and is responsible for freeing it. |
117 // Returns NULL if the specified URL has not been prerendered. | 119 // Returns NULL if the specified URL has not been prerendered. |
118 PrerenderContents* GetEntry(const GURL& url); | 120 PrerenderContents* GetEntry(const GURL& url); |
119 | 121 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 311 |
310 // Cancels pending tasks on deletion. | 312 // Cancels pending tasks on deletion. |
311 ScopedRunnableMethodFactory<PrerenderManager> runnable_method_factory_; | 313 ScopedRunnableMethodFactory<PrerenderManager> runnable_method_factory_; |
312 | 314 |
313 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 315 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
314 }; | 316 }; |
315 | 317 |
316 } // namespace prerender | 318 } // namespace prerender |
317 | 319 |
318 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 320 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
OLD | NEW |