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

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

Issue 1889783002: [NTP Snippets] Add tests for invalid or incomplete json (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_tests_cleanup
Patch Set: Created 4 years, 8 months 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
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_NTP_SNIPPETS_SERVICE_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // The snippets fetcher. 165 // The snippets fetcher.
166 scoped_ptr<NTPSnippetsFetcher> snippets_fetcher_; 166 scoped_ptr<NTPSnippetsFetcher> snippets_fetcher_;
167 167
168 // The subscription to the snippets fetcher. 168 // The subscription to the snippets fetcher.
169 scoped_ptr<NTPSnippetsFetcher::SnippetsAvailableCallbackList::Subscription> 169 scoped_ptr<NTPSnippetsFetcher::SnippetsAvailableCallbackList::Subscription>
170 snippets_fetcher_subscription_; 170 snippets_fetcher_subscription_;
171 171
172 // Timer that calls us back when the next snippet expires. 172 // Timer that calls us back when the next snippet expires.
173 base::OneShotTimer expiry_timer_; 173 base::OneShotTimer expiry_timer_;
174 174
175 const ParseJSONCallback parse_json_callback_; 175 ParseJSONCallback parse_json_callback_;
176 176
177 base::WeakPtrFactory<NTPSnippetsService> weak_ptr_factory_; 177 base::WeakPtrFactory<NTPSnippetsService> weak_ptr_factory_;
178 178
179 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); 179 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService);
180 }; 180 };
181 181
182 class NTPSnippetsServiceObserver { 182 class NTPSnippetsServiceObserver {
183 public: 183 public:
184 // Sent every time the service loads a new set of data. 184 // Sent every time the service loads a new set of data.
185 virtual void NTPSnippetsServiceLoaded() = 0; 185 virtual void NTPSnippetsServiceLoaded() = 0;
186 // Sent when the service is shutting down. 186 // Sent when the service is shutting down.
187 virtual void NTPSnippetsServiceShutdown() = 0; 187 virtual void NTPSnippetsServiceShutdown() = 0;
188 188
189 protected: 189 protected:
190 virtual ~NTPSnippetsServiceObserver() {} 190 virtual ~NTPSnippetsServiceObserver() {}
191 }; 191 };
192 192
193 } // namespace ntp_snippets 193 } // namespace ntp_snippets
194 194
195 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 195 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698