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

Unified Diff: components/history/core/browser/top_sites_backend.h

Issue 1005873011: Only record the execution time during startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move the static to TopSitesImpl Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/history/core/browser/top_sites_backend.h
diff --git a/components/history/core/browser/top_sites_backend.h b/components/history/core/browser/top_sites_backend.h
index d3c054b81032026a27077b0837323c028fba7eaf..ad0d9a98f0d02a130bed3683ae1c4b8ac43dbf92 100644
--- a/components/history/core/browser/top_sites_backend.h
+++ b/components/history/core/browser/top_sites_backend.h
@@ -26,6 +26,15 @@ class TopSitesDatabase;
// thread.
class TopSitesBackend : public base::RefCountedThreadSafe<TopSitesBackend> {
public:
+ // TODO(yiyaoliu): Remove the enums and related code when crbug/223430 is
+ // fixed.
+ // An enum representing whether the UpdateTopSites execution time related
+ // histogram should be recorded.
+ enum RecordHistogram {
+ RECORD_HISTOGRAM_YES,
+ RECORD_HISTOGRAM_NO
+ };
+
// The boolean parameter indicates if the DB existed on disk or needs to be
// migrated.
typedef base::Callback<void(const scoped_refptr<MostVisitedThumbnails>&)>
@@ -45,7 +54,8 @@ class TopSitesBackend : public base::RefCountedThreadSafe<TopSitesBackend> {
base::CancelableTaskTracker* tracker);
// Updates top sites database from the specified delta.
- void UpdateTopSites(const TopSitesDelta& delta);
+ void UpdateTopSites(const TopSitesDelta& delta,
+ const RecordHistogram record_or_not);
// Sets the thumbnail.
void SetPageThumbnail(const MostVisitedURL& url,
@@ -77,7 +87,8 @@ class TopSitesBackend : public base::RefCountedThreadSafe<TopSitesBackend> {
scoped_refptr<MostVisitedThumbnails> thumbnails);
// Updates top sites.
- void UpdateTopSitesOnDBThread(const TopSitesDelta& delta);
+ void UpdateTopSitesOnDBThread(const TopSitesDelta& delta,
+ const RecordHistogram record_or_not);
// Sets the thumbnail.
void SetPageThumbnailOnDBThread(const MostVisitedURL& url,

Powered by Google App Engine
This is Rietveld 408576698