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

Side by Side Diff: base/files/scoped_file.h

Issue 191673003: Implement ScopedFD in terms of ScopedGeneric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_FILES_SCOPED_FILE_H_
6 #define BASE_FILES_SCOPED_FILE_H_
7
8 #include <stdio.h>
9
10 #include "base/base_export.h"
11 #include "base/logging.h"
12 #include "base/scoped_generic.h"
13 #include "build/build_config.h"
14
15 namespace base {
16
17 namespace internal {
18
19 #if defined(OS_POSIX)
20 struct BASE_EXPORT ScopedFDCloseTraits {
21 static int InvalidValue() {
22 return -1;
23 }
24 static void Free(int fd);
25 };
26 #endif
27
28 } // namespace internal
29
30 #if defined(OS_POSIX)
31 // Scoped file descriptor.
32 typedef ScopedGeneric<int, internal::ScopedFDCloseTraits> ScopedFD;
33 #endif
34
35 } // namespace base
36
37 #endif // BASE_FILES_SCOPED_FILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698