| 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 <list> | 10 #include <list> |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // caller-owned PrerenderHandle*, or NULL. | 125 // caller-owned PrerenderHandle*, or NULL. |
| 126 PrerenderHandle* AddPrerenderFromOmnibox( | 126 PrerenderHandle* AddPrerenderFromOmnibox( |
| 127 const GURL& url, | 127 const GURL& url, |
| 128 content::SessionStorageNamespace* session_storage_namespace, | 128 content::SessionStorageNamespace* session_storage_namespace, |
| 129 const gfx::Size& size); | 129 const gfx::Size& size); |
| 130 | 130 |
| 131 PrerenderHandle* AddPrerenderFromExternalRequest( | 131 PrerenderHandle* AddPrerenderFromExternalRequest( |
| 132 const GURL& url, | 132 const GURL& url, |
| 133 const content::Referrer& referrer, | 133 const content::Referrer& referrer, |
| 134 content::SessionStorageNamespace* session_storage_namespace, | 134 content::SessionStorageNamespace* session_storage_namespace, |
| 135 const gfx::Size& size); | 135 const gfx::Size& size, |
| 136 bool prerender_on_mobile); |
| 136 | 137 |
| 137 // Adds a prerender for Instant Search |url| if valid. The | 138 // Adds a prerender for Instant Search |url| if valid. The |
| 138 // |session_storage_namespace| matches the namespace of the active tab at the | 139 // |session_storage_namespace| matches the namespace of the active tab at the |
| 139 // time the prerender is generated. Returns a caller-owned PrerenderHandle* or | 140 // time the prerender is generated. Returns a caller-owned PrerenderHandle* or |
| 140 // NULL. | 141 // NULL. |
| 141 PrerenderHandle* AddPrerenderForInstant( | 142 PrerenderHandle* AddPrerenderForInstant( |
| 142 const GURL& url, | 143 const GURL& url, |
| 143 content::SessionStorageNamespace* session_storage_namespace, | 144 content::SessionStorageNamespace* session_storage_namespace, |
| 144 const gfx::Size& size); | 145 const gfx::Size& size); |
| 145 | 146 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 389 |
| 389 // Time window for which we record old navigations, in milliseconds. | 390 // Time window for which we record old navigations, in milliseconds. |
| 390 static const int kNavigationRecordWindowMs = 5000; | 391 static const int kNavigationRecordWindowMs = 5000; |
| 391 | 392 |
| 392 void OnCancelPrerenderHandle(PrerenderData* prerender_data); | 393 void OnCancelPrerenderHandle(PrerenderData* prerender_data); |
| 393 | 394 |
| 394 // Returns whether prerendering is currently enabled or the reason why it is | 395 // Returns whether prerendering is currently enabled or the reason why it is |
| 395 // disabled. | 396 // disabled. |
| 396 chrome_browser_net::NetworkPredictionStatus GetPredictionStatus() const; | 397 chrome_browser_net::NetworkPredictionStatus GetPredictionStatus() const; |
| 397 | 398 |
| 399 // Returns whether prerendering is currently enabled or the reason why it is |
| 400 // disabled after taking into account the origin of the request. |
| 401 chrome_browser_net::NetworkPredictionStatus GetPredictionStatusForOrigin( |
| 402 Origin origin) const; |
| 403 |
| 398 // Adds a prerender for |url| from |referrer|. The |origin| specifies how the | 404 // Adds a prerender for |url| from |referrer|. The |origin| specifies how the |
| 399 // prerender was added. If |size| is empty, then | 405 // prerender was added. If |size| is empty, then |
| 400 // PrerenderContents::StartPrerendering will instead use a default from | 406 // PrerenderContents::StartPrerendering will instead use a default from |
| 401 // PrerenderConfig. Returns a PrerenderHandle*, owned by the caller, or NULL. | 407 // PrerenderConfig. Returns a PrerenderHandle*, owned by the caller, or NULL. |
| 402 PrerenderHandle* AddPrerender( | 408 PrerenderHandle* AddPrerender( |
| 403 Origin origin, | 409 Origin origin, |
| 404 const GURL& url, | 410 const GURL& url, |
| 405 const content::Referrer& referrer, | 411 const content::Referrer& referrer, |
| 406 const gfx::Size& size, | 412 const gfx::Size& size, |
| 407 content::SessionStorageNamespace* session_storage_namespace); | 413 content::SessionStorageNamespace* session_storage_namespace); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 // Set of process hosts being prerendered. | 554 // Set of process hosts being prerendered. |
| 549 typedef std::set<content::RenderProcessHost*> PrerenderProcessSet; | 555 typedef std::set<content::RenderProcessHost*> PrerenderProcessSet; |
| 550 PrerenderProcessSet prerender_process_hosts_; | 556 PrerenderProcessSet prerender_process_hosts_; |
| 551 | 557 |
| 552 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 558 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 553 }; | 559 }; |
| 554 | 560 |
| 555 } // namespace prerender | 561 } // namespace prerender |
| 556 | 562 |
| 557 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 563 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |