| 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_LOCAL_PREDICTOR_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 // A PrerenderLocalPredictor is owned by the PrerenderManager specified | 151 // A PrerenderLocalPredictor is owned by the PrerenderManager specified |
| 152 // in the constructor. It will be destoryed at the time its owning | 152 // in the constructor. It will be destoryed at the time its owning |
| 153 // PrerenderManager is destroyed. | 153 // PrerenderManager is destroyed. |
| 154 explicit PrerenderLocalPredictor(PrerenderManager* prerender_manager); | 154 explicit PrerenderLocalPredictor(PrerenderManager* prerender_manager); |
| 155 virtual ~PrerenderLocalPredictor(); | 155 virtual ~PrerenderLocalPredictor(); |
| 156 | 156 |
| 157 void Shutdown(); | 157 void Shutdown(); |
| 158 | 158 |
| 159 // history::VisitDatabaseObserver implementation | 159 // history::VisitDatabaseObserver implementation |
| 160 virtual void OnAddVisit(const history::BriefVisitInfo& info) OVERRIDE; | 160 virtual void OnAddVisit(const history::BriefVisitInfo& info) override; |
| 161 | 161 |
| 162 void OnGetInitialVisitHistory( | 162 void OnGetInitialVisitHistory( |
| 163 scoped_ptr<std::vector<history::BriefVisitInfo> > visit_history); | 163 scoped_ptr<std::vector<history::BriefVisitInfo> > visit_history); |
| 164 | 164 |
| 165 void OnPLTEventForURL(const GURL& url, base::TimeDelta page_load_time); | 165 void OnPLTEventForURL(const GURL& url, base::TimeDelta page_load_time); |
| 166 | 166 |
| 167 void OnTabHelperURLSeen(const GURL& url, content::WebContents* web_contents); | 167 void OnTabHelperURLSeen(const GURL& url, content::WebContents* web_contents); |
| 168 | 168 |
| 169 // net::URLFetcherDelegate implementation: | 169 // net::URLFetcherDelegate implementation: |
| 170 void virtual OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 170 void virtual OnURLFetchComplete(const net::URLFetcher* source) override; |
| 171 | 171 |
| 172 private: | 172 private: |
| 173 struct PrerenderProperties; | 173 struct PrerenderProperties; |
| 174 HistoryService* GetHistoryIfExists() const; | 174 HistoryService* GetHistoryIfExists() const; |
| 175 void Init(); | 175 void Init(); |
| 176 bool IsPrerenderStillValid(PrerenderProperties* prerender) const; | 176 bool IsPrerenderStillValid(PrerenderProperties* prerender) const; |
| 177 bool DoesPrerenderMatchPLTRecord(PrerenderProperties* prerender, | 177 bool DoesPrerenderMatchPLTRecord(PrerenderProperties* prerender, |
| 178 const GURL& url, | 178 const GURL& url, |
| 179 base::TimeDelta plt) const; | 179 base::TimeDelta plt) const; |
| 180 void RecordEvent(Event event) const; | 180 void RecordEvent(Event event) const; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 base::WeakPtrFactory<PrerenderLocalPredictor> weak_factory_; | 236 base::WeakPtrFactory<PrerenderLocalPredictor> weak_factory_; |
| 237 | 237 |
| 238 scoped_ptr<PrefetchList> prefetch_list_; | 238 scoped_ptr<PrefetchList> prefetch_list_; |
| 239 | 239 |
| 240 DISALLOW_COPY_AND_ASSIGN(PrerenderLocalPredictor); | 240 DISALLOW_COPY_AND_ASSIGN(PrerenderLocalPredictor); |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 } // namespace prerender | 243 } // namespace prerender |
| 244 | 244 |
| 245 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ | 245 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ |
| OLD | NEW |