| 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 <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // Entry points for adding prerenders. | 104 // Entry points for adding prerenders. |
| 105 | 105 |
| 106 // Adds a prerender for |url| if valid. |process_id| and |route_id| identify | 106 // Adds a prerender for |url| if valid. |process_id| and |route_id| identify |
| 107 // the RenderView that the prerender request came from. If |size| is empty, a | 107 // the RenderView that the prerender request came from. If |size| is empty, a |
| 108 // default from the PrerenderConfig is used. Returns a caller-owned | 108 // default from the PrerenderConfig is used. Returns a caller-owned |
| 109 // PrerenderHandle* if the URL was added, NULL if it was not. If the launching | 109 // PrerenderHandle* if the URL was added, NULL if it was not. If the launching |
| 110 // RenderView is itself prerendering, the prerender is added as a pending | 110 // RenderView is itself prerendering, the prerender is added as a pending |
| 111 // prerender. | 111 // prerender. |
| 112 PrerenderHandle* AddPrerenderFromLinkRelPrerender( | 112 PrerenderHandle* AddPrerenderFromLinkRelPrerender( |
| 113 int process_id, | 113 int process_id, |
| 114 int prerender_id, |
| 114 int route_id, | 115 int route_id, |
| 115 const GURL& url, | 116 const GURL& url, |
| 116 const content::Referrer& referrer, | 117 const content::Referrer& referrer, |
| 117 const gfx::Size& size); | 118 const gfx::Size& size); |
| 118 | 119 |
| 119 // Adds a prerender for |url| if valid. As the prerender request is coming | 120 // Adds a prerender for |url| if valid. As the prerender request is coming |
| 120 // from a source without a RenderViewHost (i.e., the omnibox) we don't have a | 121 // from a source without a RenderViewHost (i.e., the omnibox) we don't have a |
| 121 // child or route id, or a referrer. This method uses sensible values for | 122 // child or route id, or a referrer. This method uses sensible values for |
| 122 // those. The |session_storage_namespace| matches the namespace of the active | 123 // those. The |session_storage_namespace| matches the namespace of the active |
| 123 // tab at the time the prerender is generated from the omnibox. Returns a | 124 // tab at the time the prerender is generated from the omnibox. Returns a |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 void OnCancelPrerenderHandle(PrerenderData* prerender_data); | 391 void OnCancelPrerenderHandle(PrerenderData* prerender_data); |
| 391 | 392 |
| 392 // Adds a prerender for |url| from |referrer| initiated from the process | 393 // Adds a prerender for |url| from |referrer| initiated from the process |
| 393 // |child_id|. The |origin| specifies how the prerender was added. If |size| | 394 // |child_id|. The |origin| specifies how the prerender was added. If |size| |
| 394 // is empty, then PrerenderContents::StartPrerendering will instead use a | 395 // is empty, then PrerenderContents::StartPrerendering will instead use a |
| 395 // default from PrerenderConfig. Returns a PrerenderHandle*, owned by the | 396 // default from PrerenderConfig. Returns a PrerenderHandle*, owned by the |
| 396 // caller, or NULL. | 397 // caller, or NULL. |
| 397 PrerenderHandle* AddPrerender( | 398 PrerenderHandle* AddPrerender( |
| 398 Origin origin, | 399 Origin origin, |
| 399 int child_id, | 400 int child_id, |
| 401 int prerender_id, |
| 400 const GURL& url, | 402 const GURL& url, |
| 401 const content::Referrer& referrer, | 403 const content::Referrer& referrer, |
| 402 const gfx::Size& size, | 404 const gfx::Size& size, |
| 403 content::SessionStorageNamespace* session_storage_namespace); | 405 content::SessionStorageNamespace* session_storage_namespace); |
| 404 | 406 |
| 405 void StartSchedulingPeriodicCleanups(); | 407 void StartSchedulingPeriodicCleanups(); |
| 406 void StopSchedulingPeriodicCleanups(); | 408 void StopSchedulingPeriodicCleanups(); |
| 407 | 409 |
| 408 void EvictOldestPrerendersIfNecessary(); | 410 void EvictOldestPrerendersIfNecessary(); |
| 409 | 411 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 | 581 |
| 580 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 582 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 581 }; | 583 }; |
| 582 | 584 |
| 583 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( | 585 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( |
| 584 int render_process_id); | 586 int render_process_id); |
| 585 | 587 |
| 586 } // namespace prerender | 588 } // namespace prerender |
| 587 | 589 |
| 588 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 590 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |