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

Unified Diff: dbus/file_descriptor.cc

Issue 307423005: Remove PlatformFile from dbus/file_descriptor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/file_descriptor.cc
diff --git a/dbus/file_descriptor.cc b/dbus/file_descriptor.cc
index 91b089f657cf271e5240e05e24be4f1eca9b6452..d2d6a31f1e3cdc091a2497d04aa6da62c79f3633 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(); // Prevent |value_| from being closed by |file|.
valid_ = (ok && !info.is_directory);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698