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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java

Issue 1985923002: Wireframe scheduler implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More CR feedback per BauerB Created 4 years, 7 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 | chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
index b8c90d046da508744946215b385b114b1593c845..4b988402734e78d1f374a5675d9af4ce131110a1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
@@ -5,6 +5,7 @@
package org.chromium.chrome.browser;
import android.content.Context;
+import android.os.Bundle;
import com.google.android.gms.gcm.GcmNetworkManager;
import com.google.android.gms.gcm.GcmTaskService;
@@ -14,11 +15,11 @@ import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.SuppressFBWarnings;
-import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.chrome.browser.init.ChromeBrowserInitializer;
import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge;
import org.chromium.chrome.browser.ntp.snippets.SnippetsLauncher;
+import org.chromium.chrome.browser.offlinepages.BackgroundOfflinerTask;
import org.chromium.chrome.browser.offlinepages.OfflinePageUtils;
import org.chromium.chrome.browser.precache.PrecacheController;
@@ -44,7 +45,7 @@ public class ChromeBackgroundService extends GcmTaskService {
break;
case OfflinePageUtils.TASK_TAG:
- handleOfflinePageBackgroundLoad(context);
+ handleOfflinePageBackgroundLoad(context, params.getExtras());
break;
case SnippetsLauncher.TASK_TAG_WIFI_CHARGING:
@@ -124,12 +125,15 @@ public class ChromeBackgroundService extends GcmTaskService {
PrecacheController.get(context).precache(tag);
}
- private void handleOfflinePageBackgroundLoad(Context context) {
- // Gather UMA data to measure how often the user's machine is amenable to background
- // loading when we wake to do a task.
- if (LibraryLoader.isInitialized()) {
- OfflinePageUtils.recordWakeupUMA(context);
+ private void handleOfflinePageBackgroundLoad(Context context, Bundle bundle) {
+ if (!hasPrecacheInstance()) {
+ launchBrowser(context);
}
+
+ // Call BackgroundTask, provide context.
+ BackgroundOfflinerTask.startBackgroundRequests(context, bundle);
+ // TODO(petewil) if processBackgroundRequest returns false, return RESTART_RESCHEDULE
+ // to the GcmNetworkManager
}
@VisibleForTesting
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698