| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 DCHECK_EQ(streams_.size(), stream_types_.size()); | 187 DCHECK_EQ(streams_.size(), stream_types_.size()); |
| 188 | 188 |
| 189 std::vector<MinidumpWritable*> children; | 189 std::vector<MinidumpWritable*> children; |
| 190 for (internal::MinidumpStreamWriter* stream : streams_) { | 190 for (internal::MinidumpStreamWriter* stream : streams_) { |
| 191 children.push_back(stream); | 191 children.push_back(stream); |
| 192 } | 192 } |
| 193 | 193 |
| 194 return children; | 194 return children; |
| 195 } | 195 } |
| 196 | 196 |
| 197 bool MinidumpFileWriter::WillWriteAtOffsetImpl(off_t offset) { | 197 bool MinidumpFileWriter::WillWriteAtOffsetImpl(FileOffset offset) { |
| 198 DCHECK_EQ(state(), kStateFrozen); | 198 DCHECK_EQ(state(), kStateFrozen); |
| 199 DCHECK_EQ(offset, 0); | 199 DCHECK_EQ(offset, 0); |
| 200 DCHECK_EQ(streams_.size(), stream_types_.size()); | 200 DCHECK_EQ(streams_.size(), stream_types_.size()); |
| 201 | 201 |
| 202 auto directory_offset = streams_.empty() ? 0 : offset + sizeof(header_); | 202 auto directory_offset = streams_.empty() ? 0 : offset + sizeof(header_); |
| 203 if (!AssignIfInRange(&header_.StreamDirectoryRva, directory_offset)) { | 203 if (!AssignIfInRange(&header_.StreamDirectoryRva, directory_offset)) { |
| 204 LOG(ERROR) << "offset " << directory_offset << " out of range"; | 204 LOG(ERROR) << "offset " << directory_offset << " out of range"; |
| 205 return false; | 205 return false; |
| 206 } | 206 } |
| 207 | 207 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 220 for (internal::MinidumpStreamWriter* stream : streams_) { | 220 for (internal::MinidumpStreamWriter* stream : streams_) { |
| 221 iov.iov_base = stream->DirectoryListEntry(); | 221 iov.iov_base = stream->DirectoryListEntry(); |
| 222 iov.iov_len = sizeof(MINIDUMP_DIRECTORY); | 222 iov.iov_len = sizeof(MINIDUMP_DIRECTORY); |
| 223 iovecs.push_back(iov); | 223 iovecs.push_back(iov); |
| 224 } | 224 } |
| 225 | 225 |
| 226 return file_writer->WriteIoVec(&iovecs); | 226 return file_writer->WriteIoVec(&iovecs); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace crashpad | 229 } // namespace crashpad |
| OLD | NEW |