For the BackgroundOfflining effort, implement the Background Scheduler module, and hook it up to the BackgroundOfflining code (specifically the RequestCoordinator).
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/953b7e62de75f61f4589553c263dc456349eb842 commit 953b7e62de75f61f4589553c263dc456349eb842 Author: petewil <petewil@chromium.org> Date: Tue May 31 18:35:09 2016 Add a rough scheduler implementation. This also hooks up the scheduler to ChromeBackgroundService to start processing when our task fires. BUG= 612325 Review-Url: https://codereview.chromium.org/1985923002 Cr-Commit-Position: refs/heads/master@{#396873} [modify] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java [add] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java [add] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundScheduler.java [modify] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerBridge.java [modify] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/chrome/android/java_sources.gni [modify] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/chrome/browser/android/offline_pages/background_scheduler_bridge.cc [modify] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/chrome/browser/android/offline_pages/background_scheduler_bridge.h [modify] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/chrome/browser/android/offline_pages/request_coordinator_factory.cc [modify] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/components/offline_pages/background/request_coordinator.h [modify] https://crrev.com/953b7e62de75f61f4589553c263dc456349eb842/components/offline_pages/background/request_coordinator_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4667f21d36db6c8bb92a7f4b2dc4eced06f1bea4 commit 4667f21d36db6c8bb92a7f4b2dc4eced06f1bea4 Author: petewil <petewil@chromium.org> Date: Sat Jun 04 01:04:57 2016 Switch to currentTimeMillis, persist task Since we are persisting our GCM Network Manager task across reboots, we need to switch to a type of time that will work reliably across reboots. We consisered SystemClock.elapsedRealtime, but we think that bad UMA samples will be more likely from reboots than the user adjusting wall clock time. BUG= 612325 Review-Url: https://codereview.chromium.org/2037213002 Cr-Commit-Position: refs/heads/master@{#397877} [modify] https://crrev.com/4667f21d36db6c8bb92a7f4b2dc4eced06f1bea4/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundScheduler.java [modify] https://crrev.com/4667f21d36db6c8bb92a7f4b2dc4eced06f1bea4/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/36efc4e2983393cb9a92fc35c7656a31e932da59 commit 36efc4e2983393cb9a92fc35c7656a31e932da59 Author: petewil <petewil@chromium.org> Date: Wed Jun 08 23:53:42 2016 Add unit tests for the Background Scheduler. Adding the unit tests required a lot of related changes to be able to do dependency injection, and adding some stub classes. The SchedulerBridgeInterface allows us to stub out the BackgroundSchedulerBridge, and we added a shadow class for GcmNetworkManager. This work is described at go/chrome-background-offlining. BUG= 612325 Review-Url: https://codereview.chromium.org/2030773002 Cr-Commit-Position: refs/heads/master@{#398738} [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundScheduler.java [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerBridge.java [add] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerProcessorImpl.java [add] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java [add] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/interfaces/BackgroundSchedulerProcessor.java [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/java_sources.gni [add] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java [add] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java [add] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java [add] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/StubBackgroundSchedulerProcessor.java [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/chrome/browser/android/offline_pages/background_scheduler_bridge.cc [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/components/offline_pages/background/request_coordinator.cc [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/components/offline_pages/background/request_coordinator.h [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/components/offline_pages/background/request_coordinator_unittest.cc [modify] https://crrev.com/36efc4e2983393cb9a92fc35c7656a31e932da59/components/offline_pages/background/request_picker.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1f7ec09af677ae2148a559cc8a6517505f0e52f9 commit 1f7ec09af677ae2148a559cc8a6517505f0e52f9 Author: petewil <petewil@chromium.org> Date: Fri Jun 10 16:30:08 2016 hook up background task's "startProcessing" from Java to request_coordinator BUG= 612325 Review-Url: https://codereview.chromium.org/2054913002 Cr-Commit-Position: refs/heads/master@{#399204} [modify] https://crrev.com/1f7ec09af677ae2148a559cc8a6517505f0e52f9/chrome/browser/android/offline_pages/background_scheduler_bridge.cc [modify] https://crrev.com/1f7ec09af677ae2148a559cc8a6517505f0e52f9/components/offline_pages/background/request_coordinator.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/90704f1b454acae760b88738f8652864a9575b92 commit 90704f1b454acae760b88738f8652864a9575b92 Author: petewil <petewil@chromium.org> Date: Fri Jun 10 18:51:56 2016 Turn on the BackgroundScheduler test that was flaky, so we can test a fix on trybots. BUG= 612325 Review-Url: https://codereview.chromium.org/2053713002 Cr-Commit-Position: refs/heads/master@{#399244} [modify] https://crrev.com/90704f1b454acae760b88738f8652864a9575b92/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java [modify] https://crrev.com/90704f1b454acae760b88738f8652864a9575b92/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/71ef97e9c3815152a269b37b67990a7bbd641e1c commit 71ef97e9c3815152a269b37b67990a7bbd641e1c Author: petewil <petewil@chromium.org> Date: Thu Jun 16 17:12:25 2016 Add a general purpose facility for letting background tasks wait until the task is done before returning control to GCM Network Manager. To minimize concurrent network activity, the background offlining task wants to make sure we hold the thread for the GCM Network Manager until we are done using the network instead of letting the task start right away. The idea here is to reduce network contention during the Marshmallow maintenance window when the network becomes available. While this is only needed for BackgroundOfflining at the moment, we wanted to make the feature more generally accessible, any task with a bundle containing "WaitNeeded" set to anything other than 0 will start a wait. BUG= 612325 patch from issue 1985923002 at patchset 200001 (http://crrev.com/1985923002#ps200001) Review-Url: https://codereview.chromium.org/2066593003 Cr-Commit-Position: refs/heads/master@{#400180} [modify] https://crrev.com/71ef97e9c3815152a269b37b67990a7bbd641e1c/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java [add] https://crrev.com/71ef97e9c3815152a269b37b67990a7bbd641e1c/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundServiceWaiter.java [modify] https://crrev.com/71ef97e9c3815152a269b37b67990a7bbd641e1c/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java [modify] https://crrev.com/71ef97e9c3815152a269b37b67990a7bbd641e1c/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java [modify] https://crrev.com/71ef97e9c3815152a269b37b67990a7bbd641e1c/chrome/android/java_sources.gni [modify] https://crrev.com/71ef97e9c3815152a269b37b67990a7bbd641e1c/components/offline_pages/background/request_coordinator.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3b44616bcf69700ca97c8ca219ac3414a8cc1254 commit 3b44616bcf69700ca97c8ca219ac3414a8cc1254 Author: dougarnett <dougarnett@chromium.org> Date: Thu Jun 16 23:38:50 2016 Removes waiter member from BackgroundOfflinerTask to make it easier to reason about thread safety (eg, don't have to worry about two concurrent calls). BUG= 612325 Review-Url: https://codereview.chromium.org/2071073002 Cr-Commit-Position: refs/heads/master@{#400298} [modify] https://crrev.com/3b44616bcf69700ca97c8ca219ac3414a8cc1254/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java [modify] https://crrev.com/3b44616bcf69700ca97c8ca219ac3414a8cc1254/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8385f6409b5b4a13a079209db6eb37f3593e114c commit 8385f6409b5b4a13a079209db6eb37f3593e114c Author: dougarnett <dougarnett@chromium.org> Date: Wed Jun 29 16:11:57 2016 Removes some robolectric residue from JUnit test for ChromeBackgroundServiceWaiter. BUG= 612325 Review-Url: https://codereview.chromium.org/2107843002 Cr-Commit-Position: refs/heads/master@{#402831} [modify] https://crrev.com/8385f6409b5b4a13a079209db6eb37f3593e114c/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackgroundServiceWaiterTest.java
Please reopen if this is not done
Comment 1 by bugdroid1@chromium.org
, May 31 2016