Index: chrome/browser/crash_upload_list_crashpad.cc |
diff --git a/chrome/browser/crash_upload_list_crashpad.cc b/chrome/browser/crash_upload_list_crashpad.cc |
index a2a4bbdda04c960e5a1b59b73d0129a29868d853..680ba1cd806bc02ef7009ea1adc8ed1754e0309a 100644 |
--- a/chrome/browser/crash_upload_list_crashpad.cc |
+++ b/chrome/browser/crash_upload_list_crashpad.cc |
@@ -6,8 +6,33 @@ |
#include "base/threading/sequenced_worker_pool.h" |
#include "base/time/time.h" |
+#include "chrome/common/chrome_constants.h" |
#include "components/crash/content/app/crashpad.h" |
+namespace { |
+ |
+#if defined(OS_WIN) |
+typedef void (*GetUploadedReportsPointer)( |
+ std::vector<crash_reporter::UploadedReport>*); |
+ |
+void GetUploadedReportsThunk( |
Mark Mentovai
2015/12/02 03:05:07
:/
scottmg
2015/12/02 05:35:00
Yeah, it's icky. But not unprecedented as I learne
|
+ std::vector<crash_reporter::UploadedReport>* uploaded_reports) { |
+ static GetUploadedReportsPointer get_uploaded_reports = nullptr; |
Mark Mentovai
2015/12/02 03:05:07
Too bad we don’t have GET_FUNCTION() here.
scottmg
2015/12/02 05:35:00
Yeah, we should probably add that to base.
|
+ if (!get_uploaded_reports) { |
+ HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); |
+ if (!exe_module) |
+ return; |
+ get_uploaded_reports = reinterpret_cast<GetUploadedReportsPointer>( |
+ GetProcAddress(exe_module, "GetUploadedReportsImpl")); |
+ } |
+ |
+ if (get_uploaded_reports) |
+ get_uploaded_reports(uploaded_reports); |
+} |
+#endif // OS_WIN |
+ |
+} // namespace |
+ |
CrashUploadListCrashpad::CrashUploadListCrashpad( |
Delegate* delegate, |
const base::FilePath& upload_log_path, |
@@ -18,7 +43,15 @@ CrashUploadListCrashpad::~CrashUploadListCrashpad() {} |
void CrashUploadListCrashpad::LoadUploadList() { |
std::vector<crash_reporter::UploadedReport> uploaded_reports; |
+#if defined(OS_WIN) |
+ // On Windows, we only link crash client into chrome.exe (not the dlls), and |
+ // it does the registration. That means the global that holds the crash report |
+ // database lives in the .exe, so we need to grab a pointer to a helper in the |
+ // exe to get our uploaded reports list. |
+ GetUploadedReportsThunk(&uploaded_reports); |
Mark Mentovai
2015/12/02 03:05:07
Maybe this ought to be done in crash_reporter::Get
scottmg
2015/12/02 05:35:00
I thought it was a bit better here because then at
Mark Mentovai
2015/12/02 14:59:23
scottmg wrote:
|
+#else |
crash_reporter::GetUploadedReports(&uploaded_reports); |
+#endif |
ClearUploads(); |
for (const crash_reporter::UploadedReport& uploaded_report : |