#include "chrome/browser/enterprise/connectors/reporting/crash_reporting_context.h"
#include "base/command_line.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.h"
#include "chrome/browser/enterprise/connectors/reporting/realtime_reporting_client_factory.h"
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/channel_info.h"
#include "components/crash/core/app/crashpad.h"
#include "components/enterprise/connectors/core/connectors_prefs.h"
#include "components/enterprise/connectors/core/reporting_service_settings.h"
#include "components/prefs/pref_service.h"
#include "components/version_info/version_info.h"
namespace enterprise_connectors {
#if !BUILDFLAG(IS_CHROMEOS)
namespace {
constexpr char kKeyChannel[] = …;
constexpr char kKeyVersion[] = …;
constexpr char kKeyReportId[] = …;
constexpr char kKeyPlatform[] = …;
constexpr char kCrashpadPollingIntervalFlag[] = …;
constexpr int kDefaultCrashpadPollingIntervalSeconds = …;
policy::ChromeBrowserCloudManagementController* GetCBCMController() { … }
void CopyNewReports(
const std::vector<crashpad::CrashReportDatabase::Report>&
reports_to_be_copied,
int64_t latest_creation_time,
std::vector<crashpad::CrashReportDatabase::Report>& reports) { … }
std::vector<crashpad::CrashReportDatabase::Report> GetNewReports(
time_t latest_creation_time) { … }
void ReportCrashes() { … }
}
base::TimeDelta GetCrashpadPollingInterval() { … }
std::vector<crashpad::CrashReportDatabase::Report> GetNewReportsFromDatabase(
time_t latest_creation_time,
crashpad::CrashReportDatabase* database) { … }
time_t GetLatestCrashReportTime(PrefService* local_state) { … }
void SetLatestCrashReportTime(PrefService* local_state, time_t timestamp) { … }
void UploadToReportingServer(
base::WeakPtr<RealtimeReportingClient> reporting_client,
PrefService* local_state,
std::vector<crashpad::CrashReportDatabase::Report> reports) { … }
CrashReportingContext::CrashReportingContext() { … }
void CrashReportingContext::AddProfile(BrowserCrashEventRouter* router,
Profile* profile) { … }
CrashReportingContext* CrashReportingContext::GetInstance() { … }
RealtimeReportingClient* CrashReportingContext::GetCrashReportingClient()
const { … }
bool CrashReportingContext::HasActiveProfile() const { … }
void CrashReportingContext::OnBrowserUnenrolled(bool succeeded) { … }
void CrashReportingContext::OnCloudReportingLaunched(
enterprise_reporting::ReportScheduler* report_scheduler) { … }
void CrashReportingContext::OnShutdown() { … }
void CrashReportingContext::RemoveProfile(BrowserCrashEventRouter* router) { … }
#endif
CrashReportingContext::~CrashReportingContext() = default;
}