OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Public interface for enabling Breakpad on Linux systems. This can be | |
6 // included in files that are not built with linux_breakpad=1. | |
7 | |
5 #ifndef CHROME_APP_BREAKPAD_LINUX_H_ | 8 #ifndef CHROME_APP_BREAKPAD_LINUX_H_ |
6 #define CHROME_APP_BREAKPAD_LINUX_H_ | 9 #define CHROME_APP_BREAKPAD_LINUX_H_ |
7 | 10 |
8 #include <sys/types.h> | 11 #include "build/build_config.h" |
9 | 12 |
10 #include "base/basictypes.h" | 13 // Turns on the crash reporter in any process. |
14 extern void InitCrashReporter(); | |
11 | 15 |
12 extern void InitCrashReporter(); | 16 // Enables the crash reporter in child proceseses. |
Lei Zhang
2013/05/28 22:02:24
nit: typo
Robert Sesek
2013/05/29 18:39:45
Done.
| |
13 #if defined(OS_ANDROID) | 17 #if defined(OS_ANDROID) |
14 extern void InitNonBrowserCrashReporterForAndroid(); | 18 extern void InitNonBrowserCrashReporterForAndroid(); |
15 #endif | 19 #endif |
20 | |
21 // Checks if crash reporting is enabled. Note that this is not the same as | |
22 // being opted into metrics reporting (and crash reporting), which controls | |
23 // whether InitCrashReporter() is called. | |
16 bool IsCrashReporterEnabled(); | 24 bool IsCrashReporterEnabled(); |
17 | 25 |
18 static const size_t kMaxActiveURLSize = 1024; | |
19 static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex. | |
20 static const size_t kDistroSize = 128; | |
21 #if defined(ADDRESS_SANITIZER) | |
22 static const size_t kMaxAsanReportSize = 1 << 16; | |
23 #endif | |
24 // Define a preferred limit on minidump sizes, because Crash Server currently | |
25 // throws away any larger than 1.2MB (1.2 * 1024 * 1024). A value of -1 means | |
26 // no limit. | |
27 static const off_t kMaxMinidumpFileSize = 1258291; | |
28 | |
29 // BreakpadInfo describes a crash report. | |
30 // The minidump information can either be contained in a file descriptor (fd) or | |
31 // in a file (whose path is in filename). | |
32 struct BreakpadInfo { | |
33 int fd; // File descriptor to the Breakpad dump data. | |
34 const char* filename; // Path to the Breakpad dump data. | |
35 #if defined(ADDRESS_SANITIZER) | |
36 const char* log_filename; // Path to the ASan log file. | |
37 const char* asan_report_str; // ASan report. | |
38 unsigned asan_report_length; // Length of |asan_report_length|. | |
39 #endif | |
40 const char* process_type; // Process type, e.g. "renderer". | |
41 unsigned process_type_length; // Length of |process_type|. | |
42 const char* crash_url; // Active URL in the crashing process. | |
43 unsigned crash_url_length; // Length of |crash_url|. | |
44 const char* guid; // Client ID. | |
45 unsigned guid_length; // Length of |guid|. | |
46 const char* distro; // Linux distro string. | |
47 unsigned distro_length; // Length of |distro|. | |
48 bool upload; // Whether to upload or save crash dump. | |
49 uint64_t process_start_time; // Uptime of the crashing process. | |
50 size_t oom_size; // Amount of memory requested if OOM. | |
51 uint64_t pid; // PID where applicable. | |
52 }; | |
53 | |
54 extern void HandleCrashDump(const BreakpadInfo& info); | |
55 | |
56 #endif // CHROME_APP_BREAKPAD_LINUX_H_ | 26 #endif // CHROME_APP_BREAKPAD_LINUX_H_ |
OLD | NEW |