Commit 77a595ec authored by rvargas@chromium.org's avatar rvargas@chromium.org

Remove PlatformFile from dbus/file_descriptor

BUG=322664

Review URL: https://codereview.chromium.org/307423005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275563 0039d316-1c4b-4281-b951-d872f2087c98
parent e05aea42
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "base/files/file.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/platform_file.h"
#include "dbus/file_descriptor.h" #include "dbus/file_descriptor.h"
namespace dbus { namespace dbus {
FileDescriptor::~FileDescriptor() { FileDescriptor::~FileDescriptor() {
if (owner_) if (owner_)
base::ClosePlatformFile(value_); base::File auto_closer(value_);
} }
int FileDescriptor::value() const { int FileDescriptor::value() const {
...@@ -25,8 +25,10 @@ int FileDescriptor::TakeValue() { ...@@ -25,8 +25,10 @@ int FileDescriptor::TakeValue() {
} }
void FileDescriptor::CheckValidity() { void FileDescriptor::CheckValidity() {
base::PlatformFileInfo info; base::File file(value_);
bool ok = base::GetPlatformFileInfo(value_, &info); base::File::Info info;
bool ok = file.GetInfo(&info);
file.TakePlatformFile(); // Prevent |value_| from being closed by |file|.
valid_ = (ok && !info.is_directory); valid_ = (ok && !info.is_directory);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment