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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 2368583002: [NTP Snippets] Cleanups from clang-tidy (Closed)
Patch Set: Created 4 years, 3 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/ntp_snippets/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index 1bb40f4ddc8c77e9919548ea6352b347552144cc..012ca76680e848e49a3ebff5a6fb145d99ce4075 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -188,8 +188,7 @@ NTPSnippetsService::NTPSnippetsService(
base::Unretained(this)));
}
-NTPSnippetsService::~NTPSnippetsService() {
-}
+NTPSnippetsService::~NTPSnippetsService() = default;
// static
void NTPSnippetsService::RegisterProfilePrefs(PrefRegistrySimple* registry) {
@@ -482,7 +481,7 @@ void NTPSnippetsService::OnSuggestionsChanged(
// for its callback.
NotifyNewSuggestions();
- FetchSnippetsFromHosts(hosts, /*force_request=*/false);
+ FetchSnippetsFromHosts(hosts, /*interactive_request=*/false);
}
void NTPSnippetsService::OnFetchFinished(
@@ -751,9 +750,8 @@ void NTPSnippetsService::OnSnippetImageFetchedFromDatabase(
// |image_decoder_| is null in tests.
if (image_decoder_ && !data.empty()) {
image_decoder_->DecodeImage(
- std::move(data),
- base::Bind(&NTPSnippetsService::OnSnippetImageDecodedFromDatabase,
- base::Unretained(this), callback, suggestion_id));
+ data, base::Bind(&NTPSnippetsService::OnSnippetImageDecodedFromDatabase,
sfiera 2016/09/23 16:51:04 Because DecodeImage takes a const std::string&, so
Marc Treib 2016/09/23 16:53:06 Good point, I could have mentioned that one :)
+ base::Unretained(this), callback, suggestion_id));
return;
}
@@ -806,7 +804,7 @@ void NTPSnippetsService::FetchSnippetImageFromNetwork(
return;
}
- const NTPSnippet& snippet = *it->get();
+ const NTPSnippet& snippet = **it;
// TODO(jkrcal): We probably should rename OnImageDataFetched() to
// CacheImageData(). This would document that this is actually independent
@@ -840,7 +838,7 @@ void NTPSnippetsService::EnterStateReady() {
// Either add a DCHECK here that we actually are allowed to do network I/O
// or change the logic so that some explicit call is always needed for the
// network request.
- FetchSnippets(/*force_request=*/false);
+ FetchSnippets(/*interactive_request=*/false);
fetch_when_ready_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698