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

Side by Side Diff: content/browser/download/download_stats.cc

Issue 1429523002: Safebrowsing check file extensions that open in IE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: histograms, kDownloadFileTypes Created 5 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 unified diff | Download patch
OLDNEW
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 "content/browser/download/download_stats.h" 5 #include "content/browser/download/download_stats.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/metrics/sparse_histogram.h" 8 #include "base/metrics/sparse_histogram.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "content/browser/download/download_resource_handler.h" 10 #include "content/browser/download/download_resource_handler.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 FILE_PATH_LITERAL(".ps1xml"), 206 FILE_PATH_LITERAL(".ps1xml"),
207 FILE_PATH_LITERAL(".ps2"), 207 FILE_PATH_LITERAL(".ps2"),
208 FILE_PATH_LITERAL(".ps2xml"), 208 FILE_PATH_LITERAL(".ps2xml"),
209 FILE_PATH_LITERAL(".psc1"), 209 FILE_PATH_LITERAL(".psc1"),
210 FILE_PATH_LITERAL(".psc2"), 210 FILE_PATH_LITERAL(".psc2"),
211 FILE_PATH_LITERAL(".xnk"), 211 FILE_PATH_LITERAL(".xnk"),
212 FILE_PATH_LITERAL(".appref-ms"), 212 FILE_PATH_LITERAL(".appref-ms"),
213 FILE_PATH_LITERAL(".gadget"), 213 FILE_PATH_LITERAL(".gadget"),
214 FILE_PATH_LITERAL(".efi"), 214 FILE_PATH_LITERAL(".efi"),
215 FILE_PATH_LITERAL(".fon"), 215 FILE_PATH_LITERAL(".fon"),
216 FILE_PATH_LITERAL(".partial"),
217 FILE_PATH_LITERAL(".svg"),
218 FILE_PATH_LITERAL(".xml"),
219 FILE_PATH_LITERAL(".xrm_ms"),
220 FILE_PATH_LITERAL(".xsl"),
221 FILE_PATH_LITERAL(".action"),
222 FILE_PATH_LITERAL(".bin"),
223 FILE_PATH_LITERAL(".inx"),
224 FILE_PATH_LITERAL(".ipa"),
225 FILE_PATH_LITERAL(".isu"),
226 FILE_PATH_LITERAL(".job"),
227 FILE_PATH_LITERAL(".out"),
228 FILE_PATH_LITERAL(".pad"),
229 FILE_PATH_LITERAL(".paf"),
230 FILE_PATH_LITERAL(".rgs"),
231 FILE_PATH_LITERAL(".u3p"),
232 FILE_PATH_LITERAL(".vbscript"),
233 FILE_PATH_LITERAL(".workflow"),
216 }; 234 };
217 235
218 // Maps extensions to their matching UMA histogram int value. 236 // Maps extensions to their matching UMA histogram int value.
219 int GetDangerousFileType(const base::FilePath& file_path) { 237 int GetDangerousFileType(const base::FilePath& file_path) {
220 for (size_t i = 0; i < arraysize(kDangerousFileTypes); ++i) { 238 for (size_t i = 0; i < arraysize(kDangerousFileTypes); ++i) {
221 if (file_path.MatchesExtension(kDangerousFileTypes[i])) 239 if (file_path.MatchesExtension(kDangerousFileTypes[i]))
222 return i + 1; 240 return i + 1;
223 } 241 }
224 return 0; // Unknown extension. 242 return 0; // Unknown extension.
225 } 243 }
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 int state) { 664 int state) {
647 if (is_partial) 665 if (is_partial)
648 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnPartialResumption", state, 666 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnPartialResumption", state,
649 ORIGIN_STATE_ON_RESUMPTION_MAX); 667 ORIGIN_STATE_ON_RESUMPTION_MAX);
650 else 668 else
651 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnFullResumption", state, 669 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnFullResumption", state,
652 ORIGIN_STATE_ON_RESUMPTION_MAX); 670 ORIGIN_STATE_ON_RESUMPTION_MAX);
653 } 671 }
654 672
655 } // namespace content 673 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/safe_browsing/download_protection_util.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698