| 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 |
| 11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
| 15 #include "chrome/browser/common/cancelable_request.h" | 15 #include "base/task/cancelable_task_tracker.h" |
| 16 #include "chrome/browser/history/visit_database.h" | 16 #include "chrome/browser/history/visit_database.h" |
| 17 #include "content/public/browser/session_storage_namespace.h" | 17 #include "content/public/browser/session_storage_namespace.h" |
| 18 #include "net/url_request/url_fetcher_delegate.h" | 18 #include "net/url_request/url_fetcher_delegate.h" |
| 19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 20 | 20 |
| 21 class HistoryService; | 21 class HistoryService; |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 class DictionaryValue; | 24 class DictionaryValue; |
| 25 } | 25 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 base::OneShotTimer<PrerenderLocalPredictor> timer_; | 208 base::OneShotTimer<PrerenderLocalPredictor> timer_; |
| 209 | 209 |
| 210 // Delay after which to initialize, to avoid putting to much load on the | 210 // Delay after which to initialize, to avoid putting to much load on the |
| 211 // database thread early on when Chrome is starting up. | 211 // database thread early on when Chrome is starting up. |
| 212 static const int kInitDelayMs = 5 * 1000; | 212 static const int kInitDelayMs = 5 * 1000; |
| 213 | 213 |
| 214 // Whether we're registered with the history service as a | 214 // Whether we're registered with the history service as a |
| 215 // history::VisitDatabaseObserver. | 215 // history::VisitDatabaseObserver. |
| 216 bool is_visit_database_observer_; | 216 bool is_visit_database_observer_; |
| 217 | 217 |
| 218 CancelableRequestConsumer history_db_consumer_; | 218 base::CancelableTaskTracker history_db_tracker_; |
| 219 | 219 |
| 220 scoped_ptr<std::vector<history::BriefVisitInfo> > visit_history_; | 220 scoped_ptr<std::vector<history::BriefVisitInfo> > visit_history_; |
| 221 | 221 |
| 222 scoped_ptr<PrerenderProperties> current_prerender_; | 222 scoped_ptr<PrerenderProperties> current_prerender_; |
| 223 scoped_ptr<PrerenderProperties> last_swapped_in_prerender_; | 223 scoped_ptr<PrerenderProperties> last_swapped_in_prerender_; |
| 224 | 224 |
| 225 ScopedVector<PrerenderProperties> issued_prerenders_; | 225 ScopedVector<PrerenderProperties> issued_prerenders_; |
| 226 | 226 |
| 227 base::hash_set<int64> url_whitelist_; | 227 base::hash_set<int64> url_whitelist_; |
| 228 | 228 |
| 229 base::WeakPtrFactory<PrerenderLocalPredictor> weak_factory_; | 229 base::WeakPtrFactory<PrerenderLocalPredictor> weak_factory_; |
| 230 | 230 |
| 231 DISALLOW_COPY_AND_ASSIGN(PrerenderLocalPredictor); | 231 DISALLOW_COPY_AND_ASSIGN(PrerenderLocalPredictor); |
| 232 }; | 232 }; |
| 233 | 233 |
| 234 } // namespace prerender | 234 } // namespace prerender |
| 235 | 235 |
| 236 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ | 236 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ |
| OLD | NEW |