Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,36 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <minidump/minidump_user_extension_stream_data_source.h>
#include <vector>
namespace Lumberyard
{
class BufferedDataStream : public crashpad::MinidumpUserExtensionStreamDataSource
{
public:
BufferedDataStream(uint32_t stream_type, const void* data, size_t data_size);
size_t StreamDataSize() override;
bool ReadStreamData(Delegate* delegate) override;
private:
std::vector<uint8_t> data_;
BufferedDataStream(const BufferedDataStream& rhs) = delete;
BufferedDataStream& operator=(const BufferedDataStream& rhs) = delete;
};
}
@@ -0,0 +1,75 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <client/crash_report_database.h>
#include <util/net/http_multipart_builder.h>
#include <util/net/http_transport.h>
#include <handler/user_stream_data_source.h>
#ifdef max
#undef max
#endif
#ifdef min
#undef min
#endif
#include <base/logging.h>
#include <string>
namespace Lumberyard
{
bool CheckConfirmation(const crashpad::CrashReportDatabase::Report& report);
void InstallCrashUploader(int& argc, char* argv[]);
bool AddAttachments(crashpad::HTTPMultipartBuilder& builder);
bool UpdateHttpTransport(std::unique_ptr<crashpad::HTTPTransport>& httpTransport, const std::string& baseURL);
class CrashUploader
{
public:
CrashUploader(int& argc, char** argv);
virtual ~CrashUploader();
static void SetCrashUploader(std::shared_ptr<CrashUploader> uploader);
static std::shared_ptr<CrashUploader> GetCrashUploader();
virtual bool CheckConfirmation(const crashpad::CrashReportDatabase::Report& report);
virtual void InstallLogHandler() const;
virtual bool AddAttachments(crashpad::HTTPMultipartBuilder& builder);
virtual bool UpdateHttpTransport(std::unique_ptr<crashpad::HTTPTransport>& httpTransport, const std::string& baseURL);
static const char* GetLogFileName() { return "CrashUploaderLog.txt"; }
// base/logging.h::LogMessageHandlerFunction
static bool DoLogging(logging::LogSeverity severity,
const char* file_poath,
int line,
size_t message_start,
const std::string& string);
// We parse out our arguments from the list and let the rest pass through to crashpad
virtual void ParseArguments(int& argc, char** argv);
virtual crashpad::UserStreamDataSources* GetUserStreamSources();
protected:
// Skip confirmation dialog by argument
bool m_noConfirmation{ false };
// Log paths to uploadas user streams with the minidump
std::vector<base::FilePath> m_uploadPaths;
crashpad::UserStreamDataSources m_userStreams;
static std::shared_ptr<CrashUploader> s_uploader;
std::string m_submissionToken;
std::string m_executableName;
};
}
@@ -0,0 +1,34 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <handler/user_stream_data_source.h>
#include "base/files/file_path.h"
namespace Lumberyard
{
class FileStreamDataSource : public crashpad::UserStreamDataSource
{
public:
FileStreamDataSource(const base::FilePath& filePath);
std::unique_ptr<crashpad::MinidumpUserExtensionStreamDataSource> ProduceStreamData(crashpad::ProcessSnapshot* process_snapshot) override;
private:
FileStreamDataSource(const FileStreamDataSource& rhs) = delete;
FileStreamDataSource& operator=(const FileStreamDataSource& rhs) = delete;
base::FilePath m_filePath;
};
}