| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 class PrerenderInProcessBrowserTest; | 64 class PrerenderInProcessBrowserTest; |
| 65 } | 65 } |
| 66 | 66 |
| 67 class PrerenderHandle; | 67 class PrerenderHandle; |
| 68 class PrerenderHistory; | 68 class PrerenderHistory; |
| 69 class PrerenderLocalPredictor; | 69 class PrerenderLocalPredictor; |
| 70 | 70 |
| 71 // PrerenderManager is responsible for initiating and keeping prerendered | 71 // PrerenderManager is responsible for initiating and keeping prerendered |
| 72 // views of web pages. All methods must be called on the UI thread unless | 72 // views of web pages. All methods must be called on the UI thread unless |
| 73 // indicated otherwise. | 73 // indicated otherwise. |
| 74 class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>, | 74 class PrerenderManager : public content::NotificationObserver, |
| 75 public content::NotificationObserver, | |
| 76 public content::RenderProcessHostObserver, | 75 public content::RenderProcessHostObserver, |
| 77 public KeyedService, | 76 public KeyedService, |
| 78 public MediaCaptureDevicesDispatcher::Observer { | 77 public MediaCaptureDevicesDispatcher::Observer { |
| 79 public: | 78 public: |
| 80 // NOTE: New values need to be appended, since they are used in histograms. | 79 // NOTE: New values need to be appended, since they are used in histograms. |
| 81 enum PrerenderManagerMode { | 80 enum PrerenderManagerMode { |
| 82 PRERENDER_MODE_DISABLED = 0, | 81 PRERENDER_MODE_DISABLED = 0, |
| 83 PRERENDER_MODE_ENABLED = 1, | 82 PRERENDER_MODE_ENABLED = 1, |
| 84 PRERENDER_MODE_EXPERIMENT_CONTROL_GROUP = 2, | 83 PRERENDER_MODE_EXPERIMENT_CONTROL_GROUP = 2, |
| 85 PRERENDER_MODE_EXPERIMENT_PRERENDER_GROUP = 3, | 84 PRERENDER_MODE_EXPERIMENT_PRERENDER_GROUP = 3, |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 // PrerenderManager is attached to. | 580 // PrerenderManager is attached to. |
| 582 int64_t profile_network_bytes_; | 581 int64_t profile_network_bytes_; |
| 583 | 582 |
| 584 // The value of profile_network_bytes_ that was last recorded. | 583 // The value of profile_network_bytes_ that was last recorded. |
| 585 int64_t last_recorded_profile_network_bytes_; | 584 int64_t last_recorded_profile_network_bytes_; |
| 586 | 585 |
| 587 // Set of process hosts being prerendered. | 586 // Set of process hosts being prerendered. |
| 588 using PrerenderProcessSet = std::set<content::RenderProcessHost*>; | 587 using PrerenderProcessSet = std::set<content::RenderProcessHost*>; |
| 589 PrerenderProcessSet prerender_process_hosts_; | 588 PrerenderProcessSet prerender_process_hosts_; |
| 590 | 589 |
| 590 base::WeakPtrFactory<PrerenderManager> weak_factory_; |
| 591 |
| 591 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 592 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
| 592 }; | 593 }; |
| 593 | 594 |
| 594 } // namespace prerender | 595 } // namespace prerender |
| 595 | 596 |
| 596 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 597 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
| OLD | NEW |