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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc

Issue 2072933002: Add sampling of unknown filetypes in download protection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add int values for histograms to ensure they match Created 4 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/incident_reporting/last_download_finder.h " 5 #include "chrome/browser/safe_browsing/incident_reporting/last_download_finder.h "
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 int64_t GetEndTime(const ClientIncidentReport_DownloadDetails& details) { 52 int64_t GetEndTime(const ClientIncidentReport_DownloadDetails& details) {
53 return details.download_time_msec(); 53 return details.download_time_msec();
54 } 54 }
55 55
56 bool IsBinaryDownloadForCurrentOS( 56 bool IsBinaryDownloadForCurrentOS(
57 ClientDownloadRequest::DownloadType download_type) { 57 ClientDownloadRequest::DownloadType download_type) {
58 // Whenever a new DownloadType is introduced, the following set of conditions 58 // Whenever a new DownloadType is introduced, the following set of conditions
59 // should also be updated so that the IsBinaryDownloadForCurrentOS() will 59 // should also be updated so that the IsBinaryDownloadForCurrentOS() will
60 // return true for that DownloadType as appropriate. 60 // return true for that DownloadType as appropriate.
61 static_assert(ClientDownloadRequest::DownloadType_MAX == 61 static_assert(ClientDownloadRequest::DownloadType_MAX ==
62 ClientDownloadRequest::PPAPI_SAVE_REQUEST, 62 ClientDownloadRequest::SAMPLED_UNSUPPORTED_FILE,
63 "Update logic below"); 63 "Update logic below");
64 64
65 // Platform-specific types are relevant only for their own platforms. 65 // Platform-specific types are relevant only for their own platforms.
66 #if defined(OS_MACOSX) 66 #if defined(OS_MACOSX)
67 if (download_type == ClientDownloadRequest::MAC_EXECUTABLE || 67 if (download_type == ClientDownloadRequest::MAC_EXECUTABLE ||
68 download_type == ClientDownloadRequest::INVALID_MAC_ARCHIVE) 68 download_type == ClientDownloadRequest::INVALID_MAC_ARCHIVE)
69 return true; 69 return true;
70 #elif defined(OS_ANDROID) 70 #elif defined(OS_ANDROID)
71 if (download_type == ClientDownloadRequest::ANDROID_APK) 71 if (download_type == ClientDownloadRequest::ANDROID_APK)
72 return true; 72 return true;
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 445 }
446 } 446 }
447 } 447 }
448 448
449 void LastDownloadFinder::HistoryServiceBeingDeleted( 449 void LastDownloadFinder::HistoryServiceBeingDeleted(
450 history::HistoryService* history_service) { 450 history::HistoryService* history_service) {
451 history_service_observer_.Remove(history_service); 451 history_service_observer_.Remove(history_service);
452 } 452 }
453 453
454 } // namespace safe_browsing 454 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/download_protection_service_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698