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

Unified Diff: components/ntp_snippets/ntp_snippets_database.h

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.h
diff --git a/components/ntp_snippets/ntp_snippets_database.h b/components/ntp_snippets/ntp_snippets_database.h
index 983166235f0ca70265f66149e3ae6c9b6aa842d5..2c76a45e44ed6b8bd838e66b2f2bb71e7359f3ef 100644
--- a/components/ntp_snippets/ntp_snippets_database.h
+++ b/components/ntp_snippets/ntp_snippets_database.h
@@ -29,7 +29,7 @@ class SnippetProto;
class NTPSnippetsDatabase {
public:
using SnippetsCallback = base::Callback<void(NTPSnippet::PtrVector)>;
- using SnippetImageCallback = base::Callback<void(std::string)>;
+ using SnippetImageCallback = base::Callback<void(std::string suggestion_id)>;
NTPSnippetsDatabase(
const base::FilePath& database_dir,
@@ -63,14 +63,15 @@ class NTPSnippetsDatabase {
// Loads the image data for the snippet with the given ID and passes it to
// |callback|. Passes an empty string if not found.
- void LoadImage(const std::string& snippet_id,
+ void LoadImage(const std::string& suggestion_id,
Marc Treib 2016/08/22 15:06:46 So now, suggestions themselves are indexed by with
tschumann 2016/08/22 16:00:23 Yes, we should make sure snippet ids are unique. A
sfiera 2016/08/24 14:35:56 We plan to cache all server suggestions in the dat
Marc Treib 2016/08/24 15:22:08 I guess that's the plan, but that will require mor
tschumann 2016/08/24 15:33:08 I had a closer look, and I'm fine with the current
Marc Treib 2016/08/24 15:38:54 The main thing that bothers me here is that the DB
tschumann 2016/08/25 16:15:21 Correct! Yes, the NTPSnippetsDataBase should only
const SnippetImageCallback& callback);
// Adds or updates the image data for the given snippet ID.
- void SaveImage(const std::string& snippet_id, const std::string& image_data);
+ void SaveImage(const std::string& suggestion_id,
+ const std::string& image_data);
// Deletes the image data for the given snippet ID.
- void DeleteImage(const std::string& snippet_id);
+ void DeleteImage(const std::string& suggestion_id);
private:
friend class NTPSnippetsDatabaseTest;
@@ -104,7 +105,7 @@ class NTPSnippetsDatabase {
void DeleteSnippetsImpl(
std::unique_ptr<std::vector<std::string>> keys_to_remove);
- void LoadImageImpl(const std::string& snippet_id,
+ void LoadImageImpl(const std::string& suggestion_id,
const SnippetImageCallback& callback);
void DeleteImagesImpl(
std::unique_ptr<std::vector<std::string>> keys_to_remove);
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_database.cc » ('j') | components/ntp_snippets/ntp_snippets_service.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698