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

Unified Diff: chrome/browser/crash_upload_list_crashpad.cc

Issue 1481703002: win: Move Crashpad all into chrome.exe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix and rebase Created 5 years 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
« no previous file with comments | « chrome/browser/crash_upload_list_crashpad.h ('k') | chrome/browser_tests.isolate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6d2ee263c9f4c02a80ba9bc059ab0d1f8db13902 100644
--- a/chrome/browser/crash_upload_list_crashpad.cc
+++ b/chrome/browser/crash_upload_list_crashpad.cc
@@ -6,19 +6,55 @@
#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)(
+ const crash_reporter::UploadedReport** reports,
+ size_t* report_count);
+
+void GetUploadedReportsThunk(
+ std::vector<crash_reporter::UploadedReport>* uploaded_reports) {
+ static GetUploadedReportsPointer get_uploaded_reports = []() {
+ HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
+ return reinterpret_cast<GetUploadedReportsPointer>(
+ exe_module ? GetProcAddress(exe_module, "GetUploadedReportsImpl")
+ : nullptr);
+ }();
+
+ if (get_uploaded_reports) {
+ const crash_reporter::UploadedReport* reports;
+ size_t report_count;
+ get_uploaded_reports(&reports, &report_count);
+ *uploaded_reports = std::vector<crash_reporter::UploadedReport>(
+ reports, reports + report_count);
+ }
+}
+#endif // OS_WIN
+
+} // namespace
+
CrashUploadListCrashpad::CrashUploadListCrashpad(
Delegate* delegate,
- const base::FilePath& upload_log_path,
const scoped_refptr<base::SequencedWorkerPool>& worker_pool)
- : CrashUploadList(delegate, upload_log_path, worker_pool) {}
+ : CrashUploadList(delegate, base::FilePath(), worker_pool) {}
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);
+#else
crash_reporter::GetUploadedReports(&uploaded_reports);
+#endif
ClearUploads();
for (const crash_reporter::UploadedReport& uploaded_report :
« no previous file with comments | « chrome/browser/crash_upload_list_crashpad.h ('k') | chrome/browser_tests.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698