1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_
6 #define CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_
11 #include "base/macros.h"
13 namespace google_breakpad
{
17 namespace chromecast
{
19 struct CastCrashdumpData
{
30 std::string minidump_pathname
;
31 std::string crash_server
;
32 std::string proxy_host
;
33 std::string proxy_userpassword
;
36 class CastCrashdumpUploader
{
38 // Does not take ownership of |http_layer|.
39 CastCrashdumpUploader(const CastCrashdumpData
& data
,
40 google_breakpad::LibcurlWrapper
* http_layer
);
41 CastCrashdumpUploader(const CastCrashdumpData
& data
);
42 ~CastCrashdumpUploader();
44 bool AddAttachment(const std::string
& label
, const std::string
& filename
);
45 void SetParameter(const std::string
& key
, const std::string
& value
);
46 bool Upload(std::string
* response
);
49 bool CheckRequiredParametersArePresent();
51 google_breakpad::LibcurlWrapper
* http_layer_
;
52 CastCrashdumpData data_
;
54 // Holds the following mapping for attachments: <label, filepath>
55 std::map
<std::string
, std::string
> attachments_
;
57 // Holds the following mapping for HTTP request params: <key, value>
58 std::map
<std::string
, std::string
> parameters_
;
60 DISALLOW_COPY_AND_ASSIGN(CastCrashdumpUploader
);
63 } // namespace chromecast
65 #endif // CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_