| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/history/url_index_private_data.h" | 5 #include "chrome/browser/history/url_index_private_data.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <functional> | 8 #include <functional> | 
| 9 #include <iterator> | 9 #include <iterator> | 
| 10 #include <limits> | 10 #include <limits> | 
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 588         search_term_cache_[term] = SearchTermCacheItem(); | 588         search_term_cache_[term] = SearchTermCacheItem(); | 
| 589         return HistoryIDSet(); | 589         return HistoryIDSet(); | 
| 590       } | 590       } | 
| 591       word_id_set = best_prefix->second.word_id_set_; | 591       word_id_set = best_prefix->second.word_id_set_; | 
| 592       prefix_chars = Char16SetFromString16(best_prefix->first); | 592       prefix_chars = Char16SetFromString16(best_prefix->first); | 
| 593       leftovers = term.substr(prefix_length); | 593       leftovers = term.substr(prefix_length); | 
| 594     } | 594     } | 
| 595 | 595 | 
| 596     // Filter for each remaining, unique character in the term. | 596     // Filter for each remaining, unique character in the term. | 
| 597     Char16Set leftover_chars = Char16SetFromString16(leftovers); | 597     Char16Set leftover_chars = Char16SetFromString16(leftovers); | 
| 598     Char16Set unique_chars; | 598     Char16Set unique_chars = | 
| 599     std::set_difference(leftover_chars.begin(), leftover_chars.end(), | 599         base::STLSetDifference<Char16Set>(leftover_chars, prefix_chars); | 
| 600                         prefix_chars.begin(), prefix_chars.end(), |  | 
| 601                         std::inserter(unique_chars, unique_chars.begin())); |  | 
| 602 | 600 | 
| 603     // Reduce the word set with any leftover, unprocessed characters. | 601     // Reduce the word set with any leftover, unprocessed characters. | 
| 604     if (!unique_chars.empty()) { | 602     if (!unique_chars.empty()) { | 
| 605       WordIDSet leftover_set(WordIDSetForTermChars(unique_chars)); | 603       WordIDSet leftover_set(WordIDSetForTermChars(unique_chars)); | 
| 606       // We might come up empty on the leftovers. | 604       // We might come up empty on the leftovers. | 
| 607       if (leftover_set.empty()) { | 605       if (leftover_set.empty()) { | 
| 608         search_term_cache_[term] = SearchTermCacheItem(); | 606         search_term_cache_[term] = SearchTermCacheItem(); | 
| 609         return HistoryIDSet(); | 607         return HistoryIDSet(); | 
| 610       } | 608       } | 
| 611       // Or there may not have been a prefix from which to start. | 609       // Or there may not have been a prefix from which to start. | 
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1332   // recently visited (within the last 12/24 hours) as highly important. Get | 1330   // recently visited (within the last 12/24 hours) as highly important. Get | 
| 1333   // input from mpearson. | 1331   // input from mpearson. | 
| 1334   if (r1.typed_count() != r2.typed_count()) | 1332   if (r1.typed_count() != r2.typed_count()) | 
| 1335     return (r1.typed_count() > r2.typed_count()); | 1333     return (r1.typed_count() > r2.typed_count()); | 
| 1336   if (r1.visit_count() != r2.visit_count()) | 1334   if (r1.visit_count() != r2.visit_count()) | 
| 1337     return (r1.visit_count() > r2.visit_count()); | 1335     return (r1.visit_count() > r2.visit_count()); | 
| 1338   return (r1.last_visit() > r2.last_visit()); | 1336   return (r1.last_visit() > r2.last_visit()); | 
| 1339 } | 1337 } | 
| 1340 | 1338 | 
| 1341 }  // namespace history | 1339 }  // namespace history | 
| OLD | NEW | 
|---|