| Index: chromecast/crash/cast_crashdump_uploader.h
|
| diff --git a/chromecast/crash/cast_crashdump_uploader.h b/chromecast/crash/cast_crashdump_uploader.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9292d8aefb1a4843ac6636d9ebb4955ec5b8620f
|
| --- /dev/null
|
| +++ b/chromecast/crash/cast_crashdump_uploader.h
|
| @@ -0,0 +1,65 @@
|
| +// 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.
|
| +
|
| +#ifndef CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_
|
| +#define CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_
|
| +
|
| +#include <map>
|
| +#include <string>
|
| +
|
| +#include "base/macros.h"
|
| +
|
| +namespace google_breakpad {
|
| +class LibcurlWrapper;
|
| +}
|
| +
|
| +namespace chromecast {
|
| +
|
| +struct CastCrashdumpData {
|
| + CastCrashdumpData();
|
| + ~CastCrashdumpData();
|
| +
|
| + std::string product;
|
| + std::string version;
|
| + std::string guid;
|
| + std::string ptime;
|
| + std::string ctime;
|
| + std::string email;
|
| + std::string comments;
|
| + std::string minidump_pathname;
|
| + std::string crash_server;
|
| + std::string proxy_host;
|
| + std::string proxy_userpassword;
|
| +};
|
| +
|
| +class CastCrashdumpUploader {
|
| + public:
|
| + explicit CastCrashdumpUploader(const CastCrashdumpData& data);
|
| + CastCrashdumpUploader(const CastCrashdumpData& data,
|
| + google_breakpad::LibcurlWrapper* http_layer);
|
| + ~CastCrashdumpUploader();
|
| +
|
| + void Init(const CastCrashdumpData& data,
|
| + google_breakpad::LibcurlWrapper* http_layer);
|
| +
|
| + bool AddAttachment(const std::string& label, const std::string& filename);
|
| + void SetParameter(const std::string& key, const std::string& value);
|
| + bool Upload(std::string* response);
|
| +
|
| + private:
|
| + bool CheckRequiredParametersArePresent();
|
| +
|
| + google_breakpad::LibcurlWrapper* http_layer_;
|
| + bool http_layer_created_internally_;
|
| +
|
| + CastCrashdumpData data_;
|
| + std::map<std::string /* label */, std::string /* file */> attachments_;
|
| + std::map<std::string /* key */, std::string /* value */> parameters_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(CastCrashdumpUploader);
|
| +};
|
| +
|
| +} // namespace chromecast
|
| +
|
| +#endif // CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_
|
|
|