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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1977623002: Updates to DownloadUrlParameters in preparation for OOPIF changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 5621f827b46d1f009ff3cb81d369fc9adbb12d02..2592d5a228d74df5f786ee75da3bb2ba28a895ff 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2769,9 +2769,14 @@ void WebContentsImpl::SaveFrameWithHeaders(const GURL& url,
return;
// TODO(nasko): This check for main frame is incorrect and should be fixed
- // by explicitly passing in which frame this method should target.
+ // by explicitly passing in which frame this method should target. This would
+ // indicate whether it's the main frame, and also tell us the frame pointer
+ // to use for routing.
bool is_main_frame = (url == GetLastCommittedURL());
+ RenderFrameHost* frame_host = GetMainFrame();
+ StoragePartition* storage_partition = BrowserContext::GetStoragePartition(
+ GetBrowserContext(), frame_host->GetSiteInstance());
DownloadManager* dlm =
BrowserContext::GetDownloadManager(GetBrowserContext());
if (!dlm)
@@ -2782,8 +2787,10 @@ void WebContentsImpl::SaveFrameWithHeaders(const GURL& url,
if (entry)
post_id = entry->GetPostID();
}
- std::unique_ptr<DownloadUrlParameters> params(
- DownloadUrlParameters::FromWebContents(this, url));
+ std::unique_ptr<DownloadUrlParameters> params(new DownloadUrlParameters(
+ url, frame_host->GetProcess()->GetID(),
+ frame_host->GetRenderViewHost()->GetRoutingID(),
+ frame_host->GetRoutingID(), storage_partition->GetURLRequestContext()));
params->set_referrer(referrer);
params->set_post_id(post_id);
if (post_id >= 0)
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/public/browser/download_url_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698