| 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 25 matching lines...) Expand all Loading... |
| 36 namespace crashpad { | 36 namespace crashpad { |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 FileHandle LoggingOpenFileForOutput(DWORD access, | 40 FileHandle LoggingOpenFileForOutput(DWORD access, |
| 41 const base::FilePath& path, | 41 const base::FilePath& path, |
| 42 FileWriteMode mode, | 42 FileWriteMode mode, |
| 43 FilePermissions permissions) { | 43 FilePermissions permissions) { |
| 44 DWORD disposition = 0; | 44 DWORD disposition = 0; |
| 45 switch (mode) { | 45 switch (mode) { |
| 46 case FileWriteMode::kReuseOrFail: |
| 47 disposition = OPEN_EXISTING; |
| 48 break; |
| 46 case FileWriteMode::kReuseOrCreate: | 49 case FileWriteMode::kReuseOrCreate: |
| 47 disposition = OPEN_ALWAYS; | 50 disposition = OPEN_ALWAYS; |
| 48 break; | 51 break; |
| 49 case FileWriteMode::kTruncateOrCreate: | 52 case FileWriteMode::kTruncateOrCreate: |
| 50 disposition = CREATE_ALWAYS; | 53 disposition = CREATE_ALWAYS; |
| 51 break; | 54 break; |
| 52 case FileWriteMode::kCreateOrFail: | 55 case FileWriteMode::kCreateOrFail: |
| 53 disposition = CREATE_NEW; | 56 disposition = CREATE_NEW; |
| 54 break; | 57 break; |
| 55 } | 58 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 return true; | 206 return true; |
| 204 } | 207 } |
| 205 | 208 |
| 206 bool LoggingCloseFile(FileHandle file) { | 209 bool LoggingCloseFile(FileHandle file) { |
| 207 BOOL rv = CloseHandle(file); | 210 BOOL rv = CloseHandle(file); |
| 208 PLOG_IF(ERROR, !rv) << "CloseHandle"; | 211 PLOG_IF(ERROR, !rv) << "CloseHandle"; |
| 209 return rv; | 212 return rv; |
| 210 } | 213 } |
| 211 | 214 |
| 212 } // namespace crashpad | 215 } // namespace crashpad |
| OLD | NEW |