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

Unified Diff: chrome/browser/safe_browsing/download_protection_service.cc

Issue 734843002: Safebrowsing: Fix crash if DownloadItem is destroyed before history check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month 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/safe_browsing/download_protection_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/download_protection_service.cc
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index ba255be92d30fec094e9e8dcfe14bd764256927a..30f2523adcc4a3b1dee68117ff172c565c557bdc 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(
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/download_protection_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698