| 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;
|
|
|