Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_ | |
| 6 #define CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 | |
| 13 namespace google_breakpad { | |
| 14 class LibcurlWrapper; | |
| 15 } | |
| 16 | |
| 17 namespace chromecast { | |
| 18 | |
| 19 struct CastCrashdumpData { | |
| 20 CastCrashdumpData(); | |
| 21 ~CastCrashdumpData(); | |
| 22 | |
| 23 std::string product; | |
| 24 std::string version; | |
| 25 std::string guid; | |
| 26 std::string ptime; | |
| 27 std::string ctime; | |
| 28 std::string email; | |
| 29 std::string comments; | |
| 30 std::string minidump_pathname; | |
| 31 std::string crash_server; | |
| 32 std::string proxy_host; | |
| 33 std::string proxy_userpassword; | |
| 34 }; | |
| 35 | |
| 36 class CastCrashdumpUploader { | |
| 37 public: | |
| 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(); | |
| 43 | |
| 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); | |
| 47 | |
| 48 private: | |
| 49 bool CheckRequiredParametersArePresent(); | |
| 50 | |
| 51 google_breakpad::LibcurlWrapper* http_layer_; | |
| 52 CastCrashdumpData data_; | |
| 53 std::map<std::string /* label */, std::string /* file */> attachments_; | |
|
alokp
2015/06/15 17:51:48
nit: It might be easier to read if the documentati
slan
2015/06/16 14:57:49
Done.
| |
| 54 std::map<std::string /* key */, std::string /* value */> parameters_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(CastCrashdumpUploader); | |
| 57 }; | |
| 58 | |
| 59 } // namespace chromecast | |
| 60 | |
| 61 #endif // CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_ | |
| OLD | NEW |