summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/download_protection_service.cc
diff options
context:
space:
mode:
authormattm <mattm@chromium.org>2014-11-19 17:20:50 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-20 01:21:18 +0000
commitdece1d546a4c322fd0ea3a1044169de35b24f8cc (patch)
treedaa1d8a43963e536730c386f076bce054252c68f /chrome/browser/safe_browsing/download_protection_service.cc
parent6117a47171092ae0e2cb00719db4e6f9395142a5 (diff)
downloadchromium_src-dece1d546a4c322fd0ea3a1044169de35b24f8cc.zip
chromium_src-dece1d546a4c322fd0ea3a1044169de35b24f8cc.tar.gz
chromium_src-dece1d546a4c322fd0ea3a1044169de35b24f8cc.tar.bz2
Safebrowsing: Fix crash if DownloadItem is destroyed before history check.
BUG=433380 Review URL: https://codereview.chromium.org/734843002 Cr-Commit-Position: refs/heads/master@{#304953}
Diffstat (limited to 'chrome/browser/safe_browsing/download_protection_service.cc')
-rw-r--r--chrome/browser/safe_browsing/download_protection_service.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index ba255be..30f2523 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -644,6 +644,9 @@ class DownloadProtectionService::CheckClientDownloadRequest
void GetTabRedirects() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (!service_)
+ return;
+
if (!tab_url_.is_valid()) {
SendRequest();
return;
@@ -669,6 +672,8 @@ class DownloadProtectionService::CheckClientDownloadRequest
const history::RedirectList* redirect_list) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_EQ(url, tab_url_);
+ if (!service_)
+ return;
if (!redirect_list->empty()) {
tab_redirects_.insert(