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

Side by Side Diff: util/file/file_io.h

Issue 1390023002: Add FileWriteMode::kCreateOrFail (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Test that kReuseOrCreate can create Created 5 years, 2 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 | « test/test.gyp ('k') | util/file/file_io_posix.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 Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 using FileHandle = HANDLE; 72 using FileHandle = HANDLE;
73 using FileOffset = LONGLONG; 73 using FileOffset = LONGLONG;
74 using ScopedFileHandle = ScopedFileHANDLE; 74 using ScopedFileHandle = ScopedFileHANDLE;
75 75
76 const FileHandle kInvalidFileHandle = INVALID_HANDLE_VALUE; 76 const FileHandle kInvalidFileHandle = INVALID_HANDLE_VALUE;
77 77
78 #endif 78 #endif
79 79
80 //! \brief Determines the mode that LoggingOpenFileForWrite() uses. 80 //! \brief Determines the mode that LoggingOpenFileForWrite() uses.
81 enum class FileWriteMode { 81 enum class FileWriteMode {
82 //! \brief Opens the file if it exists, or fails if it does not.
83 kReuseOrFail,
84
82 //! \brief Opens the file if it exists, or creates a new file. 85 //! \brief Opens the file if it exists, or creates a new file.
83 kReuseOrCreate, 86 kReuseOrCreate,
84 87
85 //! \brief Creates a new file. If the file already exists, it will be 88 //! \brief Creates a new file. If the file already exists, it will be
86 //! overwritten. 89 //! overwritten.
87 kTruncateOrCreate, 90 kTruncateOrCreate,
88 91
89 //! \brief Creates a new file. If the file already exists, the open will fail. 92 //! \brief Creates a new file. If the file already exists, the open will fail.
90 kCreateOrFail, 93 kCreateOrFail,
91 }; 94 };
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 299
297 //! \brief Wraps `close()` or `CloseHandle()`, ensuring that it succeeds. 300 //! \brief Wraps `close()` or `CloseHandle()`, ensuring that it succeeds.
298 //! 301 //!
299 //! If the underlying function fails, this function causes execution to 302 //! If the underlying function fails, this function causes execution to
300 //! terminate without returning. 303 //! terminate without returning.
301 void CheckedCloseFile(FileHandle file); 304 void CheckedCloseFile(FileHandle file);
302 305
303 } // namespace crashpad 306 } // namespace crashpad
304 307
305 #endif // CRASHPAD_UTIL_FILE_FILE_IO_H_ 308 #endif // CRASHPAD_UTIL_FILE_FILE_IO_H_
OLDNEW
« no previous file with comments | « test/test.gyp ('k') | util/file/file_io_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698