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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 interrupt_reason = DOWNLOAD_INTERRUPT_REASON_FILE_FAILED; | 346 interrupt_reason = DOWNLOAD_INTERRUPT_REASON_FILE_FAILED; |
347 else if (result != 0) | 347 else if (result != 0) |
348 interrupt_reason = MapShFileOperationCodes(result); | 348 interrupt_reason = MapShFileOperationCodes(result); |
349 | 349 |
350 if (interrupt_reason != DOWNLOAD_INTERRUPT_REASON_NONE) | 350 if (interrupt_reason != DOWNLOAD_INTERRUPT_REASON_NONE) |
351 return LogInterruptReason("SHFileOperation", result, interrupt_reason); | 351 return LogInterruptReason("SHFileOperation", result, interrupt_reason); |
352 return interrupt_reason; | 352 return interrupt_reason; |
353 } | 353 } |
354 | 354 |
355 DownloadInterruptReason BaseFile::AnnotateWithSourceInformation() { | 355 DownloadInterruptReason BaseFile::AnnotateWithSourceInformation() { |
356 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 356 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
357 DCHECK(!detached_); | 357 DCHECK(!detached_); |
358 | 358 |
359 bound_net_log_.BeginEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED); | 359 bound_net_log_.BeginEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED); |
360 DownloadInterruptReason result = DOWNLOAD_INTERRUPT_REASON_NONE; | 360 DownloadInterruptReason result = DOWNLOAD_INTERRUPT_REASON_NONE; |
361 std::string braces_guid = "{" + client_guid_ + "}"; | 361 std::string braces_guid = "{" + client_guid_ + "}"; |
362 GUID guid = GUID_NULL; | 362 GUID guid = GUID_NULL; |
363 if (base::IsValidGUID(client_guid_)) { | 363 if (base::IsValidGUID(client_guid_)) { |
364 HRESULT hr = CLSIDFromString( | 364 HRESULT hr = CLSIDFromString( |
365 base::UTF8ToUTF16(braces_guid).c_str(), &guid); | 365 base::UTF8ToUTF16(braces_guid).c_str(), &guid); |
366 if (FAILED(hr)) | 366 if (FAILED(hr)) |
(...skipping 20 matching lines...) Expand all Loading... |
387 RecordDownloadCount(FILE_MISSING_AFTER_SUCCESSFUL_SCAN_COUNT); | 387 RecordDownloadCount(FILE_MISSING_AFTER_SUCCESSFUL_SCAN_COUNT); |
388 result = DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED; | 388 result = DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED; |
389 } | 389 } |
390 LogInterruptReason("ScanAndSaveDownloadedFile", hr, result); | 390 LogInterruptReason("ScanAndSaveDownloadedFile", hr, result); |
391 } | 391 } |
392 bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED); | 392 bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_ANNOTATED); |
393 return result; | 393 return result; |
394 } | 394 } |
395 | 395 |
396 } // namespace content | 396 } // namespace content |
OLD | NEW |