| 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 #ifndef CHROME_APP_BREAKPAD_LINUX_H_ | 5 #ifndef CHROME_APP_BREAKPAD_LINUX_H_ |
| 6 #define CHROME_APP_BREAKPAD_LINUX_H_ | 6 #define CHROME_APP_BREAKPAD_LINUX_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 extern void InitCrashReporter(); | 10 extern void InitCrashReporter(); |
| 11 #if defined(OS_ANDROID) |
| 12 extern void InitNonBrowserCrashReporterForAndroid(int minidump_fd); |
| 13 #endif |
| 11 bool IsCrashReporterEnabled(); | 14 bool IsCrashReporterEnabled(); |
| 12 | 15 |
| 13 static const size_t kMaxActiveURLSize = 1024; | 16 static const size_t kMaxActiveURLSize = 1024; |
| 14 static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex. | 17 static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex. |
| 15 static const size_t kDistroSize = 128; | 18 static const size_t kDistroSize = 128; |
| 16 #if defined(ADDRESS_SANITIZER) | 19 #if defined(ADDRESS_SANITIZER) |
| 17 static const size_t kMaxAsanReportSize = 1 << 16; | 20 static const size_t kMaxAsanReportSize = 1 << 16; |
| 18 #endif | 21 #endif |
| 19 | 22 |
| 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). |
| 20 struct BreakpadInfo { | 26 struct BreakpadInfo { |
| 27 int fd; // File descriptor to the Breakpad dump data. |
| 21 const char* filename; // Path to the Breakpad dump data. | 28 const char* filename; // Path to the Breakpad dump data. |
| 22 #if defined(ADDRESS_SANITIZER) | 29 #if defined(ADDRESS_SANITIZER) |
| 23 const char* log_filename; // Path to the ASan log file. | 30 const char* log_filename; // Path to the ASan log file. |
| 24 const char* asan_report_str; // ASan report. | 31 const char* asan_report_str; // ASan report. |
| 25 unsigned asan_report_length; // Length of |asan_report_length|. | 32 unsigned asan_report_length; // Length of |asan_report_length|. |
| 26 #endif | 33 #endif |
| 27 const char* process_type; // Process type, e.g. "renderer". | 34 const char* process_type; // Process type, e.g. "renderer". |
| 28 unsigned process_type_length; // Length of |process_type|. | 35 unsigned process_type_length; // Length of |process_type|. |
| 29 const char* crash_url; // Active URL in the crashing process. | 36 const char* crash_url; // Active URL in the crashing process. |
| 30 unsigned crash_url_length; // Length of |crash_url|. | 37 unsigned crash_url_length; // Length of |crash_url|. |
| 31 const char* guid; // Client ID. | 38 const char* guid; // Client ID. |
| 32 unsigned guid_length; // Length of |guid|. | 39 unsigned guid_length; // Length of |guid|. |
| 33 const char* distro; // Linux distro string. | 40 const char* distro; // Linux distro string. |
| 34 unsigned distro_length; // Length of |distro|. | 41 unsigned distro_length; // Length of |distro|. |
| 35 bool upload; // Whether to upload or save crash dump. | 42 bool upload; // Whether to upload or save crash dump. |
| 36 uint64_t process_start_time; // Uptime of the crashing process. | 43 uint64_t process_start_time; // Uptime of the crashing process. |
| 37 size_t oom_size; // Amount of memory requested if OOM. | 44 size_t oom_size; // Amount of memory requested if OOM. |
| 38 uint64_t pid; // PID where applicable. | 45 uint64_t pid; // PID where applicable. |
| 39 }; | 46 }; |
| 40 | 47 |
| 41 extern void HandleCrashDump(const BreakpadInfo& info); | 48 extern void HandleCrashDump(const BreakpadInfo& info); |
| 42 | 49 |
| 43 #endif // CHROME_APP_BREAKPAD_LINUX_H_ | 50 #endif // CHROME_APP_BREAKPAD_LINUX_H_ |
| OLD | NEW |