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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 }; | 153 }; |
154 | 154 |
155 struct MinidumpThreadListTraits { | 155 struct MinidumpThreadListTraits { |
156 typedef MINIDUMP_THREAD_LIST ListType; | 156 typedef MINIDUMP_THREAD_LIST ListType; |
157 static constexpr size_t kElementSize = sizeof(MINIDUMP_THREAD); | 157 static constexpr size_t kElementSize = sizeof(MINIDUMP_THREAD); |
158 static size_t ElementCount(const ListType* list) { | 158 static size_t ElementCount(const ListType* list) { |
159 return list->NumberOfThreads; | 159 return list->NumberOfThreads; |
160 } | 160 } |
161 }; | 161 }; |
162 | 162 |
| 163 struct MinidumpModuleCrashpadInfoListTraits { |
| 164 typedef MinidumpModuleCrashpadInfoList ListType; |
| 165 static constexpr size_t kElementSize = sizeof(MINIDUMP_LOCATION_DESCRIPTOR); |
| 166 static size_t ElementCount(const ListType* list) { |
| 167 return list->count; |
| 168 } |
| 169 }; |
| 170 |
163 struct MinidumpSimpleStringDictionaryListTraits { | 171 struct MinidumpSimpleStringDictionaryListTraits { |
164 typedef MinidumpSimpleStringDictionary ListType; | 172 typedef MinidumpSimpleStringDictionary ListType; |
165 static constexpr size_t kElementSize = | 173 static constexpr size_t kElementSize = |
166 sizeof(MinidumpSimpleStringDictionaryEntry); | 174 sizeof(MinidumpSimpleStringDictionaryEntry); |
167 static size_t ElementCount(const ListType* list) { | 175 static size_t ElementCount(const ListType* list) { |
168 return list->count; | 176 return list->count; |
169 } | 177 } |
170 }; | 178 }; |
171 | 179 |
172 template <typename T> | 180 template <typename T> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 218 |
211 template <> | 219 template <> |
212 const MINIDUMP_THREAD_LIST* MinidumpWritableAtLocationDescriptor< | 220 const MINIDUMP_THREAD_LIST* MinidumpWritableAtLocationDescriptor< |
213 MINIDUMP_THREAD_LIST>(const std::string& file_contents, | 221 MINIDUMP_THREAD_LIST>(const std::string& file_contents, |
214 const MINIDUMP_LOCATION_DESCRIPTOR& location) { | 222 const MINIDUMP_LOCATION_DESCRIPTOR& location) { |
215 return MinidumpListAtLocationDescriptor<MinidumpThreadListTraits>( | 223 return MinidumpListAtLocationDescriptor<MinidumpThreadListTraits>( |
216 file_contents, location); | 224 file_contents, location); |
217 } | 225 } |
218 | 226 |
219 template <> | 227 template <> |
| 228 const MinidumpModuleCrashpadInfoList* |
| 229 MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfoList>( |
| 230 const std::string& file_contents, |
| 231 const MINIDUMP_LOCATION_DESCRIPTOR& location) { |
| 232 return MinidumpListAtLocationDescriptor<MinidumpModuleCrashpadInfoListTraits>( |
| 233 file_contents, location); |
| 234 } |
| 235 |
| 236 template <> |
220 const MinidumpSimpleStringDictionary* | 237 const MinidumpSimpleStringDictionary* |
221 MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>( | 238 MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>( |
222 const std::string& file_contents, | 239 const std::string& file_contents, |
223 const MINIDUMP_LOCATION_DESCRIPTOR& location) { | 240 const MINIDUMP_LOCATION_DESCRIPTOR& location) { |
224 return MinidumpListAtLocationDescriptor< | 241 return MinidumpListAtLocationDescriptor< |
225 MinidumpSimpleStringDictionaryListTraits>(file_contents, location); | 242 MinidumpSimpleStringDictionaryListTraits>(file_contents, location); |
226 } | 243 } |
227 | 244 |
228 namespace { | 245 namespace { |
229 | 246 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 const MinidumpModuleCodeViewRecordPDB70* | 283 const MinidumpModuleCodeViewRecordPDB70* |
267 MinidumpWritableAtLocationDescriptor<MinidumpModuleCodeViewRecordPDB70>( | 284 MinidumpWritableAtLocationDescriptor<MinidumpModuleCodeViewRecordPDB70>( |
268 const std::string& file_contents, | 285 const std::string& file_contents, |
269 const MINIDUMP_LOCATION_DESCRIPTOR& location) { | 286 const MINIDUMP_LOCATION_DESCRIPTOR& location) { |
270 return MinidumpCVPDBAtLocationDescriptor<MinidumpModuleCodeViewRecordPDB70>( | 287 return MinidumpCVPDBAtLocationDescriptor<MinidumpModuleCodeViewRecordPDB70>( |
271 file_contents, location); | 288 file_contents, location); |
272 } | 289 } |
273 | 290 |
274 } // namespace test | 291 } // namespace test |
275 } // namespace crashpad | 292 } // namespace crashpad |
OLD | NEW |