[email protected] | a05245a1 | 2012-02-26 23:53:24 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 9a5d2a5 | 2009-05-22 03:37:45 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 1602cde | 2012-06-26 15:09:12 | [diff] [blame] | 5 | #ifndef CHROME_APP_BREAKPAD_LINUX_H_ |
6 | #define CHROME_APP_BREAKPAD_LINUX_H_ | ||||
[email protected] | 9a5d2a5 | 2009-05-22 03:37:45 | [diff] [blame] | 7 | |
[email protected] | c7b1d2f | 2010-12-03 03:33:13 | [diff] [blame] | 8 | #include "base/basictypes.h" |
[email protected] | 9169e6a9 | 2009-09-28 18:39:54 | [diff] [blame] | 9 | |
[email protected] | 1e7377d | 2009-05-28 20:23:06 | [diff] [blame] | 10 | extern void InitCrashReporter(); |
[email protected] | 40da3e0c | 2012-10-24 22:03:38 | [diff] [blame^] | 11 | #if defined(OS_ANDROID) |
12 | extern void InitNonBrowserCrashReporterForAndroid(int minidump_fd); | ||||
13 | #endif | ||||
[email protected] | b8d6ae1 | 2009-12-10 02:02:20 | [diff] [blame] | 14 | bool IsCrashReporterEnabled(); |
[email protected] | 2eb41e7 | 2009-07-15 23:07:34 | [diff] [blame] | 15 | |
[email protected] | 4cc7027 | 2009-08-14 00:02:04 | [diff] [blame] | 16 | static const size_t kMaxActiveURLSize = 1024; |
17 | static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex. | ||||
18 | static const size_t kDistroSize = 128; | ||||
[email protected] | a83291d6 | 2012-08-23 14:39:45 | [diff] [blame] | 19 | #if defined(ADDRESS_SANITIZER) |
20 | static const size_t kMaxAsanReportSize = 1 << 16; | ||||
21 | #endif | ||||
[email protected] | 2eb41e7 | 2009-07-15 23:07:34 | [diff] [blame] | 22 | |
[email protected] | 40da3e0c | 2012-10-24 22:03:38 | [diff] [blame^] | 23 | // 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] | 912c645 | 2009-07-17 05:55:51 | [diff] [blame] | 26 | struct BreakpadInfo { |
[email protected] | 40da3e0c | 2012-10-24 22:03:38 | [diff] [blame^] | 27 | int fd; // File descriptor to the Breakpad dump data. |
[email protected] | a05245a1 | 2012-02-26 23:53:24 | [diff] [blame] | 28 | const char* filename; // Path to the Breakpad dump data. |
[email protected] | a83291d6 | 2012-08-23 14:39:45 | [diff] [blame] | 29 | #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] | a05245a1 | 2012-02-26 23:53:24 | [diff] [blame] | 34 | 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] | 6a03359 | 2012-03-23 00:08:54 | [diff] [blame] | 44 | size_t oom_size; // Amount of memory requested if OOM. |
[email protected] | 6653c19 | 2012-04-10 22:52:44 | [diff] [blame] | 45 | uint64_t pid; // PID where applicable. |
[email protected] | 912c645 | 2009-07-17 05:55:51 | [diff] [blame] | 46 | }; |
47 | |||||
[email protected] | a05245a1 | 2012-02-26 23:53:24 | [diff] [blame] | 48 | extern void HandleCrashDump(const BreakpadInfo& info); |
[email protected] | abaa71c | 2009-07-28 01:18:35 | [diff] [blame] | 49 | |
[email protected] | 1602cde | 2012-06-26 15:09:12 | [diff] [blame] | 50 | #endif // CHROME_APP_BREAKPAD_LINUX_H_ |