| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/safe_browsing/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 database_manager_->CheckDownloadUrl(url_chain_, this)) { | 215 database_manager_->CheckDownloadUrl(url_chain_, this)) { |
| 216 CheckDone(SB_THREAT_TYPE_SAFE); | 216 CheckDone(SB_THREAT_TYPE_SAFE); |
| 217 } else { | 217 } else { |
| 218 // Add a reference to this object to prevent it from being destroyed | 218 // Add a reference to this object to prevent it from being destroyed |
| 219 // before url checking result is returned. | 219 // before url checking result is returned. |
| 220 AddRef(); | 220 AddRef(); |
| 221 } | 221 } |
| 222 } | 222 } |
| 223 | 223 |
| 224 bool IsDangerous(SBThreatType threat_type) const { | 224 bool IsDangerous(SBThreatType threat_type) const { |
| 225 return threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL; | 225 return threat_type == SB_THREAT_TYPE_URL_BINARY_MALWARE; |
| 226 } | 226 } |
| 227 | 227 |
| 228 // Implements SafeBrowsingDatabaseManager::Client. | 228 // Implements SafeBrowsingDatabaseManager::Client. |
| 229 void OnCheckDownloadUrlResult(const std::vector<GURL>& url_chain, | 229 void OnCheckDownloadUrlResult(const std::vector<GURL>& url_chain, |
| 230 SBThreatType threat_type) override { | 230 SBThreatType threat_type) override { |
| 231 CheckDone(threat_type); | 231 CheckDone(threat_type); |
| 232 UMA_HISTOGRAM_TIMES("SB2.DownloadUrlCheckDuration", | 232 UMA_HISTOGRAM_TIMES("SB2.DownloadUrlCheckDuration", |
| 233 base::TimeTicks::Now() - start_time_); | 233 base::TimeTicks::Now() - start_time_); |
| 234 Release(); | 234 Release(); |
| 235 } | 235 } |
| (...skipping 1755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1991 out_request->mutable_referrer_chain()); | 1991 out_request->mutable_referrer_chain()); |
| 1992 UMA_HISTOGRAM_COUNTS_100( | 1992 UMA_HISTOGRAM_COUNTS_100( |
| 1993 "SafeBrowsing.ReferrerURLChainSize.PPAPIDownloadAttribution", | 1993 "SafeBrowsing.ReferrerURLChainSize.PPAPIDownloadAttribution", |
| 1994 out_request->referrer_chain_size()); | 1994 out_request->referrer_chain_size()); |
| 1995 UMA_HISTOGRAM_ENUMERATION( | 1995 UMA_HISTOGRAM_ENUMERATION( |
| 1996 "SafeBrowsing.ReferrerAttributionResult.PPAPIDownloadAttribution", result, | 1996 "SafeBrowsing.ReferrerAttributionResult.PPAPIDownloadAttribution", result, |
| 1997 SafeBrowsingNavigationObserverManager::ATTRIBUTION_FAILURE_TYPE_MAX); | 1997 SafeBrowsingNavigationObserverManager::ATTRIBUTION_FAILURE_TYPE_MAX); |
| 1998 } | 1998 } |
| 1999 | 1999 |
| 2000 } // namespace safe_browsing | 2000 } // namespace safe_browsing |
| OLD | NEW |