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

Side by Side Diff: components/ntp_snippets/physical_web_pages/physical_web_page_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/physical_web_pages/physical_web_page_suggestio ns_provider.h" 5 #include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestio ns_provider.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 const ContentSuggestion::ID& suggestion_id, 91 const ContentSuggestion::ID& suggestion_id,
92 const ImageFetchedCallback& callback) { 92 const ImageFetchedCallback& callback) {
93 // TODO(vitaliii): Implement. 93 // TODO(vitaliii): Implement.
94 base::ThreadTaskRunnerHandle::Get()->PostTask( 94 base::ThreadTaskRunnerHandle::Get()->PostTask(
95 FROM_HERE, base::Bind(callback, gfx::Image())); 95 FROM_HERE, base::Bind(callback, gfx::Image()));
96 } 96 }
97 97
98 void PhysicalWebPageSuggestionsProvider::Fetch( 98 void PhysicalWebPageSuggestionsProvider::Fetch(
99 const Category& category, 99 const Category& category,
100 const std::set<std::string>& known_suggestion_ids, 100 const std::set<std::string>& known_suggestion_ids,
101 FetchingCallback callback) { 101 const FetchingCallback& callback) {
102 NOTREACHED(); 102 NOTREACHED();
103 base::ThreadTaskRunnerHandle::Get()->PostTask( 103 base::ThreadTaskRunnerHandle::Get()->PostTask(
104 FROM_HERE, 104 FROM_HERE,
105 base::Bind(callback, base::Passed(std::vector<ContentSuggestion>()))); 105 base::Bind(callback, base::Passed(std::vector<ContentSuggestion>())));
106 } 106 }
107 107
108 void PhysicalWebPageSuggestionsProvider::ClearHistory( 108 void PhysicalWebPageSuggestionsProvider::ClearHistory(
109 base::Time begin, 109 base::Time begin,
110 base::Time end, 110 base::Time end,
111 const base::Callback<bool(const GURL& url)>& filter) { 111 const base::Callback<bool(const GURL& url)>& filter) {
(...skipping 22 matching lines...) Expand all
134 134
135 // Updates the |category_status_| and notifies the |observer_|, if necessary. 135 // Updates the |category_status_| and notifies the |observer_|, if necessary.
136 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged( 136 void PhysicalWebPageSuggestionsProvider::NotifyStatusChanged(
137 CategoryStatus new_status) { 137 CategoryStatus new_status) {
138 if (category_status_ == new_status) return; 138 if (category_status_ == new_status) return;
139 category_status_ = new_status; 139 category_status_ = new_status;
140 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 140 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
141 } 141 }
142 142
143 } // namespace ntp_snippets 143 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698