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

Unified Diff: chrome/browser/history/history_backend.h

Issue 16517002: Track fraction of visits to top URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made UMA-related functions into members Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_backend.h
diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h
index a55d6eb4b38e6613c2dff5c673b70e02e153a70f..dcf668790bcaaf865c6d48bba1489e1f628f81ff 100644
--- a/chrome/browser/history/history_backend.h
+++ b/chrome/browser/history/history_backend.h
@@ -578,6 +578,18 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
#if defined(OS_ANDROID)
// Returns the name of android cache database.
base::FilePath GetAndroidCacheFileName() const;
+
+ // Populate a map from a |MostVisitedURLList|. The map assigns a rank to each
+ // top URL and its redirects. This should only be done once at backend
+ // initialization.
+ // This can be removed for M31. (See issue 248761.)
+
+ void PopulateMostVisitedURLMap();
+ // Record counts of page visits by rank. If a url is not ranked, record the
+ // page visit in a slot corresponding to |max_top_url_count|, which should
+ // be one greater than the largest rank of any url in |top_urls|.
+ // This can be removed for M31. (See issue 248761.)
+ void RecordTopPageVisitStats(const GURL& url);
#endif
class URLQuerier;
@@ -909,6 +921,12 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
#if defined(OS_ANDROID)
// Used to provide the Android ContentProvider APIs.
scoped_ptr<AndroidProviderBackend> android_provider_backend_;
+
+ // Used to provide UMA on the number of page visits that are to the most
+ // visited URLs. This is here because the backend both has access to this
+ // information and is notified of page visits. The top sites service should
+ // be used instead whenever possible.
+ std::map<GURL, int> most_visited_urls_map_;
#endif
// Used to manage syncing of the typed urls datatype. This will be NULL
« no previous file with comments | « no previous file | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698