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

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

Issue 7741002: Add code to keep track of what fraction of pageviews are top sites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 FinalStatus final_status) const; 197 FinalStatus final_status) const;
198 198
199 const Config& config() const { return config_; } 199 const Config& config() const { return config_; }
200 Config& mutable_config() { return config_; } 200 Config& mutable_config() { return config_; }
201 201
202 PrerenderTracker* prerender_tracker() { return prerender_tracker_; } 202 PrerenderTracker* prerender_tracker() { return prerender_tracker_; }
203 203
204 // Adds a condition. This is owned by the PrerenderManager. 204 // Adds a condition. This is owned by the PrerenderManager.
205 void AddCondition(const PrerenderCondition* condition); 205 void AddCondition(const PrerenderCondition* condition);
206 206
207 bool IsTopSite(const GURL& url) const;
208
207 protected: 209 protected:
208 // Test that needs needs access to internal functions. 210 // Test that needs needs access to internal functions.
209 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ExpireTest); 211 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ExpireTest);
210 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ExtractURLInQueryStringTest); 212 FRIEND_TEST_ALL_PREFIXES(PrerenderManagerTest, ExtractURLInQueryStringTest);
211 213
212 struct PendingContentsData; 214 struct PendingContentsData;
213 215
214 void SetPrerenderContentsFactory( 216 void SetPrerenderContentsFactory(
215 PrerenderContents::Factory* prerender_contents_factory); 217 PrerenderContents::Factory* prerender_contents_factory);
216 218
217 PendingContentsData* FindPendingEntry(const GURL& url); 219 PendingContentsData* FindPendingEntry(const GURL& url);
218 220
219 private: 221 private:
220 // Test that needs needs access to internal functions. 222 // Test that needs needs access to internal functions.
221 friend class PrerenderBrowserTest; 223 friend class PrerenderBrowserTest;
222 224
223 friend class base::RefCountedThreadSafe<PrerenderManager>; 225 friend class base::RefCountedThreadSafe<PrerenderManager>;
224 226
225 struct PrerenderContentsData; 227 struct PrerenderContentsData;
226 struct NavigationRecord; 228 struct NavigationRecord;
227 229
228 class OnCloseTabContentsDeleter; 230 class OnCloseTabContentsDeleter;
229 231
232 class MostVisitedSites;
233
230 // Adds a prerender for |url| from referrer |referrer| initiated from the 234 // Adds a prerender for |url| from referrer |referrer| initiated from the
231 // RenderViewHost specified by |child_route_id_pair|. The |origin| specifies 235 // RenderViewHost specified by |child_route_id_pair|. The |origin| specifies
232 // how the prerender was added. 236 // how the prerender was added.
233 bool AddPrerender( 237 bool AddPrerender(
234 Origin origin, 238 Origin origin,
235 const std::pair<int, int>& child_route_id_pair, 239 const std::pair<int, int>& child_route_id_pair,
236 const GURL& url, 240 const GURL& url,
237 const GURL& referrer); 241 const GURL& referrer);
238 242
239 // Adds a pending preload issued by the prerendering RenderView identified by 243 // Adds a pending preload issued by the prerendering RenderView identified by
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 ScopedRunnableMethodFactory<PrerenderManager> runnable_method_factory_; 387 ScopedRunnableMethodFactory<PrerenderManager> runnable_method_factory_;
384 388
385 ScopedVector<OnCloseTabContentsDeleter> on_close_tab_contents_deleters_; 389 ScopedVector<OnCloseTabContentsDeleter> on_close_tab_contents_deleters_;
386 390
387 scoped_ptr<PrerenderHistory> prerender_history_; 391 scoped_ptr<PrerenderHistory> prerender_history_;
388 392
389 std::list<const PrerenderCondition*> prerender_conditions_; 393 std::list<const PrerenderCondition*> prerender_conditions_;
390 394
391 scoped_ptr<PrerenderHistograms> histograms_; 395 scoped_ptr<PrerenderHistograms> histograms_;
392 396
397 scoped_ptr<MostVisitedSites> most_visited_;
398
393 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 399 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
394 }; 400 };
395 401
396 } // namespace prerender 402 } // namespace prerender
397 403
398 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 404 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698