diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-02 07:24:57 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-02 07:24:57 +0000 |
commit | c731a92280db3256ca22c1f15c17c84623dbbd23 (patch) | |
tree | 08b613b53242a455c5bfc501a979e1256a6cd527 /net | |
parent | db31ae92531c32138b154be206edfb95e56cdbc4 (diff) | |
download | chromium_src-c731a92280db3256ca22c1f15c17c84623dbbd23.zip chromium_src-c731a92280db3256ca22c1f15c17c84623dbbd23.tar.gz chromium_src-c731a92280db3256ca22c1f15c17c84623dbbd23.tar.bz2 |
net: Use ClosePlatformFile() instead of close/CloseHandle().
ClosePlatformFile() is guarded with ThreadRestrictions::AssertIOAllowed()
that will catch bad pieces of code performing file IO on wrong threads.
BUG=72001
TEST=try bots
Review URL: http://codereview.chromium.org/9307040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120174 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/file_stream_posix.cc | 5 | ||||
-rw-r--r-- | net/base/file_stream_win.cc | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/net/base/file_stream_posix.cc b/net/base/file_stream_posix.cc index 50b1593..d7608ac 100644 --- a/net/base/file_stream_posix.cc +++ b/net/base/file_stream_posix.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -303,9 +303,8 @@ void FileStream::Close() { async_context_.reset(); if (file_ != base::kInvalidPlatformFileValue) { - if (close(file_) != 0) { + if (!base::ClosePlatformFile(file_)) NOTREACHED(); - } file_ = base::kInvalidPlatformFileValue; } } diff --git a/net/base/file_stream_win.cc b/net/base/file_stream_win.cc index 07d365f..2c57f43b 100644 --- a/net/base/file_stream_win.cc +++ b/net/base/file_stream_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -154,7 +154,8 @@ void FileStream::Close() { async_context_.reset(); if (file_ != INVALID_HANDLE_VALUE) { - CloseHandle(file_); + if (!base::ClosePlatformFile(file_)) + NOTREACHED(); file_ = INVALID_HANDLE_VALUE; } } |