| 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, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 #include "minidump/minidump_thread_writer.h" | 15 #include "minidump/minidump_thread_writer.h" |
| 16 | 16 |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "minidump/minidump_context_writer.h" | 18 #include "minidump/minidump_context_writer.h" |
| 19 #include "minidump/minidump_memory_writer.h" | 19 #include "minidump/minidump_memory_writer.h" |
| 20 #include "util/numeric/safe_assignment.h" | 20 #include "util/numeric/safe_assignment.h" |
| 21 | 21 |
| 22 namespace crashpad { | 22 namespace crashpad { |
| 23 | 23 |
| 24 MinidumpThreadWriter::MinidumpThreadWriter() | 24 MinidumpThreadWriter::MinidumpThreadWriter() |
| 25 : MinidumpWritable(), thread_(), stack_(NULL), context_(NULL) { | 25 : MinidumpWritable(), thread_(), stack_(nullptr), context_(nullptr) { |
| 26 } | 26 } |
| 27 | 27 |
| 28 const MINIDUMP_THREAD* MinidumpThreadWriter::MinidumpThread() const { | 28 const MINIDUMP_THREAD* MinidumpThreadWriter::MinidumpThread() const { |
| 29 DCHECK_EQ(state(), kStateWritable); | 29 DCHECK_EQ(state(), kStateWritable); |
| 30 | 30 |
| 31 return &thread_; | 31 return &thread_; |
| 32 } | 32 } |
| 33 | 33 |
| 34 void MinidumpThreadWriter::SetStack(MinidumpMemoryWriter* stack) { | 34 void MinidumpThreadWriter::SetStack(MinidumpMemoryWriter* stack) { |
| 35 DCHECK_EQ(state(), kStateMutable); | 35 DCHECK_EQ(state(), kStateMutable); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // This object doesn’t directly write anything itself. Its MINIDUMP_THREAD is | 88 // This object doesn’t directly write anything itself. Its MINIDUMP_THREAD is |
| 89 // written by its parent as part of a MINIDUMP_THREAD_LIST, and its children | 89 // written by its parent as part of a MINIDUMP_THREAD_LIST, and its children |
| 90 // are responsible for writing themselves. | 90 // are responsible for writing themselves. |
| 91 return true; | 91 return true; |
| 92 } | 92 } |
| 93 | 93 |
| 94 MinidumpThreadListWriter::MinidumpThreadListWriter() | 94 MinidumpThreadListWriter::MinidumpThreadListWriter() |
| 95 : MinidumpStreamWriter(), | 95 : MinidumpStreamWriter(), |
| 96 thread_list_base_(), | 96 thread_list_base_(), |
| 97 threads_(), | 97 threads_(), |
| 98 memory_list_writer_(NULL) { | 98 memory_list_writer_(nullptr) { |
| 99 } | 99 } |
| 100 | 100 |
| 101 MinidumpThreadListWriter::~MinidumpThreadListWriter() { | 101 MinidumpThreadListWriter::~MinidumpThreadListWriter() { |
| 102 } | 102 } |
| 103 | 103 |
| 104 void MinidumpThreadListWriter::SetMemoryListWriter( | 104 void MinidumpThreadListWriter::SetMemoryListWriter( |
| 105 MinidumpMemoryListWriter* memory_list_writer) { | 105 MinidumpMemoryListWriter* memory_list_writer) { |
| 106 DCHECK_EQ(state(), kStateMutable); | 106 DCHECK_EQ(state(), kStateMutable); |
| 107 DCHECK(threads_.empty()); | 107 DCHECK(threads_.empty()); |
| 108 | 108 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 | 171 |
| 172 return file_writer->WriteIoVec(&iovecs); | 172 return file_writer->WriteIoVec(&iovecs); |
| 173 } | 173 } |
| 174 | 174 |
| 175 MinidumpStreamType MinidumpThreadListWriter::StreamType() const { | 175 MinidumpStreamType MinidumpThreadListWriter::StreamType() const { |
| 176 return kMinidumpStreamTypeThreadList; | 176 return kMinidumpStreamTypeThreadList; |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace crashpad | 179 } // namespace crashpad |
| OLD | NEW |