Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: minidump/test/minidump_writable_test_util.cc

Issue 700143004: C++11: Use type aliases instead of typedefs (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « minidump/minidump_thread_writer_test.cc ('k') | snapshot/cpu_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 EXPECT_EQ(static_cast<uint32_t>(MINIDUMP_VERSION), header->Version); 130 EXPECT_EQ(static_cast<uint32_t>(MINIDUMP_VERSION), header->Version);
131 return nullptr; 131 return nullptr;
132 } 132 }
133 133
134 return header; 134 return header;
135 } 135 }
136 136
137 namespace { 137 namespace {
138 138
139 struct MinidumpMemoryListTraits { 139 struct MinidumpMemoryListTraits {
140 typedef MINIDUMP_MEMORY_LIST ListType; 140 using ListType = MINIDUMP_MEMORY_LIST;
141 static constexpr size_t kElementSize = sizeof(MINIDUMP_MEMORY_DESCRIPTOR); 141 static constexpr size_t kElementSize = sizeof(MINIDUMP_MEMORY_DESCRIPTOR);
142 static size_t ElementCount(const ListType* list) { 142 static size_t ElementCount(const ListType* list) {
143 return list->NumberOfMemoryRanges; 143 return list->NumberOfMemoryRanges;
144 } 144 }
145 }; 145 };
146 146
147 struct MinidumpModuleListTraits { 147 struct MinidumpModuleListTraits {
148 typedef MINIDUMP_MODULE_LIST ListType; 148 using ListType = MINIDUMP_MODULE_LIST;
149 static constexpr size_t kElementSize = sizeof(MINIDUMP_MODULE); 149 static constexpr size_t kElementSize = sizeof(MINIDUMP_MODULE);
150 static size_t ElementCount(const ListType* list) { 150 static size_t ElementCount(const ListType* list) {
151 return list->NumberOfModules; 151 return list->NumberOfModules;
152 } 152 }
153 }; 153 };
154 154
155 struct MinidumpThreadListTraits { 155 struct MinidumpThreadListTraits {
156 typedef MINIDUMP_THREAD_LIST ListType; 156 using ListType = MINIDUMP_THREAD_LIST;
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 { 163 struct MinidumpModuleCrashpadInfoListTraits {
164 typedef MinidumpModuleCrashpadInfoList ListType; 164 using ListType = MinidumpModuleCrashpadInfoList;
165 static constexpr size_t kElementSize = sizeof(MINIDUMP_LOCATION_DESCRIPTOR); 165 static constexpr size_t kElementSize = sizeof(MINIDUMP_LOCATION_DESCRIPTOR);
166 static size_t ElementCount(const ListType* list) { 166 static size_t ElementCount(const ListType* list) {
167 return list->count; 167 return list->count;
168 } 168 }
169 }; 169 };
170 170
171 struct MinidumpSimpleStringDictionaryListTraits { 171 struct MinidumpSimpleStringDictionaryListTraits {
172 typedef MinidumpSimpleStringDictionary ListType; 172 using ListType = MinidumpSimpleStringDictionary;
173 static constexpr size_t kElementSize = 173 static constexpr size_t kElementSize =
174 sizeof(MinidumpSimpleStringDictionaryEntry); 174 sizeof(MinidumpSimpleStringDictionaryEntry);
175 static size_t ElementCount(const ListType* list) { 175 static size_t ElementCount(const ListType* list) {
176 return list->count; 176 return list->count;
177 } 177 }
178 }; 178 };
179 179
180 template <typename T> 180 template <typename T>
181 const typename T::ListType* MinidumpListAtLocationDescriptor( 181 const typename T::ListType* MinidumpListAtLocationDescriptor(
182 const std::string& file_contents, 182 const std::string& file_contents,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 const MinidumpModuleCodeViewRecordPDB70* 283 const MinidumpModuleCodeViewRecordPDB70*
284 MinidumpWritableAtLocationDescriptor<MinidumpModuleCodeViewRecordPDB70>( 284 MinidumpWritableAtLocationDescriptor<MinidumpModuleCodeViewRecordPDB70>(
285 const std::string& file_contents, 285 const std::string& file_contents,
286 const MINIDUMP_LOCATION_DESCRIPTOR& location) { 286 const MINIDUMP_LOCATION_DESCRIPTOR& location) {
287 return MinidumpCVPDBAtLocationDescriptor<MinidumpModuleCodeViewRecordPDB70>( 287 return MinidumpCVPDBAtLocationDescriptor<MinidumpModuleCodeViewRecordPDB70>(
288 file_contents, location); 288 file_contents, location);
289 } 289 }
290 290
291 } // namespace test 291 } // namespace test
292 } // namespace crashpad 292 } // namespace crashpad
OLDNEW
« no previous file with comments | « minidump/minidump_thread_writer_test.cc ('k') | snapshot/cpu_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698