| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 const size_t kMaximumAlignment = 16; | 27 const size_t kMaximumAlignment = 16; |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 namespace crashpad { | 31 namespace crashpad { |
| 32 namespace internal { | 32 namespace internal { |
| 33 | 33 |
| 34 MinidumpWritable::~MinidumpWritable() { |
| 35 } |
| 36 |
| 34 bool MinidumpWritable::WriteEverything(FileWriterInterface* file_writer) { | 37 bool MinidumpWritable::WriteEverything(FileWriterInterface* file_writer) { |
| 35 DCHECK_EQ(state_, kStateMutable); | 38 DCHECK_EQ(state_, kStateMutable); |
| 36 | 39 |
| 37 if (!Freeze()) { | 40 if (!Freeze()) { |
| 38 return false; | 41 return false; |
| 39 } | 42 } |
| 40 | 43 |
| 41 DCHECK_EQ(state_, kStateFrozen); | 44 DCHECK_EQ(state_, kStateFrozen); |
| 42 | 45 |
| 43 off_t offset = 0; | 46 off_t offset = 0; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 const size_t MinidumpWritable::kInvalidSize = | 85 const size_t MinidumpWritable::kInvalidSize = |
| 83 std::numeric_limits<size_t>::max(); | 86 std::numeric_limits<size_t>::max(); |
| 84 | 87 |
| 85 MinidumpWritable::MinidumpWritable() | 88 MinidumpWritable::MinidumpWritable() |
| 86 : registered_rvas_(), | 89 : registered_rvas_(), |
| 87 registered_location_descriptors_(), | 90 registered_location_descriptors_(), |
| 88 leading_pad_bytes_(0), | 91 leading_pad_bytes_(0), |
| 89 state_(kStateMutable) { | 92 state_(kStateMutable) { |
| 90 } | 93 } |
| 91 | 94 |
| 92 MinidumpWritable::~MinidumpWritable() { | |
| 93 } | |
| 94 | |
| 95 bool MinidumpWritable::Freeze() { | 95 bool MinidumpWritable::Freeze() { |
| 96 DCHECK_EQ(state_, kStateMutable); | 96 DCHECK_EQ(state_, kStateMutable); |
| 97 state_ = kStateFrozen; | 97 state_ = kStateFrozen; |
| 98 | 98 |
| 99 std::vector<MinidumpWritable*> children = Children(); | 99 std::vector<MinidumpWritable*> children = Children(); |
| 100 for (MinidumpWritable* child : children) { | 100 for (MinidumpWritable* child : children) { |
| 101 if (!child->Freeze()) { | 101 if (!child->Freeze()) { |
| 102 return false; | 102 return false; |
| 103 } | 103 } |
| 104 } | 104 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 if (!WriteObject(file_writer)) { | 260 if (!WriteObject(file_writer)) { |
| 261 return false; | 261 return false; |
| 262 } | 262 } |
| 263 | 263 |
| 264 state_ = kStateWritten; | 264 state_ = kStateWritten; |
| 265 return true; | 265 return true; |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace internal | 268 } // namespace internal |
| 269 } // namespace crashpad | 269 } // namespace crashpad |
| OLD | NEW |