Adding WebRTC log upload list under chrome://webrtc-logs
[chromium-blink-merge.git] / chrome / app / breakpad_linux_impl.h
blobf9c9d923b3eab4e9a9a55d8d067d6f03adfe7b33
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Internal header file for the Linux breakpad implementation. This file is
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.
9 #ifndef CHROME_APP_BREAKPAD_LINUX_IMPL_H_
10 #define CHROME_APP_BREAKPAD_LINUX_IMPL_H_
12 #include <sys/types.h>
14 #include "base/basictypes.h"
15 #include "breakpad/src/common/simple_string_dictionary.h"
16 #include "chrome/app/breakpad_linux.h"
18 typedef google_breakpad::NonAllocatingMap<256, 256, 64> CrashKeyStorage;
20 static const size_t kMaxActiveURLSize = 1024;
21 static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex.
22 static const size_t kDistroSize = 128;
23 #if defined(ADDRESS_SANITIZER)
24 static const size_t kMaxAsanReportSize = 1 << 16;
25 #endif
26 // Define a preferred limit on minidump sizes, because Crash Server currently
27 // throws away any larger than 1.2MB (1.2 * 1024 * 1024). A value of -1 means
28 // no limit.
29 static const off_t kMaxMinidumpFileSize = 1258291;
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
40 // BreakpadInfo describes a crash report.
41 // The minidump information can either be contained in a file descriptor (fd) or
42 // in a file (whose path is in filename).
43 struct BreakpadInfo {
44 int fd; // File descriptor to the Breakpad dump data.
45 const char* filename; // Path to the Breakpad dump data.
46 #if defined(ADDRESS_SANITIZER)
47 const char* log_filename; // Path to the ASan log file.
48 const char* asan_report_str; // ASan report.
49 unsigned asan_report_length; // Length of |asan_report_length|.
50 #endif
51 const char* process_type; // Process type, e.g. "renderer".
52 unsigned process_type_length; // Length of |process_type|.
53 const char* crash_url; // Active URL in the crashing process.
54 unsigned crash_url_length; // Length of |crash_url|.
55 const char* guid; // Client ID.
56 unsigned guid_length; // Length of |guid|.
57 const char* distro; // Linux distro string.
58 unsigned distro_length; // Length of |distro|.
59 bool upload; // Whether to upload or save crash dump.
60 uint64_t process_start_time; // Uptime of the crashing process.
61 size_t oom_size; // Amount of memory requested if OOM.
62 uint64_t pid; // PID where applicable.
63 CrashKeyStorage* crash_keys;
66 extern void HandleCrashDump(const BreakpadInfo& info);
68 #endif // CHROME_APP_BREAKPAD_LINUX_IMPL_H_