| 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 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // but not yet deleted. | 254 // but not yet deleted. |
| 255 PrerenderContents* GetPrerenderContents( | 255 PrerenderContents* GetPrerenderContents( |
| 256 const content::WebContents* web_contents) const; | 256 const content::WebContents* web_contents) const; |
| 257 | 257 |
| 258 // Returns the PrerenderContents object for a given child_id, route_id pair, | 258 // Returns the PrerenderContents object for a given child_id, route_id pair, |
| 259 // otherwise returns NULL. Note that the PrerenderContents may have been | 259 // otherwise returns NULL. Note that the PrerenderContents may have been |
| 260 // Destroy()ed, but not yet deleted. | 260 // Destroy()ed, but not yet deleted. |
| 261 virtual PrerenderContents* GetPrerenderContentsForRoute( | 261 virtual PrerenderContents* GetPrerenderContentsForRoute( |
| 262 int child_id, int route_id) const; | 262 int child_id, int route_id) const; |
| 263 | 263 |
| 264 // Returns the PrerenderContents object that is found in active prerenders to |
| 265 // match the |render_process_id|. Otherwise returns a nullptr. |
| 266 PrerenderContents* GetPrerenderContentsForProcess( |
| 267 int render_process_id) const; |
| 268 |
| 264 // Returns a list of all WebContents being prerendered. | 269 // Returns a list of all WebContents being prerendered. |
| 265 std::vector<content::WebContents*> GetAllPrerenderingContents() const; | 270 std::vector<content::WebContents*> GetAllPrerenderingContents() const; |
| 266 | 271 |
| 267 // Checks whether |url| has been recently navigated to. | 272 // Checks whether |url| has been recently navigated to. |
| 268 bool HasRecentlyBeenNavigatedTo(Origin origin, const GURL& url); | 273 bool HasRecentlyBeenNavigatedTo(Origin origin, const GURL& url); |
| 269 | 274 |
| 270 // Returns true iff the scheme of the URL given is valid for prerendering. | 275 // Returns true iff the scheme of the URL given is valid for prerendering. |
| 271 static bool DoesURLHaveValidScheme(const GURL& url); | 276 static bool DoesURLHaveValidScheme(const GURL& url); |
| 272 | 277 |
| 273 // Returns true iff the scheme of the subresource URL given is valid for | 278 // Returns true iff the scheme of the subresource URL given is valid for |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 PrerenderProcessSet prerender_process_hosts_; | 602 PrerenderProcessSet prerender_process_hosts_; |
| 598 | 603 |
| 599 base::WeakPtrFactory<PrerenderManager> weak_factory_; | 604 base::WeakPtrFactory<PrerenderManager> weak_factory_; |
| 600 | 605 |
| 601 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 606 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 602 }; | 607 }; |
| 603 | 608 |
| 604 } // namespace prerender | 609 } // namespace prerender |
| 605 | 610 |
| 606 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 611 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |