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/base_file.h" | 5 #include "content/browser/download/base_file.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // interrupted download. | 332 // interrupted download. |
333 // | 333 // |
334 // If the ScanAndSaveDownloadedFile() call failed, but the downloaded file is | 334 // If the ScanAndSaveDownloadedFile() call failed, but the downloaded file is |
335 // still around, then don't interrupt the download. Attachment Execution | 335 // still around, then don't interrupt the download. Attachment Execution |
336 // Services deletes the submitted file if the downloaded file is blocked by | 336 // Services deletes the submitted file if the downloaded file is blocked by |
337 // policy or if it was found to be infected. | 337 // policy or if it was found to be infected. |
338 // | 338 // |
339 // If the file is still there, then the error could be due to AES not being | 339 // If the file is still there, then the error could be due to AES not being |
340 // available or some other error during the AES invocation. In either case, | 340 // available or some other error during the AES invocation. In either case, |
341 // we don't surface the error to the user. | 341 // we don't surface the error to the user. |
342 if (!file_util::PathExists(full_path_)) { | 342 if (!base::PathExists(full_path_)) { |
343 DCHECK(FAILED(hr)); | 343 DCHECK(FAILED(hr)); |
344 result = MapScanAndSaveErrorCodeToInterruptReason(hr); | 344 result = MapScanAndSaveErrorCodeToInterruptReason(hr); |
345 if (result == DOWNLOAD_INTERRUPT_REASON_NONE) { | 345 if (result == DOWNLOAD_INTERRUPT_REASON_NONE) { |
346 RecordDownloadCount(FILE_MISSING_AFTER_SUCCESSFUL_SCAN_COUNT); | 346 RecordDownloadCount(FILE_MISSING_AFTER_SUCCESSFUL_SCAN_COUNT); |
347 result = DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED; | 347 result = DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED; |
348 } | 348 } |
349 LogInterruptReason("ScanAndSaveDownloadedFile", hr, result); | 349 LogInterruptReason("ScanAndSaveDownloadedFile", hr, result); |
350 } | 350 } |
351 bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED); | 351 bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED); |
352 return result; | 352 return result; |
353 } | 353 } |
354 | 354 |
355 } // namespace content | 355 } // namespace content |
OLD | NEW |