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

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

Issue 2687713003: Stop base::OpenFile from leaking fds/handles into child procs. (Closed)
Patch Set: macOS fix Created 3 years, 10 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 | « no previous file | base/files/file_util_posix.cc » ('j') | base/files/file_util_posix.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file contains utility functions for dealing with the local 5 // This file contains utility functions for dealing with the local
6 // filesystem. 6 // filesystem.
7 7
8 #ifndef BASE_FILES_FILE_UTIL_H_ 8 #ifndef BASE_FILES_FILE_UTIL_H_
9 #define BASE_FILES_FILE_UTIL_H_ 9 #define BASE_FILES_FILE_UTIL_H_
10 10
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 BASE_EXPORT bool IsLink(const FilePath& file_path); 300 BASE_EXPORT bool IsLink(const FilePath& file_path);
301 301
302 // Returns information about the given file path. 302 // Returns information about the given file path.
303 BASE_EXPORT bool GetFileInfo(const FilePath& file_path, File::Info* info); 303 BASE_EXPORT bool GetFileInfo(const FilePath& file_path, File::Info* info);
304 304
305 // Sets the time of the last access and the time of the last modification. 305 // Sets the time of the last access and the time of the last modification.
306 BASE_EXPORT bool TouchFile(const FilePath& path, 306 BASE_EXPORT bool TouchFile(const FilePath& path,
307 const Time& last_accessed, 307 const Time& last_accessed,
308 const Time& last_modified); 308 const Time& last_modified);
309 309
310 // Wrapper for fopen-like calls. Returns non-NULL FILE* on success. 310 // Wrapper for fopen-like calls. Returns non-NULL FILE* on success. The
311 // underlying file descriptor (POSIX) or handle (Windows) is unconditionally
312 // configured to not be propagated to child processes.
gab 2017/02/09 15:18:08 s/propagated to/inherited by/ (since this is what
grt (UTC plus 2) 2017/02/09 15:57:01 I avoided "inherited" since it's Windows-specific.
gab 2017/02/09 17:01:24 Ah ok, sounds fine to me then.
311 BASE_EXPORT FILE* OpenFile(const FilePath& filename, const char* mode); 313 BASE_EXPORT FILE* OpenFile(const FilePath& filename, const char* mode);
312 314
313 // Closes file opened by OpenFile. Returns true on success. 315 // Closes file opened by OpenFile. Returns true on success.
314 BASE_EXPORT bool CloseFile(FILE* file); 316 BASE_EXPORT bool CloseFile(FILE* file);
315 317
316 // Associates a standard FILE stream with an existing File. Note that this 318 // Associates a standard FILE stream with an existing File. Note that this
317 // functions take ownership of the existing File. 319 // functions take ownership of the existing File.
318 BASE_EXPORT FILE* FileToFILE(File file, const char* mode); 320 BASE_EXPORT FILE* FileToFILE(File file, const char* mode);
319 321
320 // Truncates an open file to end at the location of the current file pointer. 322 // Truncates an open file to end at the location of the current file pointer.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // This function simulates Move(), but unlike Move() it works across volumes. 450 // This function simulates Move(), but unlike Move() it works across volumes.
449 // This function is not transactional. 451 // This function is not transactional.
450 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path, 452 BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path,
451 const FilePath& to_path); 453 const FilePath& to_path);
452 #endif // defined(OS_WIN) 454 #endif // defined(OS_WIN)
453 455
454 } // namespace internal 456 } // namespace internal
455 } // namespace base 457 } // namespace base
456 458
457 #endif // BASE_FILES_FILE_UTIL_H_ 459 #endif // BASE_FILES_FILE_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/files/file_util_posix.cc » ('j') | base/files/file_util_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698