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

Unified Diff: chrome/browser/android/ntp/ntp_snippets_bridge.cc

Issue 2363753002: [NTP Snippets] Don't reschedule background fetching on every startup (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/ntp/ntp_snippets_bridge.cc
diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
index a14c1f9718d0237848fb10a6ec84ce2855ab41cd..6b0c9fe00bd9e6e1d94020e08bc2d7445652dc9c 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -92,7 +92,8 @@ static void FetchSnippets(JNIEnv* env,
service->FetchSnippets(j_force_request);
}
-// Reschedules the fetching of snippets.
+// Reschedules the fetching of snippets. If tasks are already scheduled, they
+// will be rescheduled anyway, so all running intervals will be reset.
static void RescheduleFetching(JNIEnv* env,
const JavaParamRef<jclass>& caller) {
Profile* profile = ProfileManager::GetLastUsedProfile();
@@ -114,7 +115,7 @@ static void RescheduleFetching(JNIEnv* env,
if (!service)
return;
- service->RescheduleFetching();
+ service->RescheduleFetching(/*force=*/true);
}
static void OnSuggestionTargetVisited(JNIEnv* env,
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698