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

Unified Diff: base/file_util.h

Issue 2804042: Incomplete changes to make scoped_ptr_malloc use plain functions. (Closed)
Patch Set: chrome now builds & links Created 10 years, 5 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 | « base/crypto/scoped_nss_types.h ('k') | base/process_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « base/crypto/scoped_nss_types.h ('k') | base/process_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698