| 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 <cguid.h> | 8 #include <cguid.h> |
| 9 #include <objbase.h> | 9 #include <objbase.h> |
| 10 #include <shellapi.h> | 10 #include <shellapi.h> |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 source.append(1, L'\0'); | 331 source.append(1, L'\0'); |
| 332 target.append(1, L'\0'); | 332 target.append(1, L'\0'); |
| 333 | 333 |
| 334 SHFILEOPSTRUCT move_info = {0}; | 334 SHFILEOPSTRUCT move_info = {0}; |
| 335 move_info.wFunc = FO_MOVE; | 335 move_info.wFunc = FO_MOVE; |
| 336 move_info.pFrom = source.c_str(); | 336 move_info.pFrom = source.c_str(); |
| 337 move_info.pTo = target.c_str(); | 337 move_info.pTo = target.c_str(); |
| 338 move_info.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | | 338 move_info.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | |
| 339 FOF_NOCONFIRMMKDIR | FOF_NOCOPYSECURITYATTRIBS; | 339 FOF_NOCONFIRMMKDIR | FOF_NOCOPYSECURITYATTRIBS; |
| 340 | 340 |
| 341 base::TimeTicks now = base::TimeTicks::Now(); | |
| 342 int result = SHFileOperation(&move_info); | 341 int result = SHFileOperation(&move_info); |
| 343 DownloadInterruptReason interrupt_reason = DOWNLOAD_INTERRUPT_REASON_NONE; | 342 DownloadInterruptReason interrupt_reason = DOWNLOAD_INTERRUPT_REASON_NONE; |
| 344 | 343 |
| 345 if (result == 0 && move_info.fAnyOperationsAborted) | 344 if (result == 0 && move_info.fAnyOperationsAborted) |
| 346 interrupt_reason = DOWNLOAD_INTERRUPT_REASON_FILE_FAILED; | 345 interrupt_reason = DOWNLOAD_INTERRUPT_REASON_FILE_FAILED; |
| 347 else if (result != 0) | 346 else if (result != 0) |
| 348 interrupt_reason = MapShFileOperationCodes(result); | 347 interrupt_reason = MapShFileOperationCodes(result); |
| 349 | 348 |
| 350 if (interrupt_reason != DOWNLOAD_INTERRUPT_REASON_NONE) | 349 if (interrupt_reason != DOWNLOAD_INTERRUPT_REASON_NONE) |
| 351 return LogInterruptReason("SHFileOperation", result, interrupt_reason); | 350 return LogInterruptReason("SHFileOperation", result, interrupt_reason); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 RecordDownloadCount(FILE_MISSING_AFTER_SUCCESSFUL_SCAN_COUNT); | 386 RecordDownloadCount(FILE_MISSING_AFTER_SUCCESSFUL_SCAN_COUNT); |
| 388 result = DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED; | 387 result = DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED; |
| 389 } | 388 } |
| 390 LogInterruptReason("ScanAndSaveDownloadedFile", hr, result); | 389 LogInterruptReason("ScanAndSaveDownloadedFile", hr, result); |
| 391 } | 390 } |
| 392 bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED); | 391 bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED); |
| 393 return result; | 392 return result; |
| 394 } | 393 } |
| 395 | 394 |
| 396 } // namespace content | 395 } // namespace content |
| OLD | NEW |