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

Issue 1979783002: [Merge M51][Downloads] Use the initiating StoragePartition for resumption. (Closed)

Created:
4 years, 7 months ago by asanka
Modified:
4 years, 7 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2704
Target Ref:
refs/pending/branch-heads/2704
Project:
chromium
Visibility:
Public.

Description

[Merge M51][Downloads] Use the initiating StoragePartition for resumption. The URLRequest created for downloads resumption should be created using the same StoragePartition as the one used to initiate the download. Downloads used to use the request context returned via ResourceContext::GetURLRequestContext(), which can yield the wrong URLRequestContext (and the wrong StoragePartition) when multiple StoragePartitions are in use. Currently non-default StoragePartitions are used for implementing WebView tag in platform apps. Hence a download that's initiated in a WebView, if resumed, could result in a network request being issued that's backed by the wrong StoragePartition without this fix. This change: * Adds the site instance URL to the metadata that's persisted for each download. * Updates history database schema to accommodate site URL. * Updates DownloadURLParameters to take a URLRequestContextGetter instead of a ResourceContext. The latter can be uniquely determined by the DownloadManager. * Updates DownloadItemImpl to use the site instance URL to determine the correct StoragePartition to use during resumption. The rest is assorted tests and plumbing. R=creis@chromium.org,sky@chromium.org,asargent@chromium.org,jam@chromium.org,svaldez@chromium.org BUG=606627 Review-Url: https://codereview.chromium.org/1924473003 Cr-Commit-Position: refs/heads/master@{#392849} (cherry picked from commit 3b4be1260ebe931143425302a867b7e7407d002b) Committed: https://chromium.googlesource.com/chromium/src/+/c846f97aabaf9caee8c51867069b3bcada00c9bb

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+863 lines, -288 lines) Patch
M chrome/browser/apps/guest_view/web_view_browsertest.cc View 8 chunks +364 lines, -2 lines 0 comments Download
M chrome/browser/download/download_history.cc View 3 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/download/download_history_unittest.cc View 5 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/download/download_ui_controller_unittest.cc View 2 chunks +6 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.cc View 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc View 4 chunks +50 lines, -8 lines 0 comments Download
M chrome/browser/extensions/webstore_installer.cc View 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc View 2 chunks +5 lines, -4 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/download_cookie_isolation/background.js View 1 chunk +1 line, -1 line 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/download_cookie_isolation/guest.html View 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/download_cookie_isolation/guest.js View 1 chunk +31 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/download_cookie_isolation/manifest.json View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/web_view/download_cookie_isolation/window.html View 1 chunk +4 lines, -4 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/web_view/download_cookie_isolation/window.js View 1 chunk +77 lines, -0 lines 0 comments Download
M components/history/core/browser/download_database.h View 1 chunk +4 lines, -0 lines 0 comments Download
M components/history/core/browser/download_database.cc View 6 chunks +14 lines, -6 lines 0 comments Download
M components/history/core/browser/download_row.h View 2 chunks +4 lines, -0 lines 0 comments Download
M components/history/core/browser/download_row.cc View 3 chunks +4 lines, -1 line 0 comments Download
M components/history/core/browser/history_backend_db_unittest.cc View 6 chunks +65 lines, -9 lines 0 comments Download
M components/history/core/browser/history_database.cc View 2 chunks +10 lines, -1 line 0 comments Download
M components/history/core/test/history_backend_db_base_test.cc View 1 chunk +2 lines, -1 line 0 comments Download
A + components/test/data/history/history.31.sql View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/download/download_browsertest.cc View 7 chunks +42 lines, -138 lines 0 comments Download
M content/browser/download/download_create_info.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/download/download_item_factory.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/download_item_impl.h View 4 chunks +5 lines, -2 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 7 chunks +28 lines, -19 lines 0 comments Download
M content/browser/download/download_item_impl_unittest.cc View 2 chunks +1 line, -3 lines 0 comments Download
M content/browser/download/download_manager_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 8 chunks +15 lines, -9 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 4 chunks +10 lines, -21 lines 0 comments Download
M content/browser/download/download_request_core.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M content/browser/download/download_resource_handler.cc View 4 chunks +12 lines, -2 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/download_item.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/download_manager.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/download_url_parameters.h View 5 chunks +26 lines, -15 lines 0 comments Download
M content/public/browser/download_url_parameters.cc View 4 chunks +10 lines, -7 lines 0 comments Download
M content/public/test/mock_download_item.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/mock_download_manager.h View 3 chunks +3 lines, -0 lines 0 comments Download
M content/public/test/mock_download_manager.cc View 6 chunks +10 lines, -5 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
asanka
4 years, 7 months ago (2016-05-14 01:45:44 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
c846f97aabaf9caee8c51867069b3bcada00c9bb.

Powered by Google App Engine
This is Rietveld 408576698