Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5281)

Unified Diff: chromecast/crash/cast_crashdump_uploader.h

Issue 1154383006: Adding crash utilities to chromecast/crash. (Closed) Base URL: https://eureka-internal.googlesource.com/chromium/src@master
Patch Set: cast_shell_unittests not built for android Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/crash/cast_crash_reporter_client_simple.cc ('k') | chromecast/crash/cast_crashdump_uploader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..acdfd9ad3b3bfab3d728a6fb27764c2e583fdd1e
--- /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:
+ // Does not take ownership of |http_layer|.
+ CastCrashdumpUploader(const CastCrashdumpData& data,
+ google_breakpad::LibcurlWrapper* http_layer);
+ CastCrashdumpUploader(const CastCrashdumpData& data);
+ ~CastCrashdumpUploader();
+
+ 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_;
+ CastCrashdumpData data_;
+
+ // Holds the following mapping for attachments: <label, filepath>
+ std::map<std::string, std::string> attachments_;
+
+ // Holds the following mapping for HTTP request params: <key, value>
+ std::map<std::string, std::string> parameters_;
+
+ DISALLOW_COPY_AND_ASSIGN(CastCrashdumpUploader);
+};
+
+} // namespace chromecast
+
+#endif // CHROMECAST_CRASH_CAST_CRASHDUMP_UPLOADER_H_
« no previous file with comments | « chromecast/crash/cast_crash_reporter_client_simple.cc ('k') | chromecast/crash/cast_crashdump_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698