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

Unified Diff: chrome/browser/autocomplete/history_provider.cc

Issue 8275004: Revert 105300 - HQP Refactoring (in Preparation for SQLite Cache) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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: chrome/browser/autocomplete/history_provider.cc
===================================================================
--- chrome/browser/autocomplete/history_provider.cc (revision 105312)
+++ chrome/browser/autocomplete/history_provider.cc (working copy)
@@ -31,16 +31,17 @@
profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
// Delete the match from the history DB.
- DCHECK(history_service);
- DCHECK(match.destination_url.is_valid());
- history_service->DeleteURL(match.destination_url);
- DeleteMatchFromMatches(match);
-}
+ GURL selected_url(match.destination_url);
+ if (!history_service || !selected_url.is_valid()) {
+ NOTREACHED() << "Can't delete requested URL";
+ return;
+ }
+ history_service->DeleteURL(selected_url);
-void HistoryProvider::DeleteMatchFromMatches(const AutocompleteMatch& match) {
+ // Delete the match from the current set of matches.
bool found = false;
for (ACMatches::iterator i(matches_.begin()); i != matches_.end(); ++i) {
- if (i->destination_url == match.destination_url && i->type == match.type) {
+ if (i->destination_url == selected_url && i->type == match.type) {
found = true;
if (i->is_history_what_you_typed_match || i->starred) {
// We can't get rid of What-You-Typed or Bookmarked matches,
« no previous file with comments | « chrome/browser/autocomplete/history_provider.h ('k') | chrome/browser/autocomplete/history_quick_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698