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

Unified Diff: chrome/browser/ui/webui/history_ui.cc

Issue 12930011: History: Include search term in queries to history server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address joao's comments. Created 7 years, 9 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 | « chrome/browser/history/web_history_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a1c7dc20200c1b33ad687ad41206ae3da5b45ca5 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -821,28 +821,30 @@ 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);
-
- int local_result_count = query_results_.size();
+ if (web_history_query_results_.size()) {
Dan Beam 2013/03/25 21:09:19 size() -> !empty()
Patrick Dubroy 2013/03/25 21:18:49 Done.
+ if (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 that 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);
+ }
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) {
+ if (query_results_.size()) {
Dan Beam 2013/03/25 21:09:19 ^ wont this always be non-empty now?
Patrick Dubroy 2013/03/25 21:18:49 Nope, RemoveOlderEntries might actually make it em
Dan Beam 2013/03/25 21:27:02 but there's a "querty_results_.insert()" call righ
Patrick Dubroy 2013/03/25 21:31:56 Yeah, you're right. Fixed.
+ 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",
- missing_count * 100.0 / local_result_count);
+ missing_count * 100.0 / query_results_.size());
}
}
« no previous file with comments | « chrome/browser/history/web_history_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698