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

Issue 2820263002: [Offline Prefetch] Create a new JobScheduler task to wake up for net activity. (Closed)

Created:
3 years, 8 months ago by dewittj
Modified:
3 years, 7 months ago
CC:
chromium-reviews, dewittj+watch_chromium.org, fgorski+watch_chromium.org, romax+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, agrieve+watch_chromium.org, dimich+watch_chromium.org, jianli
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Offline Prefetch] Create a new JobScheduler task to wake up for net activity. This includes: * Only waking up on unmetered networks * Responding to JobScheduler events such as stopping job * Calling back to Android when the job is finished * An integration with chrome://offline-internals. BUG=713243 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2820263002 Cr-Commit-Position: refs/heads/master@{#469139} Committed: https://chromium.googlesource.com/chromium/src/+/4b3550fa52e020ed2aebb55f4a5220f4005435a3

Patch Set 1 #

Patch Set 2 : Add offline internals integration and clean up. #

Patch Set 3 : Touch ups. #

Patch Set 4 : Rename task file. #

Patch Set 5 : Remove the "Is Scheduled" check because it's not supported by BackgroundTaskScheduler. #

Total comments: 14

Patch Set 6 : Comments + Rebase. #

Patch Set 7 : . #

Total comments: 2

Patch Set 8 : ] #

Total comments: 10

Patch Set 9 : comments. #

Patch Set 10 : Add deps. #

Patch Set 11 : Return false. #

Total comments: 8

Patch Set 12 : tommycli@ comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+572 lines, -0 lines) Patch
M chrome/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +164 lines, -0 lines 0 comments Download
M chrome/android/java_sources.gni View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/android/junit/DEPS View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskTest.java View 1 2 3 4 5 6 7 1 chunk +146 lines, -0 lines 0 comments Download
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/android/chrome_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download
A chrome/browser/android/offline_pages/prefetch/prefetch_background_task.h View 1 2 3 4 5 6 7 8 1 chunk +54 lines, -0 lines 0 comments Download
A chrome/browser/android/offline_pages/prefetch/prefetch_background_task.cc View 1 2 3 4 5 1 chunk +83 lines, -0 lines 0 comments Download
M chrome/browser/resources/offline_pages/offline_internals.html View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/resources/offline_pages/offline_internals.js View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/resources/offline_pages/offline_internals_browser_proxy.js View 1 2 3 4 2 chunks +22 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +34 lines, -0 lines 0 comments Download
M components/background_task_scheduler/android/java/src/org/chromium/components/background_task_scheduler/TaskIds.java View 1 chunk +1 line, -0 lines 0 comments Download
M components/offline_pages/content/suggested_articles_observer_unittest.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M components/offline_pages/core/prefetch/prefetch_service.h View 1 2 3 4 5 2 chunks +24 lines, -0 lines 0 comments Download
M components/offline_pages/core/prefetch/prefetch_service_impl.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M components/offline_pages/core/prefetch/prefetch_service_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 65 (46 generated)
dewittj
+carlosk for an early look. I am having trouble unit testing this change, any ideas ...
3 years, 8 months ago (2017-04-18 23:02:55 UTC) #10
dewittj
+fgorski for background_task_scheduler implementation.
3 years, 8 months ago (2017-04-19 17:50:43 UTC) #16
carlosk
https://codereview.chromium.org/2820263002/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java (right): https://codereview.chromium.org/2820263002/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java#newcode47 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java:47: * TODO(dewittj): Handle skipping work if the battery percentage ...
3 years, 8 months ago (2017-04-19 23:01:38 UTC) #21
dewittj
+CC Jian Carlos: I addressed your comments. Some tests should be forthcoming assuming nobody has ...
3 years, 8 months ago (2017-04-20 21:41:45 UTC) #23
dewittj
Thanks for waiting! I added a junit test. -fgorski (out) +dimich
3 years, 7 months ago (2017-05-01 16:41:50 UTC) #24
carlosk
LGTM with a couple minor comments. General CR comment: whenever possible upload rebases in isolation ...
3 years, 7 months ago (2017-05-01 17:26:29 UTC) #30
Dmitry Titov
https://codereview.chromium.org/2820263002/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java (right): https://codereview.chromium.org/2820263002/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java#newcode69 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java:69: // TODO(dewittj): Remove the maximum time to wait. If ...
3 years, 7 months ago (2017-05-01 18:14:56 UTC) #33
dewittj
thanks, ptal https://codereview.chromium.org/2820263002/diff/140001/components/offline_pages/core/prefetch/prefetch_service_impl.cc File components/offline_pages/core/prefetch/prefetch_service_impl.cc (right): https://codereview.chromium.org/2820263002/diff/140001/components/offline_pages/core/prefetch/prefetch_service_impl.cc#newcode27 components/offline_pages/core/prefetch/prefetch_service_impl.cc:27: std::unique_ptr<ScopedBackgroundTask> task) {} On 2017/05/01 17:26:29, carlosk ...
3 years, 7 months ago (2017-05-01 22:16:35 UTC) #36
Dmitry Titov
https://codereview.chromium.org/2820263002/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java (right): https://codereview.chromium.org/2820263002/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java#newcode110 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java:110: assert mNativeTask != 0; On 2017/05/01 22:16:34, dewittj wrote: ...
3 years, 7 months ago (2017-05-01 23:07:43 UTC) #37
dewittj
+nyquist for chrome/android/junit/DEPS
3 years, 7 months ago (2017-05-02 22:41:54 UTC) #44
dewittj
https://codereview.chromium.org/2820263002/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java (right): https://codereview.chromium.org/2820263002/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java#newcode110 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java:110: assert mNativeTask != 0; On 2017/05/01 23:07:43, Dmitry Titov ...
3 years, 7 months ago (2017-05-02 22:42:22 UTC) #45
dewittj
+dtrainor for chrome/android/junit/DEPS Thanks!
3 years, 7 months ago (2017-05-02 23:12:25 UTC) #47
Dmitry Titov
lgtm with a nit: https://codereview.chromium.org/2820263002/diff/220001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java (right): https://codereview.chromium.org/2820263002/diff/220001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java#newcode63 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java:63: TaskInfo.createOneOffTask(TaskIds.OFFLINE_PAGES_PREFETCH_JOB_ID, This is where we ...
3 years, 7 months ago (2017-05-02 23:51:42 UTC) #48
David Trainor- moved to gerrit
chrome/android/junit/DEPS lgtm!
3 years, 7 months ago (2017-05-03 05:11:54 UTC) #51
dewittj
+tommycli for webui, offline_internals https://codereview.chromium.org/2820263002/diff/220001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java (right): https://codereview.chromium.org/2820263002/diff/220001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java#newcode63 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java:63: TaskInfo.createOneOffTask(TaskIds.OFFLINE_PAGES_PREFETCH_JOB_ID, On 2017/05/02 23:51:42, Dmitry ...
3 years, 7 months ago (2017-05-03 15:45:40 UTC) #53
tommycli
lgtm with some nits https://codereview.chromium.org/2820263002/diff/220001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc File chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc (right): https://codereview.chromium.org/2820263002/diff/220001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc#newcode231 chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc:231: void OfflineInternalsUIMessageHandler::HandleScheduleNwake( Can these methods ...
3 years, 7 months ago (2017-05-03 16:00:13 UTC) #54
dewittj
https://codereview.chromium.org/2820263002/diff/220001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc File chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc (right): https://codereview.chromium.org/2820263002/diff/220001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc#newcode231 chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc:231: void OfflineInternalsUIMessageHandler::HandleScheduleNwake( On 2017/05/03 16:00:12, tommycli wrote: > Can ...
3 years, 7 months ago (2017-05-03 21:34:10 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2820263002/240001
3 years, 7 months ago (2017-05-03 21:35:14 UTC) #62
commit-bot: I haz the power
3 years, 7 months ago (2017-05-03 21:44:51 UTC) #65
Message was sent while issue was closed.
Committed patchset #12 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/4b3550fa52e020ed2aebb55f4a52...

Powered by Google App Engine
This is Rietveld 408576698