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

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

Issue 9347030: Add DCHECK that HistoryURLProvider is on the main thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Passes try bots. Created 8 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/history_url_provider.cc
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index d901d4d9aa74456f65ef1be8adf1400fd7037d61..e79651c7a1bc9132090b69751a9a78b9a2d010fe 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -26,6 +26,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "content/public/browser/browser_thread.h"
#include "googleurl/src/gurl.h"
#include "googleurl/src/url_parse.h"
#include "googleurl/src/url_util.h"
@@ -347,6 +348,17 @@ HistoryURLProvider::HistoryURLProvider(ACProviderListener* listener,
LOG(ERROR) << "Making automatic.";
}
// Automatic means eligible for the field trial.
+ // For the field trial stuff to work correctly, we must be running
Peter Kasting 2012/02/09 21:51:19 I wonder if the field trial is the only requiremen
mrossetti 2012/02/09 21:58:58 I was considering suggesting that the DCHECK be pl
Mark P 2012/02/09 22:17:47 I think we should pepper our code with these DCHEC
+ // on the same thread as the thread that created the field trial,
+ // which happens via a call to AutocompleteFieldTrial::Active in
+ // chrome_browser_main.cc on the main thread. Let's check this to
+ // be sure. We check "if we've heard of the UI thread then we'd better
+ // be on it." The first part is necessary so unit tests pass. (Many
+ // unit tests don't set up the threading naming system; hence
+ // CurrentlyOn(UI thread will fail.)
Peter Kasting 2012/02/09 21:51:19 Nit: Missing paren after "thread"
Mark P 2012/02/09 22:17:47 Fixed.
+ DCHECK(!content::BrowserThread::IsWellKnownThread(
+ content::BrowserThread::UI) ||
+ content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (AutocompleteFieldTrial::InAggressiveHUPFieldTrial()) {
if (AutocompleteFieldTrial::InAggressiveHUPFieldTrialExperimentGroup()) {
enable_aggressive_scoring_ = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698