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

Unified Diff: net/base/file_stream_win.cc

Issue 3127008: Preliminary work on resuming downloads whose connections have expired.
Patch Set: Waiting to send download automation error message until after other downloads are canceled. Created 10 years, 3 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: net/base/file_stream_win.cc
diff --git a/net/base/file_stream_win.cc b/net/base/file_stream_win.cc
index 234ddf93f6f4a659d4fe9c194a82a6589752fac1..62461ed51da316b8dffd68af39503a34e78eb69d 100644
--- a/net/base/file_stream_win.cc
+++ b/net/base/file_stream_win.cc
@@ -10,6 +10,7 @@
#include "base/histogram.h"
#include "base/logging.h"
#include "base/message_loop.h"
+#include "base/win_util.h"
#include "net/base/net_errors.h"
namespace net {
@@ -147,7 +148,13 @@ void FileStream::Close() {
async_context_.reset();
if (file_ != INVALID_HANDLE_VALUE) {
- CloseHandle(file_);
+ if (!CloseHandle(file_)) {
+ DLOG(WARNING) << " Unable to close file with handle = "
+ << file_ << ", due to error "
+ << GetLastError() << " ("
+ << win_util::FormatMessage(GetLastError())
+ << ")";
+ }
file_ = INVALID_HANDLE_VALUE;
}
}

Powered by Google App Engine
This is Rietveld 408576698