blob: 01c79a8f297c56b1d034b93c440e6cb59c9aba8d [file] [log] [blame]
[email protected]a05245a12012-02-26 23:53:241// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]9a5d2a52009-05-22 03:37:452// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]1602cde2012-06-26 15:09:125#ifndef CHROME_APP_BREAKPAD_LINUX_H_
6#define CHROME_APP_BREAKPAD_LINUX_H_
[email protected]9a5d2a52009-05-22 03:37:457
[email protected]c7b1d2f2010-12-03 03:33:138#include "base/basictypes.h"
[email protected]9169e6a92009-09-28 18:39:549
[email protected]1e7377d2009-05-28 20:23:0610extern void InitCrashReporter();
[email protected]40da3e0c2012-10-24 22:03:3811#if defined(OS_ANDROID)
12extern void InitNonBrowserCrashReporterForAndroid(int minidump_fd);
13#endif
[email protected]b8d6ae12009-12-10 02:02:2014bool IsCrashReporterEnabled();
[email protected]2eb41e72009-07-15 23:07:3415
[email protected]4cc70272009-08-14 00:02:0416static const size_t kMaxActiveURLSize = 1024;
17static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex.
18static const size_t kDistroSize = 128;
[email protected]a83291d62012-08-23 14:39:4519#if defined(ADDRESS_SANITIZER)
20static const size_t kMaxAsanReportSize = 1 << 16;
21#endif
[email protected]2eb41e72009-07-15 23:07:3422
[email protected]40da3e0c2012-10-24 22:03:3823// BreakpadInfo describes a crash report.
24// The minidump information can either be contained in a file descriptor (fd) or
25// in a file (whose path is in filename).
[email protected]912c6452009-07-17 05:55:5126struct BreakpadInfo {
[email protected]40da3e0c2012-10-24 22:03:3827 int fd; // File descriptor to the Breakpad dump data.
[email protected]a05245a12012-02-26 23:53:2428 const char* filename; // Path to the Breakpad dump data.
[email protected]a83291d62012-08-23 14:39:4529#if defined(ADDRESS_SANITIZER)
30 const char* log_filename; // Path to the ASan log file.
31 const char* asan_report_str; // ASan report.
32 unsigned asan_report_length; // Length of |asan_report_length|.
33#endif
[email protected]a05245a12012-02-26 23:53:2434 const char* process_type; // Process type, e.g. "renderer".
35 unsigned process_type_length; // Length of |process_type|.
36 const char* crash_url; // Active URL in the crashing process.
37 unsigned crash_url_length; // Length of |crash_url|.
38 const char* guid; // Client ID.
39 unsigned guid_length; // Length of |guid|.
40 const char* distro; // Linux distro string.
41 unsigned distro_length; // Length of |distro|.
42 bool upload; // Whether to upload or save crash dump.
43 uint64_t process_start_time; // Uptime of the crashing process.
[email protected]6a033592012-03-23 00:08:5444 size_t oom_size; // Amount of memory requested if OOM.
[email protected]6653c192012-04-10 22:52:4445 uint64_t pid; // PID where applicable.
[email protected]912c6452009-07-17 05:55:5146};
47
[email protected]a05245a12012-02-26 23:53:2448extern void HandleCrashDump(const BreakpadInfo& info);
[email protected]abaa71c2009-07-28 01:18:3549
[email protected]1602cde2012-06-26 15:09:1250#endif // CHROME_APP_BREAKPAD_LINUX_H_