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

Unified Diff: components/ntp_snippets/ntp_snippets_database.cc

Issue 2255783002: Support server categories in NTPSnippetsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 4 years, 4 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_database.cc
diff --git a/components/ntp_snippets/ntp_snippets_database.cc b/components/ntp_snippets/ntp_snippets_database.cc
index 4b1427961588e4f70a4b0591d526aa3279479b0d..27f316a65fa31f2836537efbe3dd115d7a753d0c 100644
--- a/components/ntp_snippets/ntp_snippets_database.cc
+++ b/components/ntp_snippets/ntp_snippets_database.cc
@@ -97,15 +97,15 @@ void NTPSnippetsDatabase::DeleteSnippets(
DeleteSnippetsImpl(std::move(keys_to_remove));
}
-void NTPSnippetsDatabase::LoadImage(const std::string& snippet_id,
+void NTPSnippetsDatabase::LoadImage(const std::string& suggestion_id,
const SnippetImageCallback& callback) {
if (IsInitialized())
- LoadImageImpl(snippet_id, callback);
+ LoadImageImpl(suggestion_id, callback);
else
- pending_image_callbacks_.emplace_back(snippet_id, callback);
+ pending_image_callbacks_.emplace_back(suggestion_id, callback);
}
-void NTPSnippetsDatabase::SaveImage(const std::string& snippet_id,
+void NTPSnippetsDatabase::SaveImage(const std::string& suggestion_id,
const std::string& image_data) {
DCHECK(IsInitialized());
@@ -114,7 +114,7 @@ void NTPSnippetsDatabase::SaveImage(const std::string& snippet_id,
std::unique_ptr<ImageKeyEntryVector> entries_to_save(
new ImageKeyEntryVector());
- entries_to_save->emplace_back(snippet_id, std::move(image_proto));
+ entries_to_save->emplace_back(suggestion_id, std::move(image_proto));
image_database_->UpdateEntries(
std::move(entries_to_save),
@@ -123,9 +123,9 @@ void NTPSnippetsDatabase::SaveImage(const std::string& snippet_id,
weak_ptr_factory_.GetWeakPtr()));
}
-void NTPSnippetsDatabase::DeleteImage(const std::string& snippet_id) {
+void NTPSnippetsDatabase::DeleteImage(const std::string& suggestion_id) {
DeleteImagesImpl(
- base::WrapUnique(new std::vector<std::string>(1, snippet_id)));
+ base::WrapUnique(new std::vector<std::string>(1, suggestion_id)));
}
void NTPSnippetsDatabase::OnDatabaseInited(bool success) {
@@ -269,13 +269,12 @@ void NTPSnippetsDatabase::DeleteSnippetsImpl(
weak_ptr_factory_.GetWeakPtr()));
}
-void NTPSnippetsDatabase::LoadImageImpl(const std::string& snippet_id,
+void NTPSnippetsDatabase::LoadImageImpl(const std::string& suggestion_id,
const SnippetImageCallback& callback) {
DCHECK(IsInitialized());
image_database_->GetEntry(
- snippet_id,
- base::Bind(&NTPSnippetsDatabase::OnImageDatabaseLoaded,
- weak_ptr_factory_.GetWeakPtr(), callback));
+ suggestion_id, base::Bind(&NTPSnippetsDatabase::OnImageDatabaseLoaded,
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void NTPSnippetsDatabase::DeleteImagesImpl(

Powered by Google App Engine
This is Rietveld 408576698