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