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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 void OnLookupURL(scoped_ptr<CandidatePrerenderInfo> info); | 174 void OnLookupURL(scoped_ptr<CandidatePrerenderInfo> info); |
175 | 175 |
176 // Lookup the prerender candidate in the Prerender Service (if applicable). | 176 // Lookup the prerender candidate in the Prerender Service (if applicable). |
177 void DoPrerenderServiceCheck(scoped_ptr<CandidatePrerenderInfo> info); | 177 void DoPrerenderServiceCheck(scoped_ptr<CandidatePrerenderInfo> info); |
178 | 178 |
179 // Lookup the prerender candidate in the LoggedIn Predictor. | 179 // Lookup the prerender candidate in the LoggedIn Predictor. |
180 void DoLoggedInLookup(scoped_ptr<CandidatePrerenderInfo> info); | 180 void DoLoggedInLookup(scoped_ptr<CandidatePrerenderInfo> info); |
181 | 181 |
182 // Returns an element of issued_prerenders_, which should be replaced | 182 // Returns an element of issued_prerenders_, which should be replaced |
183 // by a new prerender of the priority indicated, or NULL, if the priority | 183 // by a new prerender of the priority indicated, or NULL, if the priority |
184 // is too low. | 184 // is too low (or if the URL requested is already prerendering). |
185 PrerenderProperties* GetIssuedPrerenderSlotForPriority(double priority); | 185 PrerenderProperties* GetIssuedPrerenderSlotForPriority(const GURL& url, |
| 186 double priority); |
186 | 187 |
187 void ContinuePrerenderCheck(scoped_ptr<CandidatePrerenderInfo> info); | 188 void ContinuePrerenderCheck(scoped_ptr<CandidatePrerenderInfo> info); |
188 void LogCandidateURLStats(const GURL& url) const; | 189 void LogCandidateURLStats(const GURL& url) const; |
189 void IssuePrerender(scoped_ptr<CandidatePrerenderInfo> info, | 190 void IssuePrerender(CandidatePrerenderInfo* info, |
190 scoped_ptr<LocalPredictorURLInfo> url_info, | 191 LocalPredictorURLInfo* url_info, |
191 PrerenderProperties* prerender_properties); | 192 PrerenderProperties* prerender_properties); |
192 void MaybeCancelURLFetcher(net::URLFetcher* fetcher); | 193 void MaybeCancelURLFetcher(net::URLFetcher* fetcher); |
193 // Returns true if the parsed response is semantically correct and could | 194 // Returns true if the parsed response is semantically correct and could |
194 // be fully applied. | 195 // be fully applied. |
195 bool ApplyParsedPrerenderServiceResponse( | 196 bool ApplyParsedPrerenderServiceResponse( |
196 base::DictionaryValue* dict, | 197 base::DictionaryValue* dict, |
197 CandidatePrerenderInfo* info, | 198 CandidatePrerenderInfo* info, |
198 bool* hinting_timed_out, | 199 bool* hinting_timed_out, |
199 bool* hinting_url_lookup_timed_out, | 200 bool* hinting_url_lookup_timed_out, |
200 bool* candidate_url_lookup_timed_out); | 201 bool* candidate_url_lookup_timed_out); |
(...skipping 25 matching lines...) Expand all Loading... |
226 base::hash_set<int64> url_whitelist_; | 227 base::hash_set<int64> url_whitelist_; |
227 | 228 |
228 base::WeakPtrFactory<PrerenderLocalPredictor> weak_factory_; | 229 base::WeakPtrFactory<PrerenderLocalPredictor> weak_factory_; |
229 | 230 |
230 DISALLOW_COPY_AND_ASSIGN(PrerenderLocalPredictor); | 231 DISALLOW_COPY_AND_ASSIGN(PrerenderLocalPredictor); |
231 }; | 232 }; |
232 | 233 |
233 } // namespace prerender | 234 } // namespace prerender |
234 | 235 |
235 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ | 236 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ |
OLD | NEW |