New issue
Advanced search Search tips

Issue 728472 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Scheduling logic for download internal api

Project Member Reported by xingliu@chromium.org, Jun 1 2017

Issue description

We need to add the scheduler on native side to poll the next available download, also it glues the platform background task api to download logic.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2665d3a6c34af99893022b63ceab2803a079a0e3

commit 2665d3a6c34af99893022b63ceab2803a079a0e3
Author: Xing Liu <xingliu@chromium.org>
Date: Mon Jun 05 20:31:45 2017

Scheduler for download internal api.

Scheduler polls the next download based on download entries, and can
create a platform background task from download service, when downloads
are added, removed, or the crietria is updated.

Also polished network and battery states, because it's very confusing
and probably incorrect to directly use scheduling parameters to
represent the device states.

This CL only includes an interface for platform background task
scheduler.

Bug:  728472 
Change-Id: I08d0b90478293271c7cf49cfecbeb73428207ee3
Reviewed-on: https://chromium-review.googlesource.com/520571
Commit-Queue: Xing Liu <xingliu@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#477072}
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/BUILD.gn
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/entry.cc
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/entry.h
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/entry_utils.cc
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/entry_utils.h
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/proto/entry.proto
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/proto_conversions.cc
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/battery_listener.cc
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/battery_listener.h
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/battery_listener_unittest.cc
[add] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/device_status.cc
[add] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/device_status.h
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/network_listener.cc
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/network_listener.h
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/network_listener_unittest.cc
[add] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/scheduler.h
[add] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/scheduler_impl.cc
[add] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/scheduler_impl.h
[add] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/internal/scheduler/scheduler_impl_unittest.cc
[modify] https://crrev.com/2665d3a6c34af99893022b63ceab2803a079a0e3/components/download/public/clients.h

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3fda457a4a08084076c2f881ee53847726c5d158

commit 3fda457a4a08084076c2f881ee53847726c5d158
Author: Xing Liu <xingliu@chromium.org>
Date: Wed Jun 07 20:20:48 2017

Merge battery listener and network listener to device status listener.

This CL simplified the code into one class and only holds one observer,
and removed several useless methods.

Also add device status listener to controller.


Bug:  728472 
Change-Id: If7a6799690d8421a9d9a43450792bc95c6cd3e5f
Reviewed-on: https://chromium-review.googlesource.com/524897
Commit-Queue: Xing Liu <xingliu@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Shakti Sahu <shaktisahu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#477748}
[modify] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/content/factory/download_service_factory.cc
[modify] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/BUILD.gn
[modify] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/controller_impl.cc
[modify] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/controller_impl.h
[modify] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/controller_impl_unittest.cc
[delete] https://crrev.com/3307d08bfa9a42a4c924720a4c606fb417cd9bc0/components/download/internal/scheduler/battery_listener.cc
[delete] https://crrev.com/3307d08bfa9a42a4c924720a4c606fb417cd9bc0/components/download/internal/scheduler/battery_listener.h
[delete] https://crrev.com/3307d08bfa9a42a4c924720a4c606fb417cd9bc0/components/download/internal/scheduler/battery_listener_unittest.cc
[modify] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/scheduler/device_status.cc
[modify] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/scheduler/device_status.h
[add] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/scheduler/device_status_listener.cc
[add] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/scheduler/device_status_listener.h
[add] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/scheduler/device_status_listener_unittest.cc
[delete] https://crrev.com/3307d08bfa9a42a4c924720a4c606fb417cd9bc0/components/download/internal/scheduler/network_listener.cc
[delete] https://crrev.com/3307d08bfa9a42a4c924720a4c606fb417cd9bc0/components/download/internal/scheduler/network_listener.h
[delete] https://crrev.com/3307d08bfa9a42a4c924720a4c606fb417cd9bc0/components/download/internal/scheduler/network_listener_unittest.cc
[modify] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/test/BUILD.gn
[add] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/test/test_device_status_listener.cc
[add] https://crrev.com/3fda457a4a08084076c2f881ee53847726c5d158/components/download/internal/test/test_device_status_listener.h

Project Member

Comment 3 by bugdroid1@chromium.org, Jun 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/edfd8e459c8133fa9b042839fe4edfbf260c3633

commit edfd8e459c8133fa9b042839fe4edfbf260c3633
Author: Xing Liu <xingliu@chromium.org>
Date: Wed Jun 14 21:37:04 2017

Download service: glues model, driver and native scheduler in controller.

This CL adds codes in controller_impl.cc that glue model, driver and
native scheduler together.

Code in smaller pieces and tests are also adjusted accordingly.


Bug:  728472 
Change-Id: I993bee488d3a2f483168f81690eaf4631988a2fb
Reviewed-on: https://chromium-review.googlesource.com/532613
Commit-Queue: Xing Liu <xingliu@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479510}
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/content/factory/download_service_factory.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/content/internal/download_driver_impl.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/content/internal/download_driver_impl.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/controller.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/controller_impl.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/controller_impl.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/controller_impl_unittest.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/download_driver.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/driver_entry.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/entry_utils.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/entry_utils.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/scheduler/device_status.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/scheduler/device_status.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/scheduler/device_status_listener.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/scheduler/scheduler.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/scheduler/scheduler_impl.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/scheduler/scheduler_impl.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/stats.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/stats.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/test/test_device_status_listener.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/test/test_device_status_listener.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/test/test_download_driver.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/internal/test/test_download_driver.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/public/client.h
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/public/download_params.cc
[modify] https://crrev.com/edfd8e459c8133fa9b042839fe4edfbf260c3633/components/download/public/download_params.h

Project Member

Comment 4 by bugdroid1@chromium.org, Jun 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fcb79c9086e4386c12f73b4287b5bf2b9e365051

commit fcb79c9086e4386c12f73b4287b5bf2b9e365051
Author: Xing Liu <xingliu@chromium.org>
Date: Thu Jun 15 21:31:05 2017

Download service: Use TaskScheduler in scheduler.

Previously we use a dummy interface, this CL makes the scheduler to use
the new API to schedule OS level background tasks.

Bug:  728472 
Change-Id: I1e298c8ba82631cd8c390e40c76365df55cc2492
Reviewed-on: https://chromium-review.googlesource.com/536274
Commit-Queue: Xing Liu <xingliu@chromium.org>
Reviewed-by: Shakti Sahu <shaktisahu@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479839}
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/chrome/browser/android/download/service/download_task_scheduler.h
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/chrome/browser/download/download_task_scheduler_impl.h
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/components_unittests.filter
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/content/factory/download_service_factory.cc
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/internal/config.cc
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/internal/config.h
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/internal/controller_impl_unittest.cc
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/internal/scheduler/scheduler.h
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/internal/scheduler/scheduler_impl.cc
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/internal/scheduler/scheduler_impl.h
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/internal/scheduler/scheduler_impl_unittest.cc
[modify] https://crrev.com/fcb79c9086e4386c12f73b4287b5bf2b9e365051/components/download/public/task_scheduler.h

Status: Fixed (was: Started)

Sign in to add a comment