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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // but not yet deleted. | 261 // but not yet deleted. |
262 PrerenderContents* GetPrerenderContents( | 262 PrerenderContents* GetPrerenderContents( |
263 const content::WebContents* web_contents) const; | 263 const content::WebContents* web_contents) const; |
264 | 264 |
265 // Returns the PrerenderContents object for a given child_id, route_id pair, | 265 // Returns the PrerenderContents object for a given child_id, route_id pair, |
266 // otherwise returns NULL. Note that the PrerenderContents may have been | 266 // otherwise returns NULL. Note that the PrerenderContents may have been |
267 // Destroy()ed, but not yet deleted. | 267 // Destroy()ed, but not yet deleted. |
268 virtual PrerenderContents* GetPrerenderContentsForRoute( | 268 virtual PrerenderContents* GetPrerenderContentsForRoute( |
269 int child_id, int route_id) const; | 269 int child_id, int route_id) const; |
270 | 270 |
271 // Returns the PrerenderContents object that is found in active prerenders to | |
272 // match the |render_process_id|. Otherwise returns a nullptr. | |
273 PrerenderContents* GetPrerenderContentsForProcess( | |
274 int render_process_id) const; | |
275 | |
276 // Returns a list of all WebContents being prerendered. | 271 // Returns a list of all WebContents being prerendered. |
277 std::vector<content::WebContents*> GetAllPrerenderingContents() const; | 272 std::vector<content::WebContents*> GetAllPrerenderingContents() const; |
278 | 273 |
279 // Checks whether |url| has been recently navigated to. | 274 // Checks whether |url| has been recently navigated to. |
280 bool HasRecentlyBeenNavigatedTo(Origin origin, const GURL& url); | 275 bool HasRecentlyBeenNavigatedTo(Origin origin, const GURL& url); |
281 | 276 |
282 // Returns true iff the scheme of the URL given is valid for prerendering. | 277 // Returns true iff the scheme of the URL given is valid for prerendering. |
283 static bool DoesURLHaveValidScheme(const GURL& url); | 278 static bool DoesURLHaveValidScheme(const GURL& url); |
284 | 279 |
285 // Returns true iff the scheme of the subresource URL given is valid for | 280 // Returns true iff the scheme of the subresource URL given is valid for |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 std::unique_ptr<TimeOverride> time_override_; | 608 std::unique_ptr<TimeOverride> time_override_; |
614 | 609 |
615 base::WeakPtrFactory<PrerenderManager> weak_factory_; | 610 base::WeakPtrFactory<PrerenderManager> weak_factory_; |
616 | 611 |
617 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 612 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
618 }; | 613 }; |
619 | 614 |
620 } // namespace prerender | 615 } // namespace prerender |
621 | 616 |
622 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 617 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
OLD | NEW |