Chromium Code Reviews| 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); |