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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 FinalStatus final_status); | 119 FinalStatus final_status); |
120 | 120 |
121 // Cancels all active prerenders. | 121 // Cancels all active prerenders. |
122 void CancelAllPrerenders(); | 122 void CancelAllPrerenders(); |
123 | 123 |
124 // Cancels all active prerenders with the ORIGIN_OMNIBOX origin. | 124 // Cancels all active prerenders with the ORIGIN_OMNIBOX origin. |
125 void CancelOmniboxPrerenders(); | 125 void CancelOmniboxPrerenders(); |
126 | 126 |
127 // For a given WebContents that wants to navigate to the URL supplied, | 127 // For a given WebContents that wants to navigate to the URL supplied, |
128 // determines whether a prerendered version of the URL can be used, | 128 // determines whether a prerendered version of the URL can be used, |
129 // and substitutes the prerendered RVH into the WebContents. |opener_url| is | 129 // and substitutes the prerendered RVH into the WebContents. If a prerendered |
130 // set to the window.opener url that the WebContents should have set and | 130 // page can't be swapped in, NULL is returned. |
dominich
2012/02/28 16:21:00
NULL -> false
| |
131 // will be empty if there is no opener set. Returns whether or not a | |
132 // prerendered RVH could be used or not. | |
133 bool MaybeUsePrerenderedPage(content::WebContents* web_contents, | 131 bool MaybeUsePrerenderedPage(content::WebContents* web_contents, |
134 const GURL& url, | 132 const GURL& url); |
135 const GURL& opener_url); | |
136 | 133 |
137 // Moves a PrerenderContents to the pending delete list from the list of | 134 // Moves a PrerenderContents to the pending delete list from the list of |
138 // active prerenders when prerendering should be cancelled. | 135 // active prerenders when prerendering should be cancelled. |
139 void MoveEntryToPendingDelete(PrerenderContents* entry, | 136 void MoveEntryToPendingDelete(PrerenderContents* entry, |
140 FinalStatus final_status); | 137 FinalStatus final_status); |
141 | 138 |
142 // Records the perceived page load time for a page - effectively the time from | 139 // Records the perceived page load time for a page - effectively the time from |
143 // when the user navigates to a page to when it finishes loading. The actual | 140 // when the user navigates to a page to when it finishes loading. The actual |
144 // load may have started prior to navigation due to prerender hints. | 141 // load may have started prior to navigation due to prerender hints. |
145 // This must be called on the UI thread. | 142 // This must be called on the UI thread. |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
447 | 444 |
448 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 445 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
449 }; | 446 }; |
450 | 447 |
451 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( | 448 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( |
452 int render_process_id); | 449 int render_process_id); |
453 | 450 |
454 } // namespace prerender | 451 } // namespace prerender |
455 | 452 |
456 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 453 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
OLD | NEW |