| Index: chrome/browser/download/download_request_limiter.cc
|
| diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc
|
| index 3a545f8eef46d8f5d67c6642d411a722494fcf89..4d78e4dbea354fb45226a2ba3d3b71b5a30c8bc1 100644
|
| --- a/chrome/browser/download/download_request_limiter.cc
|
| +++ b/chrome/browser/download/download_request_limiter.cc
|
| @@ -301,14 +301,12 @@ void DownloadRequestLimiter::CanDownloadImpl(WebContents* originating_contents,
|
| // If the tab requesting the download is a constrained popup that is not
|
| // shown, treat the request as if it came from the parent.
|
| WebContents* effective_contents = originating_contents;
|
| - TabContents* originating_tab_contents =
|
| - TabContents::FromWebContents(originating_contents);
|
| - if (originating_tab_contents &&
|
| - originating_tab_contents->blocked_content_tab_helper()->delegate()) {
|
| - effective_contents =
|
| - originating_tab_contents->blocked_content_tab_helper()->delegate()->
|
| - GetConstrainingTabContents(originating_tab_contents)->
|
| - web_contents();
|
| + BlockedContentTabHelper* blocked_content_tab_helper =
|
| + BlockedContentTabHelper::FromWebContents(originating_contents);
|
| + if (blocked_content_tab_helper &&
|
| + blocked_content_tab_helper->delegate()) {
|
| + effective_contents = blocked_content_tab_helper->delegate()->
|
| + GetConstrainingWebContents(originating_contents);
|
| }
|
|
|
| TabDownloadState* state = GetDownloadState(
|
|
|