Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: chrome/browser/prerender/prerender_manager.h

Issue 13903018: Add the LoggedIn Predictor, to detect which websites a user is likely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix build break Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 predictors::LoggedInPredictorTable* logged_in_predictor_table() {
Shishir 2013/04/16 22:25:14 Consider returning the scoped_refptr
tburkard 2013/04/16 22:45:33 Not necessary since the idea is that people should
280 return logged_in_predictor_table_.get();
281 }
282
275 protected: 283 protected:
276 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { 284 class PrerenderData : public base::SupportsWeakPtr<PrerenderData> {
277 public: 285 public:
278 struct OrderByExpiryTime; 286 struct OrderByExpiryTime;
279 287
280 PrerenderData(PrerenderManager* manager, 288 PrerenderData(PrerenderManager* manager,
281 PrerenderContents* contents, 289 PrerenderContents* contents,
282 base::TimeTicks expiry_time); 290 base::TimeTicks expiry_time);
283 291
284 ~PrerenderData(); 292 ~PrerenderData();
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 ScopedVector<OnCloseWebContentsDeleter> on_close_web_contents_deleters_; 574 ScopedVector<OnCloseWebContentsDeleter> on_close_web_contents_deleters_;
567 575
568 scoped_ptr<PrerenderHistory> prerender_history_; 576 scoped_ptr<PrerenderHistory> prerender_history_;
569 577
570 std::list<const PrerenderCondition*> prerender_conditions_; 578 std::list<const PrerenderCondition*> prerender_conditions_;
571 579
572 scoped_ptr<PrerenderHistograms> histograms_; 580 scoped_ptr<PrerenderHistograms> histograms_;
573 581
574 scoped_ptr<PrerenderLocalPredictor> local_predictor_; 582 scoped_ptr<PrerenderLocalPredictor> local_predictor_;
575 583
584 scoped_refptr<predictors::LoggedInPredictorTable> logged_in_predictor_table_;
585
576 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 586 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
577 }; 587 };
578 588
579 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( 589 PrerenderManager* FindPrerenderManagerUsingRenderProcessId(
580 int render_process_id); 590 int render_process_id);
581 591
582 } // namespace prerender 592 } // namespace prerender
583 593
584 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 594 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698