OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/crash/content/app/crashpad.h" | 5 #include "components/crash/content/app/crashpad.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
234 uploaded_reports->push_back(uploaded_report); | 234 uploaded_reports->push_back(uploaded_report); |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 std::sort(uploaded_reports->begin(), uploaded_reports->end(), | 238 std::sort(uploaded_reports->begin(), uploaded_reports->end(), |
239 [](const UploadedReport& a, const UploadedReport& b) { | 239 [](const UploadedReport& a, const UploadedReport& b) { |
240 return a.creation_time >= b.creation_time; | 240 return a.creation_time >= b.creation_time; |
241 }); | 241 }); |
242 } | 242 } |
243 | 243 |
244 #if defined(KASKO) | |
245 | |
246 void GetCrashKeysForKasko(std::vector<kasko::api::CrashKey>* crash_keys) { | |
247 crash_keys->clear(); | |
248 crash_keys->reserve(g_simple_string_dictionary->GetCount()); | |
249 crashpad::SimpleStringDictionary::Iterator iter(*g_simple_string_dictionary); | |
250 for (;;) { | |
Mark Mentovai
2015/12/15 18:19:34
I like
while ((entry = iter.Next()) != nullptr)
scottmg
2015/12/15 18:37:12
My main reason is that I feel like there'll be a c
grt (UTC plus 2)
2015/12/15 20:12:36
?
for (const auto* entry = iter.Next(); entry; e
scottmg
2015/12/15 20:20:01
But then there's unnecessary duplication of "iter.
| |
251 const auto* entry = iter.Next(); | |
252 if (!entry) | |
253 break; | |
254 kasko::api::CrashKey kv; | |
255 wcsncpy_s(kv.name, base::UTF8ToWide(entry->key).c_str(), _TRUNCATE); | |
256 wcsncpy_s(kv.value, base::UTF8ToWide(entry->value).c_str(), _TRUNCATE); | |
257 crash_keys->push_back(kv); | |
258 } | |
259 } | |
260 | |
261 #endif // KASKO | |
262 | |
244 } // namespace crash_reporter | 263 } // namespace crash_reporter |
245 | 264 |
246 #if defined(OS_WIN) | 265 #if defined(OS_WIN) |
247 | 266 |
248 extern "C" { | 267 extern "C" { |
249 | 268 |
250 // NOTE: This function is used by SyzyASAN to annotate crash reports. If you | 269 // NOTE: This function is used by SyzyASAN to annotate crash reports. If you |
251 // change the name or signature of this function you will break SyzyASAN | 270 // change the name or signature of this function you will break SyzyASAN |
252 // instrumented releases of Chrome. Please contact syzygy-team@chromium.org | 271 // instrumented releases of Chrome. Please contact syzygy-team@chromium.org |
253 // before doing so! See also http://crbug.com/567781. | 272 // before doing so! See also http://crbug.com/567781. |
254 void __declspec(dllexport) __cdecl SetCrashKeyValueImpl(const wchar_t* key, | 273 void __declspec(dllexport) __cdecl SetCrashKeyValueImpl(const wchar_t* key, |
255 const wchar_t* value) { | 274 const wchar_t* value) { |
256 crash_reporter::SetCrashKeyValue(base::UTF16ToUTF8(key), | 275 crash_reporter::SetCrashKeyValue(base::UTF16ToUTF8(key), |
257 base::UTF16ToUTF8(value)); | 276 base::UTF16ToUTF8(value)); |
258 } | 277 } |
259 | 278 |
260 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) { | 279 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) { |
261 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key)); | 280 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key)); |
262 } | 281 } |
263 | 282 |
264 } // extern "C" | 283 } // extern "C" |
265 | 284 |
266 #endif // OS_WIN | 285 #endif // OS_WIN |
OLD | NEW |