summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_request_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/download/download_request_manager.cc')
-rw-r--r--chrome/browser/download/download_request_manager.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/download/download_request_manager.cc b/chrome/browser/download/download_request_manager.cc
index 6078fce..98efb19 100644
--- a/chrome/browser/download/download_request_manager.cc
+++ b/chrome/browser/download/download_request_manager.cc
@@ -177,7 +177,7 @@ DownloadRequestManager::~DownloadRequestManager() {
DownloadRequestManager::DownloadStatus
DownloadRequestManager::GetDownloadStatus(TabContents* tab) {
- TabDownloadState* state = GetDownloadState(&tab->controller(), NULL, false);
+ TabDownloadState* state = GetDownloadState(tab->controller(), NULL, false);
return state ? state->download_status() : ALLOW_ONE_DOWNLOAD;
}
@@ -193,7 +193,13 @@ void DownloadRequestManager::CanDownloadOnIOThread(int render_process_host_id,
}
void DownloadRequestManager::OnUserGesture(TabContents* tab) {
- TabDownloadState* state = GetDownloadState(&tab->controller(), NULL, false);
+ NavigationController* controller = tab->controller();
+ if (!controller) {
+ NOTREACHED();
+ return;
+ }
+
+ TabDownloadState* state = GetDownloadState(controller, NULL, false);
if (!state)
return;
@@ -250,8 +256,10 @@ void DownloadRequestManager::CanDownloadImpl(
effective_tab->delegate()->GetConstrainingContents(effective_tab);
}
+ NavigationController* controller = effective_tab->controller();
+ DCHECK(controller);
TabDownloadState* state = GetDownloadState(
- &effective_tab->controller(), &originating_tab->controller(), true);
+ controller, originating_tab->controller(), true);
switch (state->download_status()) {
case ALLOW_ALL_DOWNLOADS:
ScheduleNotification(callback, true);