Commit aa1b8866 authored by sfiera's avatar sfiera Committed by Commit bot

Allow top_sites to be null.

iOS wants it for tests. Everywhere we use top_sites_, we check for its
non-null-ness.

BUG=631990

Review-Url: https://codereview.chromium.org/2395483002
Cr-Commit-Position: refs/heads/master@{#422821}
parent c39ce79a
......@@ -159,7 +159,8 @@ MostVisitedSites::MostVisitedSites(PrefService* prefs,
mv_source_(NTPTileSource::SUGGESTIONS_SERVICE),
weak_ptr_factory_(this) {
DCHECK(prefs_);
DCHECK(top_sites_);
// top_sites_ can be null in tests.
// TODO(sfiera): have iOS use a dummy TopSites in its tests.
DCHECK(suggestions_service_);
if (supervisor_)
supervisor_->SetObserver(this);
......
......@@ -113,8 +113,8 @@ class MostVisitedSites : public history::TopSitesObserver,
// Construct a MostVisitedSites instance.
//
// |prefs|, |top_sites|, and |suggestions| are required and may not be null.
// |popular_sites| and |supervisor| are optional and if null the associated
// |prefs| and |suggestions| are required and may not be null. |top_sites|,
// |popular_sites|, and |supervisor| are optional and if null the associated
// features will be disabled.
MostVisitedSites(PrefService* prefs,
scoped_refptr<history::TopSites> top_sites,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment