Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1345)

Side by Side Diff: chrome/browser/prerender/prerender_manager.h

Issue 9623018: Prerendered pages are swapped in at browser::Navigate time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // status to them. 118 // status to them.
119 virtual void DestroyPrerenderForRenderView(int process_id, int view_id, 119 virtual void DestroyPrerenderForRenderView(int process_id, int view_id,
120 FinalStatus final_status); 120 FinalStatus final_status);
121 121
122 // Cancels all active prerenders. 122 // Cancels all active prerenders.
123 void CancelAllPrerenders(); 123 void CancelAllPrerenders();
124 124
125 // Cancels all active prerenders with the ORIGIN_OMNIBOX origin. 125 // Cancels all active prerenders with the ORIGIN_OMNIBOX origin.
126 void CancelOmniboxPrerenders(); 126 void CancelOmniboxPrerenders();
127 127
128 // For a given WebContents that wants to navigate to the URL supplied, 128 // If |url| matches a valid prerendered page, try to swap it into
129 // determines whether a prerendered version of the URL can be used, 129 // |web_contents| and merge browsing histories. Returns |true| if a
130 // and substitutes the prerendered RVH into the WebContents. |opener_url| is 130 // prerendered page is swapped in, |false| otherwise.
131 // set to the window.opener url that the WebContents should have set and
132 // will be empty if there is no opener set. Returns whether or not a
133 // prerendered RVH could be used or not.
134 bool MaybeUsePrerenderedPage(content::WebContents* web_contents, 131 bool MaybeUsePrerenderedPage(content::WebContents* web_contents,
135 const GURL& url, 132 const GURL& url);
136 const GURL& opener_url);
137 133
138 // 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
139 // active prerenders when prerendering should be cancelled. 135 // active prerenders when prerendering should be cancelled.
140 void MoveEntryToPendingDelete(PrerenderContents* entry, 136 void MoveEntryToPendingDelete(PrerenderContents* entry,
141 FinalStatus final_status); 137 FinalStatus final_status);
142 138
143 // 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
144 // 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
145 // load may have started prior to navigation due to prerender hints. 141 // load may have started prior to navigation due to prerender hints.
146 // This must be called on the UI thread. 142 // This must be called on the UI thread.
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 450
455 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 451 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
456 }; 452 };
457 453
458 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( 454 PrerenderManager* FindPrerenderManagerUsingRenderProcessId(
459 int render_process_id); 455 int render_process_id);
460 456
461 } // namespace prerender 457 } // namespace prerender
462 458
463 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 459 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698