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

Unified Diff: chrome/browser/extensions/webstore_installer.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/webstore_installer.cc
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index e2cddb4a753b8a5f57ec2ca0c51a55345f8eafe4..1b15972f7d0e75cdb03e782a13311cc20968db06 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -52,6 +52,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
@@ -665,11 +666,15 @@ void WebstoreInstaller::StartDownload(const std::string& extension_id,
int render_process_host_id = contents->GetRenderProcessHost()->GetID();
int render_view_host_routing_id =
contents->GetRenderViewHost()->GetRoutingID();
- content::ResourceContext* resource_context =
- controller.GetBrowserContext()->GetResourceContext();
+
+ content::RenderFrameHost* render_frame_host = contents->GetMainFrame();
+ content::StoragePartition* storage_partition =
+ BrowserContext::GetStoragePartition(profile_,
+ render_frame_host->GetSiteInstance());
std::unique_ptr<DownloadUrlParameters> params(new DownloadUrlParameters(
download_url_, render_process_host_id, render_view_host_routing_id,
- contents->GetMainFrame()->GetRoutingID(), resource_context));
+ render_frame_host->GetRoutingID(),
+ storage_partition->GetURLRequestContext()));
params->set_file_path(file);
if (controller.GetVisibleEntry())
params->set_referrer(content::Referrer::SanitizeForRequest(

Powered by Google App Engine
This is Rietveld 408576698