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

Unified Diff: chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc

Issue 2325713002: Manual crash uploads for mac and win (Closed)
Patch Set: Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc
diff --git a/chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc b/chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc
index d62973e34209172aa68e34df6a592eef45623a25..28790794e73debe755121165504077c4f2c694c4 100644
--- a/chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc
+++ b/chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc
@@ -18,6 +18,7 @@ namespace {
typedef void (*GetCrashReportsPointer)(
const crash_reporter::Report** reports,
size_t* report_count);
+typedef void (*RequestSingleCrashUploadPointer)(const std::string& local_id);
void GetReportsThunk(
std::vector<crash_reporter::Report>* reports) {
@@ -38,6 +39,21 @@ void GetReportsThunk(
reports_pointer, reports_pointer + report_count);
}
}
+
+void RequestSingleCrashUploadThunk(const std::string& local_id) {
+ static RequestSingleCrashUploadPointer request_single_crash_upload = []() {
+ // The crash reporting is handled by chrome_elf.dll which loads early in
+ // the chrome process.
+ HMODULE elf_module = GetModuleHandle(chrome::kChromeElfDllName);
+ return reinterpret_cast<RequestSingleCrashUploadPointer>(
+ elf_module ? GetProcAddress(elf_module, "RequestSingleCrashUploadImpl")
+ : nullptr);
+ }();
+
+ if (request_single_crash_upload)
+ request_single_crash_upload(local_id);
+}
+
#endif // OS_WIN
UploadList::UploadInfo::State ReportUploadStateToUploadInfoState(
@@ -49,6 +65,9 @@ UploadList::UploadInfo::State ReportUploadStateToUploadInfoState(
case crash_reporter::ReportUploadState::Pending:
return UploadList::UploadInfo::State::Pending;
+ case crash_reporter::ReportUploadState::Pending_UserRequested:
+ return UploadList::UploadInfo::State::Pending_UserRequested;
+
case crash_reporter::ReportUploadState::Uploaded:
return UploadList::UploadInfo::State::Uploaded;
}
@@ -86,3 +105,14 @@ void CrashUploadListCrashpad::LoadUploadList(
ReportUploadStateToUploadInfoState(report.state)));
}
}
+
+void CrashUploadListCrashpad::RequestSingleCrashUpload(
+ const std::string& local_id) {
+#if defined(OS_WIN)
+ // On Windows, crash reporting is handled by chrome_elf.dll, that's why we
+ // can't call crash_reporter::RequestSingleCrashUpload directly.
+ RequestSingleCrashUploadThunk(local_id);
+#else
+ crash_reporter::RequestSingleCrashUpload(local_id);
+#endif
+}
« no previous file with comments | « chrome/browser/crash_upload_list/crash_upload_list_crashpad.h ('k') | chrome/browser/ui/webui/crashes_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698