OLD | NEW |
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 FileHandle LoggingOpenFileForRead(const base::FilePath& path) { | 76 FileHandle LoggingOpenFileForRead(const base::FilePath& path) { |
77 HANDLE file = CreateFile(path.value().c_str(), GENERIC_READ, FILE_SHARE_READ, | 77 HANDLE file = CreateFile(path.value().c_str(), GENERIC_READ, FILE_SHARE_READ, |
78 nullptr, OPEN_EXISTING, 0, nullptr); | 78 nullptr, OPEN_EXISTING, 0, nullptr); |
79 PLOG_IF(ERROR, file == INVALID_HANDLE_VALUE) << "CreateFile " | 79 PLOG_IF(ERROR, file == INVALID_HANDLE_VALUE) << "CreateFile " |
80 << path.value().c_str(); | 80 << path.value().c_str(); |
81 return file; | 81 return file; |
82 } | 82 } |
83 | 83 |
84 FileHandle LoggingOpenFileForWrite(const base::FilePath& path, | 84 FileHandle LoggingOpenFileForWrite(const base::FilePath& path, |
85 FileWriteMode mode, | 85 FileWriteMode mode, |
86 bool world_readable) { | 86 FilePermissions permissions) { |
87 DWORD disposition = 0; | 87 DWORD disposition = 0; |
88 switch (mode) { | 88 switch (mode) { |
89 case FileWriteMode::kReuseOrCreate: | 89 case FileWriteMode::kReuseOrCreate: |
90 disposition = OPEN_ALWAYS; | 90 disposition = OPEN_ALWAYS; |
91 break; | 91 break; |
92 case FileWriteMode::kTruncateOrCreate: | 92 case FileWriteMode::kTruncateOrCreate: |
93 disposition = CREATE_ALWAYS; | 93 disposition = CREATE_ALWAYS; |
94 break; | 94 break; |
95 case FileWriteMode::kCreateOrFail: | 95 case FileWriteMode::kCreateOrFail: |
96 disposition = CREATE_NEW; | 96 disposition = CREATE_NEW; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 return new_offset.QuadPart; | 131 return new_offset.QuadPart; |
132 } | 132 } |
133 | 133 |
134 bool LoggingCloseFile(FileHandle file) { | 134 bool LoggingCloseFile(FileHandle file) { |
135 BOOL rv = CloseHandle(file); | 135 BOOL rv = CloseHandle(file); |
136 PLOG_IF(ERROR, !rv) << "CloseHandle"; | 136 PLOG_IF(ERROR, !rv) << "CloseHandle"; |
137 return rv; | 137 return rv; |
138 } | 138 } |
139 | 139 |
140 } // namespace crashpad | 140 } // namespace crashpad |
OLD | NEW |