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

Side by Side Diff: components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc

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 #include "components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h" 5 #include "components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 void BookmarkSuggestionsProvider::FetchSuggestionImage( 151 void BookmarkSuggestionsProvider::FetchSuggestionImage(
152 const ContentSuggestion::ID& suggestion_id, 152 const ContentSuggestion::ID& suggestion_id,
153 const ImageFetchedCallback& callback) { 153 const ImageFetchedCallback& callback) {
154 base::ThreadTaskRunnerHandle::Get()->PostTask( 154 base::ThreadTaskRunnerHandle::Get()->PostTask(
155 FROM_HERE, base::Bind(callback, gfx::Image())); 155 FROM_HERE, base::Bind(callback, gfx::Image()));
156 } 156 }
157 157
158 void BookmarkSuggestionsProvider::Fetch( 158 void BookmarkSuggestionsProvider::Fetch(
159 const Category& category, 159 const Category& category,
160 const std::set<std::string>& known_suggestion_ids, 160 const std::set<std::string>& known_suggestion_ids,
161 FetchingCallback callback) { 161 const FetchingCallback& callback) {
162 NOTREACHED(); 162 NOTREACHED();
163 base::ThreadTaskRunnerHandle::Get()->PostTask( 163 base::ThreadTaskRunnerHandle::Get()->PostTask(
164 FROM_HERE, 164 FROM_HERE,
165 base::Bind(callback, base::Passed(std::vector<ContentSuggestion>()))); 165 base::Bind(callback, base::Passed(std::vector<ContentSuggestion>())));
166 } 166 }
167 167
168 void BookmarkSuggestionsProvider::ClearHistory( 168 void BookmarkSuggestionsProvider::ClearHistory(
169 base::Time begin, 169 base::Time begin,
170 base::Time end, 170 base::Time end,
171 const base::Callback<bool(const GURL& url)>& filter) { 171 const base::Callback<bool(const GURL& url)>& filter) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 316
317 void BookmarkSuggestionsProvider::NotifyStatusChanged( 317 void BookmarkSuggestionsProvider::NotifyStatusChanged(
318 CategoryStatus new_status) { 318 CategoryStatus new_status) {
319 if (category_status_ == new_status) 319 if (category_status_ == new_status)
320 return; 320 return;
321 category_status_ = new_status; 321 category_status_ = new_status;
322 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 322 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
323 } 323 }
324 324
325 } // namespace ntp_snippets 325 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698