| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |