| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 5 |
| 6 #include "chrome/browser/download/download_safe_browsing_client.h" | 6 #include "chrome/browser/download/download_safe_browsing_client.h" |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/metrics/stats_counters.h" | 10 #include "base/metrics/stats_counters.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/browser_thread.h" | |
| 13 #include "chrome/browser/download/download_manager.h" | 12 #include "chrome/browser/download/download_manager.h" |
| 14 #include "chrome/browser/history/download_create_info.h" | 13 #include "chrome/browser/history/download_create_info.h" |
| 15 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 14 #include "content/browser/browser_thread.h" |
| 15 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 16 | 16 |
| 17 // TODO(lzheng): Get rid of the AddRef and Release after | 17 // TODO(lzheng): Get rid of the AddRef and Release after |
| 18 // SafeBrowsingService::Client is changed to RefCountedThreadSafe<>. | 18 // SafeBrowsingService::Client is changed to RefCountedThreadSafe<>. |
| 19 | 19 |
| 20 DownloadSBClient::DownloadSBClient(DownloadCreateInfo* info) : info_(info) { | 20 DownloadSBClient::DownloadSBClient(DownloadCreateInfo* info) : info_(info) { |
| 21 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 21 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 22 CHECK(info_); | 22 CHECK(info_); |
| 23 ResourceDispatcherHost* rdh = g_browser_process->resource_dispatcher_host(); | 23 ResourceDispatcherHost* rdh = g_browser_process->resource_dispatcher_host(); |
| 24 if (rdh) | 24 if (rdh) |
| 25 sb_service_ = rdh->safe_browsing_service(); | 25 sb_service_ = rdh->safe_browsing_service(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 true, | 81 true, |
| 82 result); | 82 result); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 void DownloadSBClient::UpdateDownloadUrlCheckStats(SBStatsType stat_type) { | 86 void DownloadSBClient::UpdateDownloadUrlCheckStats(SBStatsType stat_type) { |
| 87 UMA_HISTOGRAM_ENUMERATION("SB2.DownloadUrlChecks", | 87 UMA_HISTOGRAM_ENUMERATION("SB2.DownloadUrlChecks", |
| 88 stat_type, | 88 stat_type, |
| 89 DOWNLOAD_URL_CHECKS_MAX); | 89 DOWNLOAD_URL_CHECKS_MAX); |
| 90 } | 90 } |
| OLD | NEW |