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

Unified Diff: chrome/browser/download/download_request_limiter.cc

Issue 10938033: Switch BlockedContentTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 | « no previous file | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698