New issue
Advanced search Search tips

Issue 893326 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug
Proj-Servicification



Sign in to add a comment

Remove URLRequestContextGetter from DownloadUrlParameters constructor.

Project Member Reported by mmenke@chromium.org, Oct 8

Issue description

URLRequestContextGetters are deprecated, and we should minimize their use.  The  DownloadUrlParameters takes a URLRequestContextGetter as an argument, and callers to it are one of the most common uses the StoragePartitions URLRequestContextGetter accessor, which makes auditing remaining callers 
of the deprecated method difficult.

Moreover, DownloadManagerImpl::BeginDownloadInternal() completely ignores the URLRequestContextGetter value of the DownloadUrlParameters, anyways.  So we can just remove the argument and update all callers, and everything will still continue to work.
 
Owner: mmenke@chromium.org
Cc: dtrainor@chromium.org qin...@chromium.org
[+dtrainor, +qinmin]:  I'm not missing some reason why the URLRequestContextGetter set in DownloadUrlParameters might be useful, am I?  If it's needed, we could also just set it when it's sent to the download system instead.
I think it is for non-network service code path, which is being used to construct the URLRequest here:
https://cs.chromium.org/chromium/src/content/browser/download/download_utils.cc?dr=CSs&g=0&l=42




But it's overwritten here:

https://cs.chromium.org/chromium/src/content/browser/download/download_manager_impl.cc?type=cs&q=DownloadManagerImpl::BeginDownloadInterna&g=0&l=1261

Which is called by DownloadManagerImpl::DownloadUrl(), so it seems like we just overwrite it in the network service disabled path, anyways, no?
My inclination is to just remove it from DownloadURLParameters, and then grab it as needed in BeginDownloadInternal, passing it directly to BeginDownload.  That will make sure I'm not missing anything, and further reduce the scope of the class.
seems so,  looks like we can just get it from the storage partition
Project Member

Comment 7 by bugdroid1@chromium.org, Oct 10

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

commit 6d93c3cdf6de2be69b1d7dc6fc863890d270be71
Author: Matt Menke <mmenke@chromium.org>
Date: Wed Oct 10 15:21:50 2018

Remove URLRequestContextGetter field from DownloadUrlParameters.

It was only being used in a subset of paths. Now pass it around
explicitly instead. It will still need to be completely removed, once
the network service ships. This intermediary step just restricts the
number and scope of download-related URLRequestContextGetter
dependencies, which makes it easier to audit remaining
URLRequestContextGetter consumers.

Bug:  893326 
Change-Id: Ia5f3693e8fef53ab175cd87ebcf8e545dd009362
Reviewed-on: https://chromium-review.googlesource.com/c/1270342
Reviewed-by: Tommy Li <tommycli@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Asanka Herath <asanka@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Min Qin <qinmin@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598333}
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/chrome/browser/extensions/api/downloads/downloads_api.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/chrome/browser/extensions/webstore_installer.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/chrome/browser/plugins/pdf_plugin_placeholder_observer.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/chrome/browser/renderer_context_menu/render_view_context_menu.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/content/internal/download_driver_impl.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/internal/common/DEPS
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/internal/common/download_item_impl.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/internal/common/download_job_factory.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/internal/common/download_worker.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/internal/common/download_worker.h
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/internal/common/parallel_download_job.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/internal/common/parallel_download_job.h
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/internal/common/url_download_handler_factory.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/public/common/download_item_impl.h
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/public/common/download_url_parameters.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/public/common/download_url_parameters.h
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/components/download/public/common/url_download_handler_factory.h
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/download/download_manager_impl.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/download/download_request_core.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/download/download_request_core.h
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/download/download_request_core_unittest.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/download/download_request_utils.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/download/download_utils.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/download/download_utils.h
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/download/url_downloader_factory.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/download/url_downloader_factory.h
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/frame_host/render_frame_message_filter.cc
[modify] https://crrev.com/6d93c3cdf6de2be69b1d7dc6fc863890d270be71/content/browser/web_contents/web_contents_impl.cc

Status: Fixed (was: Assigned)

Sign in to add a comment