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

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

Issue 1982723002: Use FileTypePolicies for download danger classifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_policies
Patch Set: Fix bad rebase Created 4 years, 7 months 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
« no previous file with comments | « chrome/common/safe_browsing/file_type_policies.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/macros.h" 7 #include "base/macros.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 void RecordContentDispositionCountFlag( 65 void RecordContentDispositionCountFlag(
66 ContentDispositionCountTypes type, 66 ContentDispositionCountTypes type,
67 int flags_to_test, 67 int flags_to_test,
68 net::HttpContentDisposition::ParseResultFlags flag) { 68 net::HttpContentDisposition::ParseResultFlags flag) {
69 RecordContentDispositionCount(type, (flags_to_test & flag) == flag); 69 RecordContentDispositionCount(type, (flags_to_test & flag) == flag);
70 } 70 }
71 71
72 // Do not insert, delete, or reorder; this is being histogrammed. Append only. 72 // Do not insert, delete, or reorder; this is being histogrammed. Append only.
73 // All of the download_extensions.cc file types should be in this list. 73 // All of the download_file_types.asciipb entries should be in this list.
74 // TODO(asanka): This enum and the UMA metrics for dangerous/malicious downloads 74 // TODO(asanka): Replace this enum with calls to FileTypePolicies and move the
75 // should be moved to //chrome/browser/download. 75 // UMA metrics for dangerous/malicious downloads to //chrome/browser/download.
76 const base::FilePath::CharType* kDangerousFileTypes[] = { 76 const base::FilePath::CharType* kDangerousFileTypes[] = {
77 FILE_PATH_LITERAL(".ad"), 77 FILE_PATH_LITERAL(".ad"),
78 FILE_PATH_LITERAL(".ade"), 78 FILE_PATH_LITERAL(".ade"),
79 FILE_PATH_LITERAL(".adp"), 79 FILE_PATH_LITERAL(".adp"),
80 FILE_PATH_LITERAL(".ah"), 80 FILE_PATH_LITERAL(".ah"),
81 FILE_PATH_LITERAL(".apk"), 81 FILE_PATH_LITERAL(".apk"),
82 FILE_PATH_LITERAL(".app"), 82 FILE_PATH_LITERAL(".app"),
83 FILE_PATH_LITERAL(".application"), 83 FILE_PATH_LITERAL(".application"),
84 FILE_PATH_LITERAL(".asp"), 84 FILE_PATH_LITERAL(".asp"),
85 FILE_PATH_LITERAL(".asx"), 85 FILE_PATH_LITERAL(".asx"),
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 int state) { 769 int state) {
770 if (is_partial) 770 if (is_partial)
771 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnPartialResumption", state, 771 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnPartialResumption", state,
772 ORIGIN_STATE_ON_RESUMPTION_MAX); 772 ORIGIN_STATE_ON_RESUMPTION_MAX);
773 else 773 else
774 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnFullResumption", state, 774 UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnFullResumption", state,
775 ORIGIN_STATE_ON_RESUMPTION_MAX); 775 ORIGIN_STATE_ON_RESUMPTION_MAX);
776 } 776 }
777 777
778 } // namespace content 778 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/safe_browsing/file_type_policies.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698