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

Unified Diff: headless/lib/headless_crash_reporter_client.cc

Issue 2693943004: headless: Add support for minidump generation on Linux (Closed)
Patch Set: Review comments Created 3 years, 10 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 | « headless/lib/headless_crash_reporter_client.h ('k') | headless/lib/headless_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/headless_crash_reporter_client.cc
diff --git a/headless/lib/headless_crash_reporter_client.cc b/headless/lib/headless_crash_reporter_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a319161dbd1337caea8ceb70c3960a0062368b11
--- /dev/null
+++ b/headless/lib/headless_crash_reporter_client.cc
@@ -0,0 +1,63 @@
+// Copyright 2017 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.
+
+#include "headless/lib/headless_crash_reporter_client.h"
+
+#include <utility>
+
+#include "base/command_line.h"
+#include "base/path_service.h"
+#include "base/strings/string16.h"
+#include "base/strings/utf_string_conversions.h"
+#include "build/build_config.h"
+#include "content/public/common/content_switches.h"
+#include "headless/public/version.h"
+
+namespace headless {
+
+HeadlessCrashReporterClient::HeadlessCrashReporterClient() = default;
+HeadlessCrashReporterClient::~HeadlessCrashReporterClient() = default;
+
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+void HeadlessCrashReporterClient::GetProductNameAndVersion(
+ const char** product_name,
+ const char** version) {
+ *product_name = "HeadlessChrome";
+ *version = PRODUCT_VERSION;
+}
+
+base::FilePath HeadlessCrashReporterClient::GetReporterLogFilename() {
+ return base::FilePath(FILE_PATH_LITERAL("uploads.log"));
+}
+#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
+
+bool HeadlessCrashReporterClient::GetCrashDumpLocation(
+#if defined(OS_WIN)
+ base::string16* crash_dir
+#else
+ base::FilePath* crash_dir
+#endif
+ ) {
+ base::FilePath crash_directory = crash_dumps_dir_;
+ if (crash_directory.empty() &&
+ !base::PathService::Get(base::DIR_MODULE, &crash_directory)) {
+ return false;
+ }
+#if defined(OS_WIN)
+ *crash_dir = crash_directory.value();
+#else
+ *crash_dir = std::move(crash_directory);
+#endif
+ return true;
+}
+
+bool HeadlessCrashReporterClient::EnableBreakpadForProcess(
+ const std::string& process_type) {
+ return process_type == switches::kRendererProcess ||
+ process_type == switches::kPpapiPluginProcess ||
+ process_type == switches::kZygoteProcess ||
+ process_type == switches::kGpuProcess;
+}
+
+} // namespace content
« no previous file with comments | « headless/lib/headless_crash_reporter_client.h ('k') | headless/lib/headless_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698