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

Side by Side Diff: mojo/edk/util/scoped_file.h

Issue 1347783002: Add our own (mojo::util::)ScopedFILE and replace uses of base::ScopedFILE with it. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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
« mojo/edk/system/BUILD.gn ('K') | « mojo/edk/util/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 MOJO_EDK_UTIL_SCOPED_FILE_H_
6 #define MOJO_EDK_UTIL_SCOPED_FILE_H_
7
8 #include <stdio.h>
9
10 #include "base/memory/scoped_ptr.h"
11
12 namespace mojo {
13 namespace util {
14 namespace internal {
15
16 // Functor for |ScopedFILE| (below).
17 struct ScopedFILECloser {
18 inline void operator()(FILE* x) const {
19 if (x)
20 fclose(x);
21 }
22 };
23
24 } // namespace internal
25
26 // Automatically closes |FILE*|s.
27 using ScopedFILE = scoped_ptr<FILE, internal::ScopedFILECloser>;
28
29 } // namespace util
30 } // namespace mojo
31
32 #endif // MOJO_EDK_UTIL_SCOPED_FILE_H_
OLDNEW
« mojo/edk/system/BUILD.gn ('K') | « mojo/edk/util/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698