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

Unified Diff: base/files/file_win.cc

Issue 172673002: Base: Don't check for thread restrictions when closing a file doesn't do IO. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « base/files/file_posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_win.cc
diff --git a/base/files/file_win.cc b/base/files/file_win.cc
index 80f46136c7acacc0ccca1a0763b363d18107097d..3581fca723077d7bc72822c937da5e3d647d7ebd 100644
--- a/base/files/file_win.cc
+++ b/base/files/file_win.cc
@@ -104,8 +104,10 @@ PlatformFile File::TakePlatformFile() {
}
void File::Close() {
- base::ThreadRestrictions::AssertIOAllowed();
- file_.Close();
+ if (file_.IsValid()) {
+ base::ThreadRestrictions::AssertIOAllowed();
+ file_.Close();
+ }
}
int64 File::Seek(Whence whence, int64 offset) {
« no previous file with comments | « base/files/file_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698