diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 15:27:40 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 15:27:40 +0000 |
commit | 3d1de1db2571b745ac393b64033fc9c1cad8b7b8 (patch) | |
tree | f383668755e268dbc8186be54aed8413dad30f9b /chrome/browser/dom_ui/most_visited_handler.cc | |
parent | 51c07140c9533c09f348d9fc7dfe5aea6341e618 (diff) | |
download | chromium_src-3d1de1db2571b745ac393b64033fc9c1cad8b7b8.zip chromium_src-3d1de1db2571b745ac393b64033fc9c1cad8b7b8.tar.gz chromium_src-3d1de1db2571b745ac393b64033fc9c1cad8b7b8.tar.bz2 |
Make sure TopSites is only created if enabled. TopSites was getting
created by the MostVisitedHandler and triggering a DCHECK because it
attempts to lookup the history server from the wrong thread.
BUG=57595
TEST=none
Review URL: http://codereview.chromium.org/3606015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/most_visited_handler.cc')
-rw-r--r-- | chrome/browser/dom_ui/most_visited_handler.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/dom_ui/most_visited_handler.cc b/chrome/browser/dom_ui/most_visited_handler.cc index 95d326f..671cdb9 100644 --- a/chrome/browser/dom_ui/most_visited_handler.cc +++ b/chrome/browser/dom_ui/most_visited_handler.cc @@ -132,13 +132,17 @@ void MostVisitedHandler::HandleGetMostVisited(const ListValue* args) { void MostVisitedHandler::SendPagesValue() { if (pages_value_.get()) { - history::TopSites* ts = dom_ui_->GetProfile()->GetTopSites(); + bool has_blacklisted_urls = !url_blacklist_->empty(); + if (history::TopSites::IsEnabled()) { + history::TopSites* ts = dom_ui_->GetProfile()->GetTopSites(); + has_blacklisted_urls = ts->HasBlacklistedItems(); + } FundamentalValue first_run(IsFirstRun()); - FundamentalValue has_blacklisted_urls(ts->HasBlacklistedItems()); + FundamentalValue has_blacklisted_urls_value(has_blacklisted_urls); dom_ui_->CallJavascriptFunction(L"mostVisitedPages", *(pages_value_.get()), first_run, - has_blacklisted_urls); + has_blacklisted_urls_value); pages_value_.reset(); } } |