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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 | 101 |
102 //! \brief Sets MINIDUMP_THREAD::Priority. | 102 //! \brief Sets MINIDUMP_THREAD::Priority. |
103 void SetPriority(uint32_t priority) { thread_.Priority = priority; } | 103 void SetPriority(uint32_t priority) { thread_.Priority = priority; } |
104 | 104 |
105 //! \brief Sets MINIDUMP_THREAD::Teb. | 105 //! \brief Sets MINIDUMP_THREAD::Teb. |
106 void SetTEB(uint64_t teb) { thread_.Teb = teb; } | 106 void SetTEB(uint64_t teb) { thread_.Teb = teb; } |
107 | 107 |
108 protected: | 108 protected: |
109 // MinidumpWritable: | 109 // MinidumpWritable: |
110 virtual bool Freeze() override; | 110 bool Freeze() override; |
111 virtual size_t SizeOfObject() override; | 111 size_t SizeOfObject() override; |
112 virtual std::vector<MinidumpWritable*> Children() override; | 112 std::vector<MinidumpWritable*> Children() override; |
113 virtual bool WriteObject(FileWriterInterface* file_writer) override; | 113 bool WriteObject(FileWriterInterface* file_writer) override; |
114 | 114 |
115 private: | 115 private: |
116 MINIDUMP_THREAD thread_; | 116 MINIDUMP_THREAD thread_; |
117 MinidumpMemoryWriter* stack_; // weak | 117 MinidumpMemoryWriter* stack_; // weak |
118 MinidumpContextWriter* context_; // weak | 118 MinidumpContextWriter* context_; // weak |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(MinidumpThreadWriter); | 120 DISALLOW_COPY_AND_ASSIGN(MinidumpThreadWriter); |
121 }; | 121 }; |
122 | 122 |
123 //! \brief The writer for a MINIDUMP_THREAD_LIST stream in a minidump file, | 123 //! \brief The writer for a MINIDUMP_THREAD_LIST stream in a minidump file, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 //! \brief Adds a MinidumpThreadWriter to the MINIDUMP_THREAD_LIST. | 157 //! \brief Adds a MinidumpThreadWriter to the MINIDUMP_THREAD_LIST. |
158 //! | 158 //! |
159 //! \a thread will become a child of this object in the overall tree of | 159 //! \a thread will become a child of this object in the overall tree of |
160 //! internal::MinidumpWritable objects. | 160 //! internal::MinidumpWritable objects. |
161 //! | 161 //! |
162 //! \note Valid in #kStateMutable. | 162 //! \note Valid in #kStateMutable. |
163 void AddThread(MinidumpThreadWriter* thread); | 163 void AddThread(MinidumpThreadWriter* thread); |
164 | 164 |
165 protected: | 165 protected: |
166 // MinidumpWritable: | 166 // MinidumpWritable: |
167 virtual bool Freeze() override; | 167 bool Freeze() override; |
168 virtual size_t SizeOfObject() override; | 168 size_t SizeOfObject() override; |
169 virtual std::vector<MinidumpWritable*> Children() override; | 169 std::vector<MinidumpWritable*> Children() override; |
170 virtual bool WriteObject(FileWriterInterface* file_writer) override; | 170 bool WriteObject(FileWriterInterface* file_writer) override; |
171 | 171 |
172 // MinidumpStreamWriter: | 172 // MinidumpStreamWriter: |
173 virtual MinidumpStreamType StreamType() const override; | 173 MinidumpStreamType StreamType() const override; |
174 | 174 |
175 private: | 175 private: |
176 MINIDUMP_THREAD_LIST thread_list_base_; | 176 MINIDUMP_THREAD_LIST thread_list_base_; |
177 std::vector<MinidumpThreadWriter*> threads_; // weak | 177 std::vector<MinidumpThreadWriter*> threads_; // weak |
178 MinidumpMemoryListWriter* memory_list_writer_; // weak | 178 MinidumpMemoryListWriter* memory_list_writer_; // weak |
179 | 179 |
180 DISALLOW_COPY_AND_ASSIGN(MinidumpThreadListWriter); | 180 DISALLOW_COPY_AND_ASSIGN(MinidumpThreadListWriter); |
181 }; | 181 }; |
182 | 182 |
183 } // namespace crashpad | 183 } // namespace crashpad |
184 | 184 |
185 #endif // CRASHPAD_MINIDUMP_MINIDUMP_THREAD_WRITER_H_ | 185 #endif // CRASHPAD_MINIDUMP_MINIDUMP_THREAD_WRITER_H_ |
OLD | NEW |