| Index: chrome/browser/android/ntp/ntp_snippets_bridge.cc
|
| diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
|
| index 89211d0d2b6f0483f8eac7bcf289ba92e9938af4..b1154ceb7fe7c429fdbc60cd003f62fc899a03ac 100644
|
| --- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
|
| +++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
|
| @@ -41,14 +41,14 @@
|
| : snippet_service_observer_(this) {
|
| Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile);
|
| ntp_snippets_service_ = NTPSnippetsServiceFactory::GetForProfile(profile);
|
| - snippet_service_observer_.Add(ntp_snippets_service_);
|
| }
|
|
|
| void NTPSnippetsBridge::SetObserver(JNIEnv* env,
|
| const JavaParamRef<jobject>& obj,
|
| const JavaParamRef<jobject>& j_observer) {
|
| observer_.Reset(env, j_observer);
|
| - NTPSnippetsServiceLoaded();
|
| + // This will call NTPSnippetsServiceLoaded.
|
| + snippet_service_observer_.Add(ntp_snippets_service_);
|
| }
|
|
|
| NTPSnippetsBridge::~NTPSnippetsBridge() {}
|
| @@ -65,8 +65,7 @@
|
| }
|
|
|
| void NTPSnippetsBridge::NTPSnippetsServiceLoaded() {
|
| - if (observer_.is_null())
|
| - return;
|
| + DCHECK(!observer_.is_null());
|
|
|
| std::vector<std::string> titles;
|
| std::vector<std::string> urls;
|
|
|