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

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

Issue 2268783002: Manual crash uploads for mac and win (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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..ac4668db40c2c82a0dd6e3631819ee7713700aa6 100644
--- a/chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc
+++ b/chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc
@@ -38,6 +38,21 @@ void GetReportsThunk(
reports_pointer, reports_pointer + report_count);
}
}
+
+void RequestSingleCrashUploadThunk(const std::string& local_id) {
+ // The crash reporting is handled by chrome_elf.dll which loads early in
+ // the chrome process.
+ HMODULE elf_module = GetModuleHandle(chrome::kChromeElfDllName);
+ if (elf_module) {
+ static RequestSingleCrashUploadPointer request_single_crash_upload =
+ reinterpret_cast<RequestSingleCrashUploadPointer>(
+ GetProcAddress(elf_module, "RequestSingleCrashUploadImpl"));
jwd 2016/08/23 19:14:30 Can you pull the string out into a constant in the
gayane -on leave until 09-2017 2016/08/23 20:57:45 Done.
+
+ if (request_single_crash_upload)
+ request_single_crash_upload(local_id);
+ }
+}
+
#endif // OS_WIN
UploadList::UploadInfo::State ReportUploadStateToUploadInfoState(
@@ -51,6 +66,9 @@ UploadList::UploadInfo::State ReportUploadStateToUploadInfoState(
case crash_reporter::ReportUploadState::Uploaded:
return UploadList::UploadInfo::State::Uploaded;
+
+ case crash_reporter::ReportUploadState::UserRequested:
+ return UploadList::UploadInfo::State::UserRequested;
}
NOTREACHED();
@@ -86,3 +104,16 @@ void CrashUploadListCrashpad::LoadUploadList(
ReportUploadStateToUploadInfoState(report.state)));
}
}
+
+void CrashUploadListCrashpad::RequestSingleCrashUpload(
+ const std::string& local_id) {
+#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.
jwd 2016/08/23 19:14:30 I don't think this is a good way of explaining it.
gayane -on leave until 09-2017 2016/08/23 20:57:45 Done.
+ RequestSingleCrashUploadThunk(local_id);
+#else
+ crash_reporter::RequestSingleCrashUpload(local_id);
+#endif
+}

Powered by Google App Engine
This is Rietveld 408576698