| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 struct MinidumpThreadListTraits { | 176 struct MinidumpThreadListTraits { |
| 177 using ListType = MINIDUMP_THREAD_LIST; | 177 using ListType = MINIDUMP_THREAD_LIST; |
| 178 enum : size_t { kElementSize = sizeof(MINIDUMP_THREAD) }; | 178 enum : size_t { kElementSize = sizeof(MINIDUMP_THREAD) }; |
| 179 static size_t ElementCount(const ListType* list) { | 179 static size_t ElementCount(const ListType* list) { |
| 180 return list->NumberOfThreads; | 180 return list->NumberOfThreads; |
| 181 } | 181 } |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 struct MinidumpLocationDescriptorListTraits { | 184 struct MinidumpModuleCrashpadInfoListTraits { |
| 185 using ListType = MinidumpLocationDescriptorList; | 185 using ListType = MinidumpModuleCrashpadInfoList; |
| 186 enum : size_t { kElementSize = sizeof(MINIDUMP_LOCATION_DESCRIPTOR) }; | 186 enum : size_t { kElementSize = sizeof(MinidumpModuleCrashpadInfoLink) }; |
| 187 static size_t ElementCount(const ListType* list) { | 187 static size_t ElementCount(const ListType* list) { |
| 188 return list->count; | 188 return list->count; |
| 189 } | 189 } |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 struct MinidumpSimpleStringDictionaryListTraits { | 192 struct MinidumpSimpleStringDictionaryListTraits { |
| 193 using ListType = MinidumpSimpleStringDictionary; | 193 using ListType = MinidumpSimpleStringDictionary; |
| 194 enum : size_t { kElementSize = sizeof(MinidumpSimpleStringDictionaryEntry) }; | 194 enum : size_t { kElementSize = sizeof(MinidumpSimpleStringDictionaryEntry) }; |
| 195 static size_t ElementCount(const ListType* list) { | 195 static size_t ElementCount(const ListType* list) { |
| 196 return list->count; | 196 return list->count; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 template <> | 239 template <> |
| 240 const MINIDUMP_THREAD_LIST* MinidumpWritableAtLocationDescriptor< | 240 const MINIDUMP_THREAD_LIST* MinidumpWritableAtLocationDescriptor< |
| 241 MINIDUMP_THREAD_LIST>(const std::string& file_contents, | 241 MINIDUMP_THREAD_LIST>(const std::string& file_contents, |
| 242 const MINIDUMP_LOCATION_DESCRIPTOR& location) { | 242 const MINIDUMP_LOCATION_DESCRIPTOR& location) { |
| 243 return MinidumpListAtLocationDescriptor<MinidumpThreadListTraits>( | 243 return MinidumpListAtLocationDescriptor<MinidumpThreadListTraits>( |
| 244 file_contents, location); | 244 file_contents, location); |
| 245 } | 245 } |
| 246 | 246 |
| 247 template <> | 247 template <> |
| 248 const MinidumpLocationDescriptorList* | 248 const MinidumpModuleCrashpadInfoList* |
| 249 MinidumpWritableAtLocationDescriptor<MinidumpLocationDescriptorList>( | 249 MinidumpWritableAtLocationDescriptor<MinidumpModuleCrashpadInfoList>( |
| 250 const std::string& file_contents, | 250 const std::string& file_contents, |
| 251 const MINIDUMP_LOCATION_DESCRIPTOR& location) { | 251 const MINIDUMP_LOCATION_DESCRIPTOR& location) { |
| 252 return MinidumpListAtLocationDescriptor<MinidumpLocationDescriptorListTraits>( | 252 return MinidumpListAtLocationDescriptor<MinidumpModuleCrashpadInfoListTraits>( |
| 253 file_contents, location); | 253 file_contents, location); |
| 254 } | 254 } |
| 255 | 255 |
| 256 template <> | 256 template <> |
| 257 const MinidumpSimpleStringDictionary* | 257 const MinidumpSimpleStringDictionary* |
| 258 MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>( | 258 MinidumpWritableAtLocationDescriptor<MinidumpSimpleStringDictionary>( |
| 259 const std::string& file_contents, | 259 const std::string& file_contents, |
| 260 const MINIDUMP_LOCATION_DESCRIPTOR& location) { | 260 const MINIDUMP_LOCATION_DESCRIPTOR& location) { |
| 261 return MinidumpListAtLocationDescriptor< | 261 return MinidumpListAtLocationDescriptor< |
| 262 MinidumpSimpleStringDictionaryListTraits>(file_contents, location); | 262 MinidumpSimpleStringDictionaryListTraits>(file_contents, location); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 size_t TestUInt32MinidumpWritable::SizeOfObject() { | 319 size_t TestUInt32MinidumpWritable::SizeOfObject() { |
| 320 return sizeof(value_); | 320 return sizeof(value_); |
| 321 } | 321 } |
| 322 | 322 |
| 323 bool TestUInt32MinidumpWritable::WriteObject(FileWriterInterface* file_writer) { | 323 bool TestUInt32MinidumpWritable::WriteObject(FileWriterInterface* file_writer) { |
| 324 return file_writer->Write(&value_, sizeof(value_)); | 324 return file_writer->Write(&value_, sizeof(value_)); |
| 325 } | 325 } |
| 326 | 326 |
| 327 } // namespace test | 327 } // namespace test |
| 328 } // namespace crashpad | 328 } // namespace crashpad |
| OLD | NEW |