Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #if BUILDFLAG(ENABLE_KASKO) | 10 #if BUILDFLAG(ENABLE_KASKO) |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 | 271 |
| 272 void GetUploadedReports(std::vector<UploadedReport>* uploaded_reports) { | 272 void GetUploadedReports(std::vector<UploadedReport>* uploaded_reports) { |
| 273 uploaded_reports->clear(); | 273 uploaded_reports->clear(); |
| 274 | 274 |
| 275 if (!g_database) { | 275 if (!g_database) { |
| 276 return; | 276 return; |
| 277 } | 277 } |
| 278 | 278 |
| 279 std::vector<crashpad::CrashReportDatabase::Report> completed_reports; | 279 std::vector<crashpad::CrashReportDatabase::Report> completed_reports; |
| 280 crashpad::CrashReportDatabase::OperationStatus status = | 280 crashpad::CrashReportDatabase::OperationStatus status = |
| 281 g_database->GetCompletedReports(&completed_reports); | 281 g_database->GetCompletedReports(&completed_reports); |
|
Mark Mentovai
2016/06/16 22:02:04
Since we want to show not-uploaded reports, should
scottmg
2016/06/16 22:28:08
Yeah, that seems reasonable, but gets more complic
Mark Mentovai
2016/06/16 23:16:05
scottmg wrote:
| |
| 282 if (status != crashpad::CrashReportDatabase::kNoError) { | 282 if (status != crashpad::CrashReportDatabase::kNoError) { |
| 283 return; | 283 return; |
| 284 } | 284 } |
| 285 | 285 |
| 286 for (const crashpad::CrashReportDatabase::Report& completed_report : | 286 for (const crashpad::CrashReportDatabase::Report& completed_report : |
| 287 completed_reports) { | 287 completed_reports) { |
| 288 if (completed_report.uploaded) { | 288 UploadedReport uploaded_report; |
|
Mark Mentovai
2016/06/16 22:02:04
UploadedReport is a misnomer now.
Given the above
scottmg
2016/06/16 22:28:08
Yeah :(, was being a bit lazy. components/upload_l
| |
| 289 UploadedReport uploaded_report; | 289 uploaded_report.local_id = completed_report.uuid.ToString(); |
| 290 uploaded_report.local_id = completed_report.uuid.ToString(); | 290 uploaded_report.remote_id = completed_report.id; |
| 291 uploaded_report.remote_id = completed_report.id; | 291 uploaded_report.creation_time = completed_report.creation_time; |
| 292 uploaded_report.creation_time = completed_report.creation_time; | |
| 293 | 292 |
| 294 uploaded_reports->push_back(uploaded_report); | 293 uploaded_reports->push_back(uploaded_report); |
| 295 } | |
| 296 } | 294 } |
| 297 | 295 |
| 298 std::sort(uploaded_reports->begin(), uploaded_reports->end(), | 296 std::sort(uploaded_reports->begin(), uploaded_reports->end(), |
| 299 [](const UploadedReport& a, const UploadedReport& b) { | 297 [](const UploadedReport& a, const UploadedReport& b) { |
| 300 return a.creation_time > b.creation_time; | 298 return a.creation_time > b.creation_time; |
| 301 }); | 299 }); |
| 302 } | 300 } |
| 303 | 301 |
| 304 #if BUILDFLAG(ENABLE_KASKO) | 302 #if BUILDFLAG(ENABLE_KASKO) |
| 305 | 303 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 405 base::UTF16ToUTF8(value)); | 403 base::UTF16ToUTF8(value)); |
| 406 } | 404 } |
| 407 | 405 |
| 408 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) { | 406 void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl(const wchar_t* key) { |
| 409 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key)); | 407 crash_reporter::ClearCrashKey(base::UTF16ToUTF8(key)); |
| 410 } | 408 } |
| 411 | 409 |
| 412 } // extern "C" | 410 } // extern "C" |
| 413 | 411 |
| 414 #endif // OS_WIN | 412 #endif // OS_WIN |
| OLD | NEW |