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

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

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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
« no previous file with comments | « base/files/memory_mapped_file_unittest.cc ('k') | base/i18n/file_util_icu.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_FILES_SCOPED_FILE_H_ 5 #ifndef BASE_FILES_SCOPED_FILE_H_
6 #define BASE_FILES_SCOPED_FILE_H_ 6 #define BASE_FILES_SCOPED_FILE_H_
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include <memory>
11
10 #include "base/base_export.h" 12 #include "base/base_export.h"
11 #include "base/logging.h" 13 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/scoped_generic.h" 14 #include "base/scoped_generic.h"
14 #include "build/build_config.h" 15 #include "build/build_config.h"
15 16
16 namespace base { 17 namespace base {
17 18
18 namespace internal { 19 namespace internal {
19 20
20 #if defined(OS_POSIX) 21 #if defined(OS_POSIX)
21 struct BASE_EXPORT ScopedFDCloseTraits { 22 struct BASE_EXPORT ScopedFDCloseTraits {
22 static int InvalidValue() { 23 static int InvalidValue() {
(...skipping 24 matching lines...) Expand all
47 // which provides some additional functionality. 48 // which provides some additional functionality.
48 // 49 //
49 // If you're writing cross-platform code that deals with actual files, you 50 // If you're writing cross-platform code that deals with actual files, you
50 // should generally use base::File instead which can be constructed with a 51 // should generally use base::File instead which can be constructed with a
51 // handle, and in addition to handling ownership, has convenient cross-platform 52 // handle, and in addition to handling ownership, has convenient cross-platform
52 // file manipulation functions on it. 53 // file manipulation functions on it.
53 typedef ScopedGeneric<int, internal::ScopedFDCloseTraits> ScopedFD; 54 typedef ScopedGeneric<int, internal::ScopedFDCloseTraits> ScopedFD;
54 #endif 55 #endif
55 56
56 // Automatically closes |FILE*|s. 57 // Automatically closes |FILE*|s.
57 typedef scoped_ptr<FILE, internal::ScopedFILECloser> ScopedFILE; 58 typedef std::unique_ptr<FILE, internal::ScopedFILECloser> ScopedFILE;
58 59
59 } // namespace base 60 } // namespace base
60 61
61 #endif // BASE_FILES_SCOPED_FILE_H_ 62 #endif // BASE_FILES_SCOPED_FILE_H_
OLDNEW
« no previous file with comments | « base/files/memory_mapped_file_unittest.cc ('k') | base/i18n/file_util_icu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698