Index: chrome/browser/ui/webui/history_ui.cc |
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc |
index fc18ebabb398254c7e422c91f8e28783be3ea7ee..9b060b7749a29eaf12497485e14bc7f807b71c7a 100644 |
--- a/chrome/browser/ui/webui/history_ui.cc |
+++ b/chrome/browser/ui/webui/history_ui.cc |
@@ -821,24 +821,26 @@ void BrowsingHistoryHandler::ReturnResultsToFrontEnd() { |
// Combine the local and remote results into |query_results_|, and remove |
// any duplicates. |
- if (query_results_.size() && web_history_query_results_.size()) { |
- // Each result set covers a particular time range. Determine the |
- // intersection of the two time ranges, discard any entries from either |
- // set the are older than that, and then combine the results. |
- base::Time cutoff_time = std::max(query_results_.back().time, |
- web_history_query_results_.back().time); |
- RemoveOlderEntries(&query_results_, cutoff_time); |
- RemoveOlderEntries(&web_history_query_results_, cutoff_time); |
- |
+ if (web_history_query_results_.size()) { |
int local_result_count = query_results_.size(); |
Joao da Silva
2013/03/25 13:13:59
|local_result_count| used to be calculated after r
Patrick Dubroy
2013/03/25 14:30:51
Good catch, fixed.
|
+ if (local_result_count) { |
+ // Each result set covers a particular time range. Determine the |
+ // intersection of the two time ranges, discard any entries from either |
+ // set the are older than that, and then combine the results. |
Joao da Silva
2013/03/25 13:13:59
"from either set the are older than that" -> "from
Patrick Dubroy
2013/03/25 14:30:51
Done.
|
+ base::Time cutoff_time = std::max( |
+ query_results_.back().time, |
+ web_history_query_results_.back().time); |
+ RemoveOlderEntries(&query_results_, cutoff_time); |
+ RemoveOlderEntries(&web_history_query_results_, cutoff_time); |
+ } |
query_results_.insert(query_results_.end(), |
web_history_query_results_.begin(), |
web_history_query_results_.end()); |
- RemoveDuplicateResults(&query_results_); |
- |
- // In the best case, we expect that all local results are duplicated on the |
- // server. Keep track of how many are missing. |
if (local_result_count) { |
+ RemoveDuplicateResults(&query_results_); |
+ |
+ // In the best case, we expect that all local results are duplicated on |
+ // the server. Keep track of how many are missing. |
int missing_count = std::count_if( |
query_results_.begin(), query_results_.end(), IsLocalOnlyResult); |
UMA_HISTOGRAM_PERCENTAGE("WebHistory.LocalResultMissingOnServer", |