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

Unified Diff: content/browser/download/download_request_handle.cc

Issue 21388003: Move routing to RenderFrameHost instead of RenderViewHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move global map to .cc file. Created 7 years, 4 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
« no previous file with comments | « chrome/browser/tab_contents/tab_util.cc ('k') | content/browser/loader/render_view_host_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_request_handle.cc
diff --git a/content/browser/download/download_request_handle.cc b/content/browser/download/download_request_handle.cc
index 32c5b987799d510d79fb6e12c4327784498fdd86..953de360e164e7c59ef59b2df866ebce79bf71af 100644
--- a/content/browser/download/download_request_handle.cc
+++ b/content/browser/download/download_request_handle.cc
@@ -37,8 +37,15 @@ DownloadRequestHandle::DownloadRequestHandle(
WebContents* DownloadRequestHandle::GetWebContents() const {
RenderViewHostImpl* render_view_host =
RenderViewHostImpl::FromID(child_id_, render_view_id_);
- if (!render_view_host)
- return NULL;
+ if (!render_view_host) {
+ RenderFrameHost* render_frame_host =
+ RenderFrameHost::FromID(child_id_, render_view_id_);
+ if (!render_frame_host)
+ return NULL;
+
+ return render_frame_host->GetRenderViewHost()->GetDelegate()->
+ GetAsWebContents();
+ }
return render_view_host->GetDelegate()->GetAsWebContents();
}
@@ -46,8 +53,15 @@ WebContents* DownloadRequestHandle::GetWebContents() const {
DownloadManager* DownloadRequestHandle::GetDownloadManager() const {
RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(
child_id_, render_view_id_);
- if (rvh == NULL)
- return NULL;
+ if (rvh == NULL) {
+ RenderFrameHost* render_frame_host =
+ RenderFrameHost::FromID(child_id_, render_view_id_);
+ if (!render_frame_host)
+ return NULL;
+
+ rvh = static_cast<RenderViewHostImpl*>(
+ render_frame_host->GetRenderViewHost());
+ }
RenderProcessHost* rph = rvh->GetProcess();
if (rph == NULL)
return NULL;
« no previous file with comments | « chrome/browser/tab_contents/tab_util.cc ('k') | content/browser/loader/render_view_host_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698