OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_APP_BREAKPAD_LINUX_H_ | 5 // Internal header file for the Linux breakpad implementation. This file is |
6 #define CHROME_APP_BREAKPAD_LINUX_H_ | 6 // shared between crash_handler_host_linux.cc and breakpad_linux.cc. It should |
| 7 // only be used in files compiled with linux_breakpad=1. |
| 8 |
| 9 #ifndef CHROME_APP_BREAKPAD_LINUX_IMPL_H_ |
| 10 #define CHROME_APP_BREAKPAD_LINUX_IMPL_H_ |
7 | 11 |
8 #include <sys/types.h> | 12 #include <sys/types.h> |
9 | 13 |
10 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "breakpad/src/common/simple_string_dictionary.h" |
| 16 #include "chrome/app/breakpad_linux.h" |
11 | 17 |
12 extern void InitCrashReporter(); | 18 typedef google_breakpad::NonAllocatingMap<256, 256, 64> CrashKeyStorage; |
13 #if defined(OS_ANDROID) | |
14 extern void InitNonBrowserCrashReporterForAndroid(); | |
15 #endif | |
16 bool IsCrashReporterEnabled(); | |
17 | 19 |
18 static const size_t kMaxActiveURLSize = 1024; | 20 static const size_t kMaxActiveURLSize = 1024; |
19 static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex. | 21 static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex. |
20 static const size_t kDistroSize = 128; | 22 static const size_t kDistroSize = 128; |
21 #if defined(ADDRESS_SANITIZER) | 23 #if defined(ADDRESS_SANITIZER) |
22 static const size_t kMaxAsanReportSize = 1 << 16; | 24 static const size_t kMaxAsanReportSize = 1 << 16; |
23 #endif | 25 #endif |
24 // Define a preferred limit on minidump sizes, because Crash Server currently | 26 // 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 | 27 // throws away any larger than 1.2MB (1.2 * 1024 * 1024). A value of -1 means |
26 // no limit. | 28 // no limit. |
27 static const off_t kMaxMinidumpFileSize = 1258291; | 29 static const off_t kMaxMinidumpFileSize = 1258291; |
28 | 30 |
| 31 // The size of the iovec used to transfer crash data from a child back to the |
| 32 // browser. |
| 33 #if !defined(ADDRESS_SANITIZER) |
| 34 const size_t kCrashIovSize = 9; |
| 35 #else |
| 36 // Additional field to pass the AddressSanitizer log to the crash handler. |
| 37 const size_t kCrashIovSize = 10; |
| 38 #endif |
| 39 |
29 // BreakpadInfo describes a crash report. | 40 // BreakpadInfo describes a crash report. |
30 // The minidump information can either be contained in a file descriptor (fd) or | 41 // The minidump information can either be contained in a file descriptor (fd) or |
31 // in a file (whose path is in filename). | 42 // in a file (whose path is in filename). |
32 struct BreakpadInfo { | 43 struct BreakpadInfo { |
33 int fd; // File descriptor to the Breakpad dump data. | 44 int fd; // File descriptor to the Breakpad dump data. |
34 const char* filename; // Path to the Breakpad dump data. | 45 const char* filename; // Path to the Breakpad dump data. |
35 #if defined(ADDRESS_SANITIZER) | 46 #if defined(ADDRESS_SANITIZER) |
36 const char* log_filename; // Path to the ASan log file. | 47 const char* log_filename; // Path to the ASan log file. |
37 const char* asan_report_str; // ASan report. | 48 const char* asan_report_str; // ASan report. |
38 unsigned asan_report_length; // Length of |asan_report_length|. | 49 unsigned asan_report_length; // Length of |asan_report_length|. |
39 #endif | 50 #endif |
40 const char* process_type; // Process type, e.g. "renderer". | 51 const char* process_type; // Process type, e.g. "renderer". |
41 unsigned process_type_length; // Length of |process_type|. | 52 unsigned process_type_length; // Length of |process_type|. |
42 const char* crash_url; // Active URL in the crashing process. | 53 const char* crash_url; // Active URL in the crashing process. |
43 unsigned crash_url_length; // Length of |crash_url|. | 54 unsigned crash_url_length; // Length of |crash_url|. |
44 const char* guid; // Client ID. | 55 const char* guid; // Client ID. |
45 unsigned guid_length; // Length of |guid|. | 56 unsigned guid_length; // Length of |guid|. |
46 const char* distro; // Linux distro string. | 57 const char* distro; // Linux distro string. |
47 unsigned distro_length; // Length of |distro|. | 58 unsigned distro_length; // Length of |distro|. |
48 bool upload; // Whether to upload or save crash dump. | 59 bool upload; // Whether to upload or save crash dump. |
49 uint64_t process_start_time; // Uptime of the crashing process. | 60 uint64_t process_start_time; // Uptime of the crashing process. |
50 size_t oom_size; // Amount of memory requested if OOM. | 61 size_t oom_size; // Amount of memory requested if OOM. |
51 uint64_t pid; // PID where applicable. | 62 uint64_t pid; // PID where applicable. |
| 63 CrashKeyStorage* crash_keys; |
52 }; | 64 }; |
53 | 65 |
54 extern void HandleCrashDump(const BreakpadInfo& info); | 66 extern void HandleCrashDump(const BreakpadInfo& info); |
55 | 67 |
56 #endif // CHROME_APP_BREAKPAD_LINUX_H_ | 68 #endif // CHROME_APP_BREAKPAD_LINUX_IMPL_H_ |
OLD | NEW |