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

Unified Diff: components/offline_pages/content/suggested_articles_observer.cc

Issue 2848703004: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: rev Created 3 years, 8 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
Index: components/offline_pages/content/suggested_articles_observer.cc
diff --git a/components/offline_pages/content/suggested_articles_observer.cc b/components/offline_pages/content/suggested_articles_observer.cc
index 3479ba81d189420f6e222d31cd6e96e8633e3056..69d85a075645a36bc255d8c42ef152517f4a0270 100644
--- a/components/offline_pages/content/suggested_articles_observer.cc
+++ b/components/offline_pages/content/suggested_articles_observer.cc
@@ -76,11 +76,8 @@ void SuggestedArticlesObserver::ObserveContentSuggestionsService(
auto suggestions_observer = base::MakeUnique<SuggestedArticlesObserver>(
browser_context, base::MakeUnique<DefaultDelegate>(service));
service->AddObserver(suggestions_observer.get());
- service->SetUserData(
- &kOfflinePageSuggestedArticlesObserverUserDataKey,
- // Note that |service| will take ownership of suggestions_observer
- // despite accepting a raw pointer.
- suggestions_observer.release());
+ service->SetUserData(&kOfflinePageSuggestedArticlesObserverUserDataKey,
+ std::move(suggestions_observer));
}
SuggestedArticlesObserver::SuggestedArticlesObserver(

Powered by Google App Engine
This is Rietveld 408576698