New issue
Advanced search Search tips

Issue 736229 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug


Participants' hotlists:
Downloads-Framework-Service


Sign in to add a comment

[Download Service] Queue task requests if the service isn't ready

Project Member Reported by dtrainor@chromium.org, Jun 23 2017

Issue description

We should be queuing requests in DownloadServiceImpl if the task isn't ready.  That way once the controller is initialized we can flush the tasks.  This can be done pretty simply:

(1) Keep a list of Closures.
(2) For each API call, build the Closure.
(3) If the Controller is ready, execute the Closure.
(4) If the Controller is not ready, add it to the list.
(5) When the Controller is done initializing, flush the list.

(6) Add UMA to understand use cases around us getting early calls?
 
Also if the controller fails to load, drop the calls?
Owner: shaktisahu@chromium.org
Status: Started (was: Available)
Project Member

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

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

commit c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d
Author: Shakti Sahu <shaktisahu@chromium.org>
Date: Fri Jul 14 01:43:31 2017

Download Service : Queue task requests if service isn't ready

This CL adds queuing capability to the download service.
DownloadServiceImpl would queue all the requests such as StartDownload,
Pause/Resume/CancelDownload requests from the client as well as
OnStartScheduledTask calls from the system. After the controller is
ready, the service will execute the tasks in the same order as received.
If init failed, it will drop all the client requests, but will let the
scheduled tasks run which will be handled in the Controller
appropriately i.e. the finished callback will be invoked to notify the
OS of completion/rescheduling of the task.

This CL also ensures that the task finished callbacks will be invoked
only after the task to run is complete.

BUG= 736229 

Change-Id: I139ab0e0345be49c5e0351eb7d0533767ad8ff65
Reviewed-on: https://chromium-review.googlesource.com/550516
Commit-Queue: Shakti Sahu <shaktisahu@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486615}
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/controller.h
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/controller_impl.cc
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/controller_impl.h
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/controller_impl_unittest.cc
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/download_service_impl.cc
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/download_service_impl.h
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/download_service_impl_unittest.cc
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/file_monitor.h
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/file_monitor_impl.cc
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/file_monitor_impl.h
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/file_monitor_unittest.cc
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/test/mock_controller.cc
[modify] https://crrev.com/c4edca2b0dbc21e8957f2e3da55ff89f0c115e6d/components/download/internal/test/mock_controller.h

Status: Fixed (was: Started)

Sign in to add a comment