Chromium Code Reviews| Index: dbus/file_descriptor.cc |
| diff --git a/dbus/file_descriptor.cc b/dbus/file_descriptor.cc |
| index 91b089f657cf271e5240e05e24be4f1eca9b6452..95e441a19cd39b8dd3bcb3b8cef6bb16794d49e5 100644 |
| --- a/dbus/file_descriptor.cc |
| +++ b/dbus/file_descriptor.cc |
| @@ -2,15 +2,15 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "base/files/file.h" |
| #include "base/logging.h" |
| -#include "base/platform_file.h" |
| #include "dbus/file_descriptor.h" |
| namespace dbus { |
| FileDescriptor::~FileDescriptor() { |
| if (owner_) |
| - base::ClosePlatformFile(value_); |
| + base::File auto_closer(value_); |
| } |
| int FileDescriptor::value() const { |
| @@ -25,8 +25,10 @@ int FileDescriptor::TakeValue() { |
| } |
| void FileDescriptor::CheckValidity() { |
| - base::PlatformFileInfo info; |
| - bool ok = base::GetPlatformFileInfo(value_, &info); |
| + base::File file(value_); |
| + base::File::Info info; |
| + bool ok = file.GetInfo(&info); |
| + file.TakePlatformFile(); |
|
satorux1
2014/06/06 02:06:06
why do you need to call this? I thought file(value
rvargas (doing something else)
2014/06/06 02:22:43
Yes, it does. Which means that ~File() will close
satorux1
2014/06/06 02:31:41
Ah I see. I got confused because of the function n
rvargas (doing something else)
2014/06/06 19:03:58
Done.
|
| valid_ = (ok && !info.is_directory); |
| } |