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

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

Issue 333273009: Don't call AutocompleteInput::Parse() on a background thread, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments Created 6 years, 6 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/autocomplete_input.cc
diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc
index fbf04db017fa5a90c6680d6a57aecba6c324f708..27edc397a6bb99ee8b06a51d6b58003ba5f1ea00 100644
--- a/chrome/browser/autocomplete/autocomplete_input.cc
+++ b/chrome/browser/autocomplete/autocomplete_input.cc
@@ -130,6 +130,11 @@ AutocompleteInput::Type AutocompleteInput::Parse(
url::Parsed* parts,
base::string16* scheme,
GURL* canonicalized_url) {
+ // NOT FOR COMMIT: Remove this once trybots make it clear no callers call this
Mark P 2014/06/19 21:35:14 Remember me.
+ // on a non-UI thread.
+ CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI) ||
+ !content::BrowserThread::IsThreadInitialized(content::BrowserThread::UI));
+
size_t first_non_white = text.find_first_not_of(base::kWhitespaceUTF16, 0);
if (first_non_white == base::string16::npos)
return metrics::OmniboxInputType::INVALID; // All whitespace.

Powered by Google App Engine
This is Rietveld 408576698