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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api.cc

Issue 1924473003: [Downloads] Use the initiating StoragePartition for resumption. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in comment Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/downloads/downloads_api.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc
index 7c87a6f10c9cd44df4046e405e3c6f6b57d1a773..a4cc708dfa08d25df31426efcec4dc5af13d0dea 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -63,8 +63,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
-#include "content/public/browser/resource_context.h"
-#include "content/public/browser/resource_dispatcher_host.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_function_dispatcher.h"
@@ -957,12 +956,16 @@ bool DownloadsDownloadFunction::RunAsync() {
if (include_incognito() && GetProfile()->HasOffTheRecordProfile())
current_profile = GetProfile()->GetOffTheRecordProfile();
+ content::StoragePartition* storage_partition =
+ BrowserContext::GetStoragePartition(
+ render_frame_host()->GetProcess()->GetBrowserContext(),
+ render_frame_host()->GetSiteInstance());
std::unique_ptr<content::DownloadUrlParameters> download_params(
new content::DownloadUrlParameters(
download_url, render_frame_host()->GetProcess()->GetID(),
render_view_host_do_not_use()->GetRoutingID(),
render_frame_host()->GetRoutingID(),
- current_profile->GetResourceContext()));
+ storage_partition->GetURLRequestContext()));
base::FilePath creator_suggested_filename;
if (options.filename.get()) {

Powered by Google App Engine
This is Rietveld 408576698