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

Unified Diff: chrome/browser/crash_upload_list_crashpad.cc

Issue 2088613002: Move c/b/crash_upload_list* to subdir with OWNERS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@crash-list-all
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « chrome/browser/crash_upload_list_crashpad.h ('k') | chrome/browser/ui/webui/crashes_ui.cc » ('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
deleted file mode 100644
index bbba7ee973fa1378f369c4151c0f0a18d9ab7b48..0000000000000000000000000000000000000000
--- a/chrome/browser/crash_upload_list_crashpad.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/crash_upload_list_crashpad.h"
-
-#include <stddef.h>
-
-#include "base/threading/sequenced_worker_pool.h"
-#include "base/time/time.h"
-#include "build/build_config.h"
-#include "chrome/common/chrome_constants.h"
-#include "components/crash/content/app/crashpad.h"
-
-namespace {
-
-#if defined(OS_WIN)
-typedef void (*GetCrashReportsPointer)(
- const crash_reporter::Report** reports,
- size_t* report_count);
-
-void GetReportsThunk(
- std::vector<crash_reporter::Report>* reports) {
- static GetCrashReportsPointer get_crash_reports = []() {
- HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
- return reinterpret_cast<GetCrashReportsPointer>(
- exe_module ? GetProcAddress(exe_module, "GetCrashReportsImpl")
- : nullptr);
- }();
-
- if (get_crash_reports) {
- const crash_reporter::Report* reports_pointer;
- size_t report_count;
- get_crash_reports(&reports_pointer, &report_count);
- *reports = std::vector<crash_reporter::Report>(
- reports_pointer, reports_pointer + report_count);
- }
-}
-#endif // OS_WIN
-
-UploadList::UploadInfo::State ReportUploadStateToUploadInfoState(
- crash_reporter::ReportUploadState state) {
- switch (state) {
- case crash_reporter::ReportUploadState::NotUploaded:
- return UploadList::UploadInfo::State::NotUploaded;
-
- case crash_reporter::ReportUploadState::Pending:
- return UploadList::UploadInfo::State::Pending;
-
- case crash_reporter::ReportUploadState::Uploaded:
- return UploadList::UploadInfo::State::Uploaded;
- }
-
- NOTREACHED();
- return UploadList::UploadInfo::State::Uploaded;
-}
-
-} // namespace
-
-CrashUploadListCrashpad::CrashUploadListCrashpad(
- Delegate* delegate,
- const scoped_refptr<base::SequencedWorkerPool>& worker_pool)
- : CrashUploadList(delegate, base::FilePath(), worker_pool) {}
-
-CrashUploadListCrashpad::~CrashUploadListCrashpad() {}
-
-void CrashUploadListCrashpad::LoadUploadList(
- std::vector<UploadList::UploadInfo>* uploads) {
- std::vector<crash_reporter::Report> 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 reports list.
- GetReportsThunk(&reports);
-#else
- crash_reporter::GetReports(&reports);
-#endif
-
- for (const crash_reporter::Report& report : reports) {
- uploads->push_back(
- UploadInfo(report.remote_id, base::Time::FromTimeT(report.upload_time),
- report.local_id, base::Time::FromTimeT(report.capture_time),
- ReportUploadStateToUploadInfoState(report.state)));
- }
-}
« no previous file with comments | « chrome/browser/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