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 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 namespace content { | 35 namespace content { |
36 class WebContents; | 36 class WebContents; |
37 } | 37 } |
38 | 38 |
39 namespace gfx { | 39 namespace gfx { |
40 class Size; | 40 class Size; |
41 } | 41 } |
42 | 42 |
| 43 namespace predictors { |
| 44 class LoggedInPredictorTable; |
| 45 } |
| 46 |
43 #if defined(COMPILER_GCC) | 47 #if defined(COMPILER_GCC) |
44 | 48 |
45 namespace BASE_HASH_NAMESPACE { | 49 namespace BASE_HASH_NAMESPACE { |
46 template <> | 50 template <> |
47 struct hash<content::WebContents*> { | 51 struct hash<content::WebContents*> { |
48 std::size_t operator()(content::WebContents* value) const { | 52 std::size_t operator()(content::WebContents* value) const { |
49 return reinterpret_cast<std::size_t>(value); | 53 return reinterpret_cast<std::size_t>(value); |
50 } | 54 } |
51 }; | 55 }; |
52 | 56 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 void RecordNavigation(const GURL& url); | 269 void RecordNavigation(const GURL& url); |
266 | 270 |
267 Profile* profile() const { return profile_; } | 271 Profile* profile() const { return profile_; } |
268 | 272 |
269 // Classes which will be tested in prerender unit browser tests should use | 273 // Classes which will be tested in prerender unit browser tests should use |
270 // these methods to get times for comparison, so that the test framework can | 274 // these methods to get times for comparison, so that the test framework can |
271 // mock advancing/retarding time. | 275 // mock advancing/retarding time. |
272 virtual base::Time GetCurrentTime() const; | 276 virtual base::Time GetCurrentTime() const; |
273 virtual base::TimeTicks GetCurrentTimeTicks() const; | 277 virtual base::TimeTicks GetCurrentTimeTicks() const; |
274 | 278 |
| 279 scoped_refptr<predictors::LoggedInPredictorTable> logged_in_predictor_table(); |
| 280 |
275 protected: | 281 protected: |
276 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { | 282 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { |
277 public: | 283 public: |
278 struct OrderByExpiryTime; | 284 struct OrderByExpiryTime; |
279 | 285 |
280 PrerenderData(PrerenderManager* manager, | 286 PrerenderData(PrerenderManager* manager, |
281 PrerenderContents* contents, | 287 PrerenderContents* contents, |
282 base::TimeTicks expiry_time); | 288 base::TimeTicks expiry_time); |
283 | 289 |
284 ~PrerenderData(); | 290 ~PrerenderData(); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 ScopedVector<OnCloseWebContentsDeleter> on_close_web_contents_deleters_; | 572 ScopedVector<OnCloseWebContentsDeleter> on_close_web_contents_deleters_; |
567 | 573 |
568 scoped_ptr<PrerenderHistory> prerender_history_; | 574 scoped_ptr<PrerenderHistory> prerender_history_; |
569 | 575 |
570 std::list<const PrerenderCondition*> prerender_conditions_; | 576 std::list<const PrerenderCondition*> prerender_conditions_; |
571 | 577 |
572 scoped_ptr<PrerenderHistograms> histograms_; | 578 scoped_ptr<PrerenderHistograms> histograms_; |
573 | 579 |
574 scoped_ptr<PrerenderLocalPredictor> local_predictor_; | 580 scoped_ptr<PrerenderLocalPredictor> local_predictor_; |
575 | 581 |
| 582 scoped_refptr<predictors::LoggedInPredictorTable> logged_in_predictor_table_; |
| 583 |
576 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); | 584 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); |
577 }; | 585 }; |
578 | 586 |
579 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( | 587 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( |
580 int render_process_id); | 588 int render_process_id); |
581 | 589 |
582 } // namespace prerender | 590 } // namespace prerender |
583 | 591 |
584 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ | 592 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ |
OLD | NEW |