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

Side by Side Diff: minidump/minidump_file_writer.cc

Issue 1408123006: Tidy up to enable C4800 on Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 1 month 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 | « client/settings.cc ('k') | minidump/minidump_module_writer_test.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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (file_writer->Seek(start_offset, SEEK_SET) != 0) { 166 if (file_writer->Seek(start_offset, SEEK_SET) != 0) {
167 return false; 167 return false;
168 } 168 }
169 169
170 if (!file_writer->Write(&header_, sizeof(header_))) { 170 if (!file_writer->Write(&header_, sizeof(header_))) {
171 return false; 171 return false;
172 } 172 }
173 173
174 // Seek back to the end of the file, in case some non-minidump content will be 174 // Seek back to the end of the file, in case some non-minidump content will be
175 // written to the file after the minidump content. 175 // written to the file after the minidump content.
176 return file_writer->Seek(end_offset, SEEK_SET); 176 return file_writer->Seek(end_offset, SEEK_SET) >= 0;
177 } 177 }
178 178
179 bool MinidumpFileWriter::Freeze() { 179 bool MinidumpFileWriter::Freeze() {
180 DCHECK_EQ(state(), kStateMutable); 180 DCHECK_EQ(state(), kStateMutable);
181 181
182 if (!MinidumpWritable::Freeze()) { 182 if (!MinidumpWritable::Freeze()) {
183 return false; 183 return false;
184 } 184 }
185 185
186 size_t stream_count = streams_.size(); 186 size_t stream_count = streams_.size();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 for (internal::MinidumpStreamWriter* stream : streams_) { 239 for (internal::MinidumpStreamWriter* stream : streams_) {
240 iov.iov_base = stream->DirectoryListEntry(); 240 iov.iov_base = stream->DirectoryListEntry();
241 iov.iov_len = sizeof(MINIDUMP_DIRECTORY); 241 iov.iov_len = sizeof(MINIDUMP_DIRECTORY);
242 iovecs.push_back(iov); 242 iovecs.push_back(iov);
243 } 243 }
244 244
245 return file_writer->WriteIoVec(&iovecs); 245 return file_writer->WriteIoVec(&iovecs);
246 } 246 }
247 247
248 } // namespace crashpad 248 } // namespace crashpad
OLDNEW
« no previous file with comments | « client/settings.cc ('k') | minidump/minidump_module_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698