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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // status to them. | 117 // status to them. |
118 virtual void DestroyPrerenderForRenderView(int process_id, int view_id, | 118 virtual void DestroyPrerenderForRenderView(int process_id, int view_id, |
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 // If |url| matches a valid prerendered page, try to swap it into |
128 // determines whether a prerendered version of the URL can be used, | 128 // |web_contents| and merge browsing histories. Returns |true| if a |
129 // and substitutes the prerendered RVH into the WebContents. |opener_url| is | 129 // prerendered page is swapped in, |false| otherwise. |
130 // set to the window.opener url that the WebContents should have set and | |
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, | 130 bool MaybeUsePrerenderedPage(content::WebContents* web_contents, |
134 const GURL& url, | 131 const GURL& url); |
135 const GURL& opener_url); | |
136 | 132 |
137 // Moves a PrerenderContents to the pending delete list from the list of | 133 // Moves a PrerenderContents to the pending delete list from the list of |
138 // active prerenders when prerendering should be cancelled. | 134 // active prerenders when prerendering should be cancelled. |
139 void MoveEntryToPendingDelete(PrerenderContents* entry, | 135 void MoveEntryToPendingDelete(PrerenderContents* entry, |
140 FinalStatus final_status); | 136 FinalStatus final_status); |
141 | 137 |
142 // Records the perceived page load time for a page - effectively the time from | 138 // 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 | 139 // 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. | 140 // load may have started prior to navigation due to prerender hints. |
145 // This must be called on the UI thread. | 141 // This must be called on the UI thread. |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 | 443 |
448 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 444 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
449 }; | 445 }; |
450 | 446 |
451 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( | 447 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( |
452 int render_process_id); | 448 int render_process_id); |
453 | 449 |
454 } // namespace prerender | 450 } // namespace prerender |
455 | 451 |
456 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 452 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
OLD | NEW |