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

Unified Diff: components/omnibox/browser/verbatim_match.cc

Issue 2124563002: Don't try to create a verbatim match with an empty input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: components/omnibox/browser/verbatim_match.cc
diff --git a/components/omnibox/browser/verbatim_match.cc b/components/omnibox/browser/verbatim_match.cc
index c74cf1e833e2e34242684793cea6c083b34e9785..451ce96e32b626f77020b8ea3b3b5e399d5f9bda 100644
--- a/components/omnibox/browser/verbatim_match.cc
+++ b/components/omnibox/browser/verbatim_match.cc
@@ -4,6 +4,7 @@
#include "components/omnibox/browser/verbatim_match.h"
+#include "base/logging.h"
#include "components/omnibox/browser/autocomplete_classifier.h"
#include "components/omnibox/browser/autocomplete_input.h"
#include "components/omnibox/browser/autocomplete_provider_client.h"
@@ -17,6 +18,7 @@ AutocompleteMatch VerbatimMatchForURL(
const GURL& destination_url,
HistoryURLProvider* history_url_provider,
int verbatim_relevance) {
+ DCHECK(input.text().length());
sdefresne 2016/07/05 10:08:56 nit: I would use DCHECK(!input.text().empty())
jif 2016/07/11 15:09:36 Done.
AutocompleteMatch match;
// If query-in-the-omnibox is not enabled (and thus the verbatim match for
// a URL is guaranteed to be a URL) and the caller already knows where the

Powered by Google App Engine
This is Rietveld 408576698