| 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 "chrome/browser/crash_upload_list_crashpad.h" | 5 #include "chrome/browser/crash_upload_list_crashpad.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 } // namespace | 41 } // namespace |
| 42 | 42 |
| 43 CrashUploadListCrashpad::CrashUploadListCrashpad( | 43 CrashUploadListCrashpad::CrashUploadListCrashpad( |
| 44 Delegate* delegate, | 44 Delegate* delegate, |
| 45 const scoped_refptr<base::SequencedWorkerPool>& worker_pool) | 45 const scoped_refptr<base::SequencedWorkerPool>& worker_pool) |
| 46 : CrashUploadList(delegate, base::FilePath(), worker_pool) {} | 46 : CrashUploadList(delegate, base::FilePath(), worker_pool) {} |
| 47 | 47 |
| 48 CrashUploadListCrashpad::~CrashUploadListCrashpad() {} | 48 CrashUploadListCrashpad::~CrashUploadListCrashpad() {} |
| 49 | 49 |
| 50 void CrashUploadListCrashpad::LoadUploadList() { | 50 void CrashUploadListCrashpad::LoadUploadList( |
| 51 std::vector<UploadList::UploadInfo>* uploads) { |
| 51 std::vector<crash_reporter::UploadedReport> uploaded_reports; | 52 std::vector<crash_reporter::UploadedReport> uploaded_reports; |
| 52 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
| 53 // On Windows, we only link crash client into chrome.exe (not the dlls), and | 54 // On Windows, we only link crash client into chrome.exe (not the dlls), and |
| 54 // it does the registration. That means the global that holds the crash report | 55 // it does the registration. That means the global that holds the crash report |
| 55 // database lives in the .exe, so we need to grab a pointer to a helper in the | 56 // database lives in the .exe, so we need to grab a pointer to a helper in the |
| 56 // exe to get our uploaded reports list. | 57 // exe to get our uploaded reports list. |
| 57 GetUploadedReportsThunk(&uploaded_reports); | 58 GetUploadedReportsThunk(&uploaded_reports); |
| 58 #else | 59 #else |
| 59 crash_reporter::GetUploadedReports(&uploaded_reports); | 60 crash_reporter::GetUploadedReports(&uploaded_reports); |
| 60 #endif | 61 #endif |
| 61 | 62 |
| 62 ClearUploads(); | |
| 63 for (const crash_reporter::UploadedReport& uploaded_report : | 63 for (const crash_reporter::UploadedReport& uploaded_report : |
| 64 uploaded_reports) { | 64 uploaded_reports) { |
| 65 AppendUploadInfo( | 65 uploads->push_back( |
| 66 UploadInfo(uploaded_report.remote_id, | 66 UploadInfo(uploaded_report.remote_id, |
| 67 base::Time::FromTimeT(uploaded_report.creation_time), | 67 base::Time::FromTimeT(uploaded_report.creation_time), |
| 68 uploaded_report.local_id, base::Time())); | 68 uploaded_report.local_id, base::Time())); |
| 69 } | 69 } |
| 70 } | 70 } |
| OLD | NEW |