| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // NOTE: New values need to be appended, since they are used in histograms. | 74 // NOTE: New values need to be appended, since they are used in histograms. |
| 75 enum PrerenderManagerMode { | 75 enum PrerenderManagerMode { |
| 76 PRERENDER_MODE_DISABLED = 0, | 76 PRERENDER_MODE_DISABLED = 0, |
| 77 PRERENDER_MODE_ENABLED = 1, | 77 PRERENDER_MODE_ENABLED = 1, |
| 78 PRERENDER_MODE_EXPERIMENT_CONTROL_GROUP = 2, | 78 PRERENDER_MODE_EXPERIMENT_CONTROL_GROUP = 2, |
| 79 PRERENDER_MODE_EXPERIMENT_PRERENDER_GROUP = 3, | 79 PRERENDER_MODE_EXPERIMENT_PRERENDER_GROUP = 3, |
| 80 // Obsolete: PRERENDER_MODE_EXPERIMENT_5MIN_TTL_GROUP = 4, | 80 // Obsolete: PRERENDER_MODE_EXPERIMENT_5MIN_TTL_GROUP = 4, |
| 81 PRERENDER_MODE_EXPERIMENT_NO_USE_GROUP = 5, | 81 PRERENDER_MODE_EXPERIMENT_NO_USE_GROUP = 5, |
| 82 PRERENDER_MODE_EXPERIMENT_MULTI_PRERENDER_GROUP = 6, | 82 PRERENDER_MODE_EXPERIMENT_MULTI_PRERENDER_GROUP = 6, |
| 83 PRERENDER_MODE_EXPERIMENT_15MIN_TTL_GROUP = 7, | 83 PRERENDER_MODE_EXPERIMENT_15MIN_TTL_GROUP = 7, |
| 84 PRERENDER_MODE_EXPERIMENT_MATCH_COMPLETE_GROUP = 8, | 84 // Obsolete: PRERENDER_MODE_EXPERIMENT_MATCH_COMPLETE_GROUP = 8, |
| 85 PRERENDER_MODE_MAX | 85 PRERENDER_MODE_MAX = 9 |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // One or more of these flags must be passed to ClearData() to specify just | 88 // One or more of these flags must be passed to ClearData() to specify just |
| 89 // what data to clear. See function declaration for more information. | 89 // what data to clear. See function declaration for more information. |
| 90 enum ClearFlags { | 90 enum ClearFlags { |
| 91 CLEAR_PRERENDER_CONTENTS = 0x1 << 0, | 91 CLEAR_PRERENDER_CONTENTS = 0x1 << 0, |
| 92 CLEAR_PRERENDER_HISTORY = 0x1 << 1, | 92 CLEAR_PRERENDER_HISTORY = 0x1 << 1, |
| 93 CLEAR_MAX = 0x1 << 2 | 93 CLEAR_MAX = 0x1 << 2 |
| 94 }; | 94 }; |
| 95 | 95 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { | 328 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { |
| 329 public: | 329 public: |
| 330 struct OrderByExpiryTime; | 330 struct OrderByExpiryTime; |
| 331 | 331 |
| 332 PrerenderData(PrerenderManager* manager, | 332 PrerenderData(PrerenderManager* manager, |
| 333 PrerenderContents* contents, | 333 PrerenderContents* contents, |
| 334 base::TimeTicks expiry_time); | 334 base::TimeTicks expiry_time); |
| 335 | 335 |
| 336 ~PrerenderData(); | 336 ~PrerenderData(); |
| 337 | 337 |
| 338 // Turn this PrerenderData into a Match Complete replacement for itself, | |
| 339 // placing the current prerender contents into |to_delete_prerenders_|. | |
| 340 void MakeIntoMatchCompleteReplacement(); | |
| 341 | |
| 342 // A new PrerenderHandle has been created for this PrerenderData. | 338 // A new PrerenderHandle has been created for this PrerenderData. |
| 343 void OnHandleCreated(PrerenderHandle* prerender_handle); | 339 void OnHandleCreated(PrerenderHandle* prerender_handle); |
| 344 | 340 |
| 345 // The launcher associated with a handle is navigating away from the context | 341 // The launcher associated with a handle is navigating away from the context |
| 346 // that launched this prerender. If the prerender is active, it may stay | 342 // that launched this prerender. If the prerender is active, it may stay |
| 347 // alive briefly though, in case we we going through a redirect chain that | 343 // alive briefly though, in case we we going through a redirect chain that |
| 348 // will eventually land at it. | 344 // will eventually land at it. |
| 349 void OnHandleNavigatedAway(PrerenderHandle* prerender_handle); | 345 void OnHandleNavigatedAway(PrerenderHandle* prerender_handle); |
| 350 | 346 |
| 351 // The launcher associated with a handle has taken explicit action to cancel | 347 // The launcher associated with a handle has taken explicit action to cancel |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 // Set of process hosts being prerendered. | 573 // Set of process hosts being prerendered. |
| 578 typedef std::set<content::RenderProcessHost*> PrerenderProcessSet; | 574 typedef std::set<content::RenderProcessHost*> PrerenderProcessSet; |
| 579 PrerenderProcessSet prerender_process_hosts_; | 575 PrerenderProcessSet prerender_process_hosts_; |
| 580 | 576 |
| 581 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 577 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 582 }; | 578 }; |
| 583 | 579 |
| 584 } // namespace prerender | 580 } // namespace prerender |
| 585 | 581 |
| 586 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 582 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |