feat: Add crash recovery on Windows (#5012)

This commit is contained in:
nerix
2023-12-24 15:38:58 +01:00
committed by GitHub
parent 2cb965d352
commit 25add89b14
29 changed files with 563 additions and 258 deletions
+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include "common/Singleton.hpp"
#include <QtGlobal>
#ifdef CHATTERINO_WITH_CRASHPAD
# include <client/crashpad_client.h>
# include <memory>
#endif
namespace chatterino {
class CrashHandler : public Singleton
{
public:
bool shouldRecover() const
{
return this->shouldRecover_;
}
/// Sets and saves whether Chatterino should restart on a crash
void saveShouldRecover(bool value);
void initialize(Settings &settings, Paths &paths) override;
private:
bool shouldRecover_ = false;
};
#ifdef CHATTERINO_WITH_CRASHPAD
std::unique_ptr<crashpad::CrashpadClient> installCrashHandler();
#endif
} // namespace chatterino