Chromium Code Reviews| 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; |