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

Unified Diff: trunk/src/content/browser/download/base_file.cc

Issue 342233002: Revert 278483 "[Downloads] Retry renames after transient failures." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/content/browser/download/base_file.cc
===================================================================
--- trunk/src/content/browser/download/base_file.cc (revision 278536)
+++ trunk/src/content/browser/download/base_file.cc (working copy)
@@ -159,18 +159,15 @@
// permissions / security descriptors that makes sense in the new directory.
rename_result = MoveFileAndAdjustPermissions(new_path);
- if (rename_result == DOWNLOAD_INTERRUPT_REASON_NONE)
+ if (rename_result == DOWNLOAD_INTERRUPT_REASON_NONE) {
full_path_ = new_path;
+ // Re-open the file if we were still using it.
+ if (was_in_progress)
+ rename_result = Open();
+ }
- // Re-open the file if we were still using it regardless of the interrupt
- // reason.
- DownloadInterruptReason open_result = DOWNLOAD_INTERRUPT_REASON_NONE;
- if (was_in_progress)
- open_result = Open();
-
bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_RENAMED);
- return rename_result == DOWNLOAD_INTERRUPT_REASON_NONE ? open_result
- : rename_result;
+ return rename_result;
}
void BaseFile::Detach() {
@@ -329,10 +326,11 @@
const char* operation,
logging::SystemErrorCode os_error) {
// There's no direct conversion from a system error to an interrupt reason.
- base::File::Error file_error = base::File::OSErrorToFileError(os_error);
+ net::Error net_error = net::MapSystemError(os_error);
return LogInterruptReason(
operation, os_error,
- ConvertFileErrorToInterruptReason(file_error));
+ ConvertNetErrorToInterruptReason(
+ net_error, DOWNLOAD_INTERRUPT_FROM_DISK));
}
DownloadInterruptReason BaseFile::LogInterruptReason(
« no previous file with comments | « trunk/src/content/browser/download/base_file.h ('k') | trunk/src/content/browser/download/base_file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698