From 3993c3159b858010f9f38c780f498e28d74d43ce Mon Sep 17 00:00:00 2001
From: "mattm@chromium.org"
 <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Tue, 8 May 2012 21:14:11 +0000
Subject: Check if SafeBrowsingService is enabled in
 SendSerializedMalwareDetails.

Fixes possible shutdown crash.

BUG=126597
TEST=Load a malware page, make sure the "send additional data" checkbox is checked, then quit chrome.  Repeat.

Review URL: https://chromiumcodereview.appspot.com/10388022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135908 0039d316-1c4b-4281-b951-d872f2087c98
---
 chrome/browser/safe_browsing/safe_browsing_service.cc | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'chrome')

diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index 100f22a..642bf38 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -1209,6 +1209,9 @@ void SafeBrowsingService::ReportSafeBrowsingHitOnIOThread(
 void SafeBrowsingService::SendSerializedMalwareDetails(
     const std::string& serialized) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+  if (!enabled_)
+    return;
+
   if (!serialized.empty()) {
     DVLOG(1) << "Sending serialized malware details.";
     protocol_manager_->ReportMalwareDetails(serialized);
-- 
cgit v1.1