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

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

Issue 2357163004: [NTP Snippets] Remove scheduled re-scheduling (Closed)
Patch Set: Review: remove requiresCharging Created 4 years, 3 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
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 #include "components/ntp_snippets/ntp_snippets_service.h" 5 #include "components/ntp_snippets/ntp_snippets_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 if (!scheduler_) 235 if (!scheduler_)
236 return; 236 return;
237 237
238 // If we're NOT_INITED, we don't know whether to schedule or un-schedule. 238 // If we're NOT_INITED, we don't know whether to schedule or un-schedule.
239 // We'll reschedule on the next state change anyway, so do nothing here. 239 // We'll reschedule on the next state change anyway, so do nothing here.
240 if (state_ == State::NOT_INITED) 240 if (state_ == State::NOT_INITED)
241 return; 241 return;
242 242
243 if (ready()) { 243 if (ready()) {
244 scheduler_->Schedule(GetFetchingIntervalWifi(), 244 scheduler_->Schedule(GetFetchingIntervalWifi(),
245 GetFetchingIntervalFallback(), 245 GetFetchingIntervalFallback());
246 /*reschedule_time=*/base::Time());
247 } else { 246 } else {
248 scheduler_->Unschedule(); 247 scheduler_->Unschedule();
249 } 248 }
250 } 249 }
251 250
252 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) { 251 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) {
253 DCHECK(categories_.find(category) != categories_.end()); 252 DCHECK(categories_.find(category) != categories_.end());
254 return categories_[category].status; 253 return categories_[category].status;
255 } 254 }
256 255
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 } 1011 }
1013 1012
1014 NTPSnippetsService::CategoryContent::CategoryContent() = default; 1013 NTPSnippetsService::CategoryContent::CategoryContent() = default;
1015 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) = 1014 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) =
1016 default; 1015 default;
1017 NTPSnippetsService::CategoryContent::~CategoryContent() = default; 1016 NTPSnippetsService::CategoryContent::~CategoryContent() = default;
1018 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent:: 1017 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent::
1019 operator=(CategoryContent&&) = default; 1018 operator=(CategoryContent&&) = default;
1020 1019
1021 } // namespace ntp_snippets 1020 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698