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

Side by Side Diff: components/ntp_snippets/offline_pages/recent_tab_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/offline_pages/recent_tab_suggestions_provider. h" 5 #include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider. h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 const ImageFetchedCallback& callback) { 99 const ImageFetchedCallback& callback) {
100 // TODO(vitaliii): Fetch proper thumbnail from OfflinePageModel once it's 100 // TODO(vitaliii): Fetch proper thumbnail from OfflinePageModel once it's
101 // available there. 101 // available there.
102 base::ThreadTaskRunnerHandle::Get()->PostTask( 102 base::ThreadTaskRunnerHandle::Get()->PostTask(
103 FROM_HERE, base::Bind(callback, gfx::Image())); 103 FROM_HERE, base::Bind(callback, gfx::Image()));
104 } 104 }
105 105
106 void RecentTabSuggestionsProvider::Fetch( 106 void RecentTabSuggestionsProvider::Fetch(
107 const Category& category, 107 const Category& category,
108 const std::set<std::string>& known_suggestion_ids, 108 const std::set<std::string>& known_suggestion_ids,
109 FetchingCallback callback) { 109 const FetchingCallback& callback) {
110 NOTREACHED(); 110 NOTREACHED();
111 base::ThreadTaskRunnerHandle::Get()->PostTask( 111 base::ThreadTaskRunnerHandle::Get()->PostTask(
112 FROM_HERE, 112 FROM_HERE,
113 base::Bind(callback, base::Passed(std::vector<ContentSuggestion>()))); 113 base::Bind(callback, base::Passed(std::vector<ContentSuggestion>())));
114 } 114 }
115 115
116 void RecentTabSuggestionsProvider::ClearHistory( 116 void RecentTabSuggestionsProvider::ClearHistory(
117 base::Time begin, 117 base::Time begin,
118 base::Time end, 118 base::Time end,
119 const base::Callback<bool(const GURL& url)>& filter) { 119 const base::Callback<bool(const GURL& url)>& filter) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 275
276 void RecentTabSuggestionsProvider::StoreDismissedIDsToPrefs( 276 void RecentTabSuggestionsProvider::StoreDismissedIDsToPrefs(
277 const std::set<std::string>& dismissed_ids) { 277 const std::set<std::string>& dismissed_ids) {
278 prefs::StoreDismissedIDsToPrefs(pref_service_, 278 prefs::StoreDismissedIDsToPrefs(pref_service_,
279 prefs::kDismissedRecentOfflineTabSuggestions, 279 prefs::kDismissedRecentOfflineTabSuggestions,
280 dismissed_ids); 280 dismissed_ids);
281 } 281 }
282 282
283 } // namespace ntp_snippets 283 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698