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

Unified Diff: chrome/browser/browsing_data/history_counter.cc

Issue 1420013004: Polish the result communication and display of the browsing data counters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved Value() to FinishedResult. Created 5 years, 1 month 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: chrome/browser/browsing_data/history_counter.cc
diff --git a/chrome/browser/browsing_data/history_counter.cc b/chrome/browser/browsing_data/history_counter.cc
index ae1fbe1d3d8cfbfa7406f251686be8f17d4c3fda..116dba92b11181f748886936d75d4c6615245660 100644
--- a/chrome/browser/browsing_data/history_counter.cc
+++ b/chrome/browser/browsing_data/history_counter.cc
@@ -28,18 +28,6 @@ HistoryCounter::HistoryCounter() : pref_name_(prefs::kDeleteBrowsingHistory),
HistoryCounter::~HistoryCounter() {
}
-// Note that the local counting done by |VisitDatabase::GetHistoryCount|
-// returns an int, which is at most a signed 64-bit number. On the other hand,
-// ResultInt is an unsigned 64-bit number, so the range 2^63..2^64-1 is unused
-// and we can use it to encode special values.
-// static
-const BrowsingDataCounter::ResultInt HistoryCounter::kOnlySyncedHistory =
- std::numeric_limits<BrowsingDataCounter::ResultInt>::max();
-COMPILE_ASSERT(
- std::numeric_limits<int>::digits <
- std::numeric_limits<BrowsingDataCounter::ResultInt>::digits,
- "BrowsingDataCounter::ResultInt must be wider than int.");
-
const std::string& HistoryCounter::GetPrefName() const {
return pref_name_;
}
@@ -161,8 +149,17 @@ void HistoryCounter::MergeResults() {
if (!local_counting_finished_ || !web_counting_finished_)
return;
- if (!local_result_ && has_synced_visits_)
- ReportResult(kOnlySyncedHistory);
- else
- ReportResult(local_result_);
+ ReportResult(make_scoped_ptr(new HistoryResult(
+ this, local_result_, has_synced_visits_)));
+}
+
+HistoryCounter::HistoryResult::HistoryResult(
+ const HistoryCounter* source,
+ ResultInt value,
+ bool has_synced_visits)
+ : FinishedResult(source, value),
+ has_synced_visits_(has_synced_visits) {
+}
+
+HistoryCounter::HistoryResult::~HistoryResult() {
}

Powered by Google App Engine
This is Rietveld 408576698