Index: base/file_util.h |
diff --git a/base/file_util.h b/base/file_util.h |
index d52bba91588ef36a719f28ff72912c310cf55677..b2a07286b31bf3fdc9f96418e1ff1b7e438e095c 100644 |
--- a/base/file_util.h |
+++ b/base/file_util.h |
@@ -365,29 +365,20 @@ bool GetCurrentDirectory(FilePath* path); |
// Sets the current working directory for the process. |
bool SetCurrentDirectory(const FilePath& path); |
-// A class to handle auto-closing of FILE*'s. |
-class ScopedFILEClose { |
- public: |
- inline void operator()(FILE* x) const { |
- if (x) { |
- fclose(x); |
- } |
- } |
-}; |
+inline void ScopedFILEClose(FILE* f) { |
+ fclose(f); |
+} |
typedef scoped_ptr_malloc<FILE, ScopedFILEClose> ScopedFILE; |
#if defined(OS_POSIX) |
// A class to handle auto-closing of FDs. |
-class ScopedFDClose { |
- public: |
- inline void operator()(int* x) const { |
- if (x && *x >= 0) { |
- if (HANDLE_EINTR(close(*x)) < 0) |
- PLOG(ERROR) << "close"; |
- } |
+inline void ScopedFDClose(int* x) { |
+ if (x && *x >= 0) { |
+ if (HANDLE_EINTR(close(*x)) < 0) |
+ PLOG(ERROR) << "close"; |
} |
-}; |
+} |
typedef scoped_ptr_malloc<int, ScopedFDClose> ScopedFD; |
#endif // OS_POSIX |