From b5088d08be50175ac759d868de91da16a634a323 Mon Sep 17 00:00:00 2001 From: "mkwst@chromium.org" Date: Thu, 2 Feb 2012 08:36:19 +0000 Subject: Revert 120174 - 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 TBR=satorux@chromium.org Review URL: https://chromiumcodereview.appspot.com/9309051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120181 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/file_stream_posix.cc | 5 +++-- net/base/file_stream_win.cc | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'net') diff --git a/net/base/file_stream_posix.cc b/net/base/file_stream_posix.cc index d7608ac..50b1593 100644 --- a/net/base/file_stream_posix.cc +++ b/net/base/file_stream_posix.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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,8 +303,9 @@ void FileStream::Close() { async_context_.reset(); if (file_ != base::kInvalidPlatformFileValue) { - if (!base::ClosePlatformFile(file_)) + if (close(file_) != 0) { NOTREACHED(); + } file_ = base::kInvalidPlatformFileValue; } } diff --git a/net/base/file_stream_win.cc b/net/base/file_stream_win.cc index 2c57f43b..07d365f 100644 --- a/net/base/file_stream_win.cc +++ b/net/base/file_stream_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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,8 +154,7 @@ void FileStream::Close() { async_context_.reset(); if (file_ != INVALID_HANDLE_VALUE) { - if (!base::ClosePlatformFile(file_)) - NOTREACHED(); + CloseHandle(file_); file_ = INVALID_HANDLE_VALUE; } } -- cgit v1.1