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

Side by Side Diff: components/ntp_snippets/content_suggestions_provider.h

Issue 2485933003: Fixes an invalidated pointer access in NTPSnipppetsFetcher. (Closed)
Patch Set: adressed other comments from https://codereview.chromium.org/2473483006/ Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // synchronously. 102 // synchronously.
103 virtual void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id, 103 virtual void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id,
104 const ImageFetchedCallback& callback) = 0; 104 const ImageFetchedCallback& callback) = 0;
105 105
106 // Fetches more suggestions for the given category. The new suggestions 106 // Fetches more suggestions for the given category. The new suggestions
107 // will not include any suggestion of the |known_suggestion_ids| sets. 107 // will not include any suggestion of the |known_suggestion_ids| sets.
108 // The given |callback| is called with these suggestions, along with all 108 // The given |callback| is called with these suggestions, along with all
109 // existing suggestions. 109 // existing suggestions.
110 virtual void Fetch(const Category& category, 110 virtual void Fetch(const Category& category,
111 const std::set<std::string>& known_suggestion_ids, 111 const std::set<std::string>& known_suggestion_ids,
112 FetchingCallback callback) = 0; 112 const FetchingCallback& callback) = 0;
113 113
114 // Removes history from the specified time range where the URL matches the 114 // Removes history from the specified time range where the URL matches the
115 // |filter|. The data removed depends on the provider. Note that the 115 // |filter|. The data removed depends on the provider. Note that the
116 // data outside the time range may be deleted, for example suggestions, which 116 // data outside the time range may be deleted, for example suggestions, which
117 // are based on history from that time range. Providers should immediately 117 // are based on history from that time range. Providers should immediately
118 // clear any data related to history from the specified time range where the 118 // clear any data related to history from the specified time range where the
119 // URL matches the |filter|. 119 // URL matches the |filter|.
120 virtual void ClearHistory( 120 virtual void ClearHistory(
121 base::Time begin, 121 base::Time begin,
122 base::Time end, 122 base::Time end,
(...skipping 27 matching lines...) Expand all
150 CategoryFactory* category_factory() const { return category_factory_; } 150 CategoryFactory* category_factory() const { return category_factory_; }
151 151
152 private: 152 private:
153 Observer* observer_; 153 Observer* observer_;
154 CategoryFactory* category_factory_; 154 CategoryFactory* category_factory_;
155 }; 155 };
156 156
157 } // namespace ntp_snippets 157 } // namespace ntp_snippets
158 158
159 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 159 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698