summaryrefslogtreecommitdiffstats
path: root/base/files/scoped_platform_file_closer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/files/scoped_platform_file_closer.cc')
-rw-r--r--base/files/scoped_platform_file_closer.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/base/files/scoped_platform_file_closer.cc b/base/files/scoped_platform_file_closer.cc
new file mode 100644
index 0000000..44f6752
--- /dev/null
+++ b/base/files/scoped_platform_file_closer.cc
@@ -0,0 +1,16 @@
+// Copyright 2013 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.
+
+#include "base/files/scoped_platform_file_closer.h"
+
+namespace base {
+namespace internal {
+
+void PlatformFileCloser::operator()(PlatformFile* file) const {
+ if (file && *file != kInvalidPlatformFileValue)
+ ClosePlatformFile(*file);
+}
+
+} // namespace internal
+} // namespace base