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

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

Issue 45693002: Add ExternalPrerenderRequestHandler and related API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed imports Created 7 years, 1 month 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 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 PrerenderHandle* AddPrerenderFromOmnibox( 144 PrerenderHandle* AddPrerenderFromOmnibox(
145 const GURL& url, 145 const GURL& url,
146 content::SessionStorageNamespace* session_storage_namespace, 146 content::SessionStorageNamespace* session_storage_namespace,
147 const gfx::Size& size); 147 const gfx::Size& size);
148 148
149 PrerenderHandle* AddPrerenderFromLocalPredictor( 149 PrerenderHandle* AddPrerenderFromLocalPredictor(
150 const GURL& url, 150 const GURL& url,
151 content::SessionStorageNamespace* session_storage_namespace, 151 content::SessionStorageNamespace* session_storage_namespace,
152 const gfx::Size& size); 152 const gfx::Size& size);
153 153
154 PrerenderHandle* AddPrerenderFromExternalRequest(
155 const GURL& url,
156 const content::Referrer& referrer,
157 content::SessionStorageNamespace* session_storage_namespace,
158 const gfx::Size& size);
159
154 // If |process_id| and |view_id| refer to a running prerender, destroy 160 // If |process_id| and |view_id| refer to a running prerender, destroy
155 // it with |final_status|. 161 // it with |final_status|.
156 virtual void DestroyPrerenderForRenderView(int process_id, 162 virtual void DestroyPrerenderForRenderView(int process_id,
157 int view_id, 163 int view_id,
158 FinalStatus final_status); 164 FinalStatus final_status);
159 165
160 // Cancels all active prerenders. 166 // Cancels all active prerenders.
161 void CancelAllPrerenders(); 167 void CancelAllPrerenders();
162 168
163 // If |url| matches a valid prerendered page and |params| are compatible, try 169 // If |url| matches a valid prerendered page and |params| are compatible, try
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 static bool IsControlGroup(uint8 experiment_id); 214 static bool IsControlGroup(uint8 experiment_id);
209 static bool IsNoUseGroup(); 215 static bool IsNoUseGroup();
210 216
211 // Query the list of current prerender pages to see if the given web contents 217 // Query the list of current prerender pages to see if the given web contents
212 // is prerendering a page. The optional parameter |origin| is an output 218 // is prerendering a page. The optional parameter |origin| is an output
213 // parameter which, if a prerender is found, is set to the Origin of the 219 // parameter which, if a prerender is found, is set to the Origin of the
214 // prerender |web_contents|. 220 // prerender |web_contents|.
215 bool IsWebContentsPrerendering(const content::WebContents* web_contents, 221 bool IsWebContentsPrerendering(const content::WebContents* web_contents,
216 Origin* origin) const; 222 Origin* origin) const;
217 223
224 // Whether the PrerenderManager has an active prerender with the given url and
225 // SessionStorageNamespace associated with the given WebContens.
226 bool HasPrerenderedUrl(GURL url, content::WebContents* web_contents) const;
227
218 // Returns the PrerenderContents object for the given web_contents if it's 228 // Returns the PrerenderContents object for the given web_contents if it's
219 // used for an active prerender page, otherwise returns NULL. 229 // used for an active prerender page, otherwise returns NULL.
220 PrerenderContents* GetPrerenderContents( 230 PrerenderContents* GetPrerenderContents(
221 const content::WebContents* web_contents) const; 231 const content::WebContents* web_contents) const;
222 232
223 // Returns a list of all WebContents being prerendered. 233 // Returns a list of all WebContents being prerendered.
224 const std::vector<content::WebContents*> GetAllPrerenderingContents() const; 234 const std::vector<content::WebContents*> GetAllPrerenderingContents() const;
225 235
226 // Maintaining and querying the set of WebContents belonging to this 236 // Maintaining and querying the set of WebContents belonging to this
227 // PrerenderManager that are currently showing prerendered pages. 237 // PrerenderManager that are currently showing prerendered pages.
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 656
647 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 657 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
648 }; 658 };
649 659
650 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( 660 PrerenderManager* FindPrerenderManagerUsingRenderProcessId(
651 int render_process_id); 661 int render_process_id);
652 662
653 } // namespace prerender 663 } // namespace prerender
654 664
655 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 665 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_histograms.cc ('k') | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698