| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // Must not be called for prefetch loads (which are never rendered anyway). | 210 // Must not be called for prefetch loads (which are never rendered anyway). |
| 211 // |is_no_store| must be true if the main resource has a "no-store" cache | 211 // |is_no_store| must be true if the main resource has a "no-store" cache |
| 212 // control HTTP header. | 212 // control HTTP header. |
| 213 void RecordFirstContentfulPaint(const GURL& url, | 213 void RecordFirstContentfulPaint(const GURL& url, |
| 214 bool is_no_store, | 214 bool is_no_store, |
| 215 base::TimeDelta time); | 215 base::TimeDelta time); |
| 216 | 216 |
| 217 static PrerenderManagerMode GetMode(); | 217 static PrerenderManagerMode GetMode(); |
| 218 static void SetMode(PrerenderManagerMode mode); | 218 static void SetMode(PrerenderManagerMode mode); |
| 219 static bool IsPrerenderingPossible(); | 219 static bool IsPrerenderingPossible(); |
| 220 static bool IsNoStatePrefetch(); | 220 static bool IsNoStatePrefetch(Origin origin); |
| 221 static bool IsSimpleLoadExperiment(); | 221 static bool IsSimpleLoadExperiment(Origin origin); |
| 222 | 222 |
| 223 // Query the list of current prerender pages to see if the given web contents | 223 // Query the list of current prerender pages to see if the given web contents |
| 224 // is prerendering a page. The optional parameter |origin| is an output | 224 // is prerendering a page. The optional parameter |origin| is an output |
| 225 // parameter which, if a prerender is found, is set to the Origin of the | 225 // parameter which, if a prerender is found, is set to the Origin of the |
| 226 // prerender |web_contents|. | 226 // prerender |web_contents|. |
| 227 bool IsWebContentsPrerendering(const content::WebContents* web_contents, | 227 bool IsWebContentsPrerendering(const content::WebContents* web_contents, |
| 228 Origin* origin) const; | 228 Origin* origin) const; |
| 229 | 229 |
| 230 // Whether the PrerenderManager has an active prerender with the given url and | 230 // Whether the PrerenderManager has an active prerender with the given url and |
| 231 // SessionStorageNamespace associated with the given WebContents. | 231 // SessionStorageNamespace associated with the given WebContents. |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 std::unique_ptr<base::TickClock> tick_clock_; | 598 std::unique_ptr<base::TickClock> tick_clock_; |
| 599 | 599 |
| 600 base::WeakPtrFactory<PrerenderManager> weak_factory_; | 600 base::WeakPtrFactory<PrerenderManager> weak_factory_; |
| 601 | 601 |
| 602 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 602 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 603 }; | 603 }; |
| 604 | 604 |
| 605 } // namespace prerender | 605 } // namespace prerender |
| 606 | 606 |
| 607 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 607 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |