New issue
Advanced search Search tips

Issue 736235 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Oct 15
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug


Participants' hotlists:
Downloads-Framework-Service


Sign in to add a comment

[Download Service] Add chrome://download-internals and add a service section

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

Issue description

We need an easy way to test and validate the Download Service.  I think a good way to do this would be to add a chrome://download-internals page and add a section on the download service.  This would probably have the following behavior:

(1) Can see all events going by in the form of a stream.
(2) Can see all downloads (both queued and active).  This includes their state and all relevant params.
(3) Can start a download from the UI.
(4) Can pause, resume, or cancel any download from the UI.
(5) Can see the device criteria status as well as the service status.

I would build this like the following:

General Setup/Ownership of Logger:
(1) Add a ServiceLogger that exposes JSON messages.  The logger has observers to be notified on new events.
(2) Add a DownloadService::GetLogger() to expose the logger.
(3) Have the internal LoggerImpl owned by the DownloadManagerService.  Have it get passed into the Controller.
(4) Have the Controller notify the logger of all relevant events.
(5) Have the logger ignore those events if there are no observers.

Logger behaviors:
(1) Logger can queue up to X max messages.
(2) Logger can have both an event log (more human readable) and a JSON log.  The LoggerImpl can know about download/internal because it will live there.

WebUI:
(1) To start downloads have a DemoClient or WebUIClient (where it goes depends on what we call it).
(2) Have actual WebUI pages hook onto the Client when they start as observers (or maybe the WebUI can extend Client and we just pass all calls through).
(3) Have the client hook onto a BrowserContext as UserData so that the WebUI can find it.
(4) Have the WebUI observer push the JSON/log strings through to the javascript.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 26 2017

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

commit e6101045a027eb49b8560fb224a566b7ec3a3b4f
Author: David Trainor <dtrainor@chromium.org>
Date: Tue Sep 26 19:11:47 2017

Add the framework for chrome://download-internals

Add chrome://download-internals to expose long-running download state,
as the system is now a root service of multiple other features.  This
CL sets up the initial skeleton and pipeline.  Future CLs will add
more capabilities.  This page will be used by more download-related
features in the near future (e.g. background fetch).

Sets up the following framework in the download service:

Logger: The public interface to the log code.  Can be queried for state
and returns base::Value objects.
Logger::Observer: Used to notify external components (e.g. WebUI) about
internal state changes.
LogSink: The internal interface that should be notified by internal
components about potential log-worthy changes.
LogSource: The internal interface that Logger will request state from.

BUG= 736235 

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I0df66753884a2bc3f8e5ef7e0466cc879616a3a1
Reviewed-on: https://chromium-review.googlesource.com/592314
Commit-Queue: David Trainor <dtrainor@chromium.org>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Michael Giuffrida <michaelpg@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Reviewed-by: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504449}
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/browser_resources.grd
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/resources/download_internals/compiled_resources2.gyp
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/resources/download_internals/download_internals.css
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/resources/download_internals/download_internals.html
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/resources/download_internals/download_internals.js
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/resources/download_internals/download_internals_browser_proxy.js
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/ui/browser_navigator.cc
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/ui/webui/download_internals/download_internals_ui.cc
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/ui/webui/download_internals/download_internals_ui.h
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.cc
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.h
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/common/url_constants.cc
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/chrome/common/url_constants.h
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/content/factory/download_service_factory.cc
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/BUILD.gn
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/controller_impl.cc
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/controller_impl.h
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/controller_impl_unittest.cc
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/download_service_impl.cc
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/download_service_impl.h
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/download_service_impl_unittest.cc
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/log_sink.h
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/log_source.h
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/logger_impl.cc
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/logger_impl.h
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/test/BUILD.gn
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/test/black_hole_log_sink.cc
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/test/black_hole_log_sink.h
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/test/mock_log_sink.cc
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/internal/test/mock_log_sink.h
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/public/BUILD.gn
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/public/download_service.h
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/public/logger.h
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/public/test/BUILD.gn
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/public/test/empty_logger.cc
[add] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/public/test/empty_logger.h
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/public/test/test_download_service.cc
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/components/download/public/test/test_download_service.h
[modify] https://crrev.com/e6101045a027eb49b8560fb224a566b7ec3a3b4f/third_party/closure_compiler/compiled_resources2.gyp

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 13 2017

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

commit 6c38ac6528c7cb293eca376f98ac42ff96f68798
Author: David Trainor <dtrainor@chromium.org>
Date: Fri Oct 13 00:57:50 2017

[Download Service] Improve chrome://download-internals

Add support for showing the following in chrome://download-internals:
- All currently running download requests.  These are pulled from
storage and will persist across refreshes.
- All completed download requests.  Successful downloads are pulled from
storage until they are cleaned up and will persist across refreshes.
Failed downloads have no persisted state and will not be present after
refreshing the page or if you visit Chrome after the download has
failed.
- All download service requests.  These will also not be persisted after
a page refresh.

BUG= 736235 

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Id7f7d48282f088bedb6868bc9baf8086b8dadcdf
Reviewed-on: https://chromium-review.googlesource.com/707925
Commit-Queue: David Trainor <dtrainor@chromium.org>
Reviewed-by: Michael Giuffrida <michaelpg@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508574}
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/browser_resources.grd
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/resources/download_internals/compiled_resources2.gyp
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/resources/download_internals/download_internals.css
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/resources/download_internals/download_internals.html
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/resources/download_internals/download_internals.js
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/resources/download_internals/download_internals_browser_proxy.js
[add] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/resources/download_internals/download_internals_visuals.js
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/ui/webui/download_internals/download_internals_ui.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.h
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/BUILD.gn
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/client_set.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/client_set_unittest.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/controller_impl.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/controller_impl.h
[add] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/debugging_client.cc
[add] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/debugging_client.h
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/log_sink.h
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/log_source.h
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/logger_impl.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/logger_impl.h
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/proto/entry.proto
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/proto_conversions.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/stats.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/test/black_hole_log_sink.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/internal/test/black_hole_log_sink.h
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/public/clients.h
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/public/logger.h
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/public/test/empty_logger.cc
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/components/download/public/test/empty_logger.h
[modify] https://crrev.com/6c38ac6528c7cb293eca376f98ac42ff96f68798/tools/metrics/histograms/histograms.xml

Project Member

Comment 3 by sheriffbot@chromium.org, Oct 15

Status: Archived (was: Available)
This issue has been available for more than 365 days with no owner or cc list, so archiving this bug. Please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment