| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 extern void InitCrashReporter(); | 10 extern void InitCrashReporter(); |
| 11 | 11 |
| 12 #if defined(USE_LINUX_BREAKPAD) | 12 #if defined(GOOGLE_CHROME_BUILD) |
| 13 static const size_t kMaxActiveURLSize = 1024; | 13 static const size_t kMaxActiveURLSize = 1024; |
| 14 static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex. | 14 static const size_t kGuidSize = 32; // 128 bits = 32 chars in hex. |
| 15 static const size_t kDistroSize = 128; | 15 static const size_t kDistroSize = 128; |
| 16 | 16 |
| 17 struct BreakpadInfo { | 17 struct BreakpadInfo { |
| 18 const char* filename; | 18 const char* filename; |
| 19 const char* process_type; | 19 const char* process_type; |
| 20 unsigned process_type_length; | 20 unsigned process_type_length; |
| 21 const char* crash_url; | 21 const char* crash_url; |
| 22 unsigned crash_url_length; | 22 unsigned crash_url_length; |
| 23 const char* guid; | 23 const char* guid; |
| 24 unsigned guid_length; | 24 unsigned guid_length; |
| 25 const char* distro; | 25 const char* distro; |
| 26 unsigned distro_length; | 26 unsigned distro_length; |
| 27 bool upload; | |
| 28 }; | 27 }; |
| 29 | 28 |
| 30 extern int HandleCrashDump(const BreakpadInfo& info); | 29 extern int UploadCrashDump(const BreakpadInfo& info); |
| 31 #endif // defined(USE_LINUX_BREAKPAD) | |
| 32 | 30 |
| 33 #if defined(GOOGLE_CHROME_BUILD) | |
| 34 // Checks that the kernel's core filename pattern is "core" and moves the | 31 // Checks that the kernel's core filename pattern is "core" and moves the |
| 35 // current working directory to a temp directory. | 32 // current working directory to a temp directory. |
| 36 // Returns true iff core dumping has been successfully enabled for the current | 33 // Returns true iff core dumping has been successfully enabled for the current |
| 37 // process. | 34 // process. |
| 38 bool EnableCoreDumping(std::string* core_dump_directory); | 35 bool EnableCoreDumping(std::string* core_dump_directory); |
| 39 // Blocks until the given child has exited. If the kernel indicates that the | 36 // Blocks until the given child has exited. If the kernel indicates that the |
| 40 // child dumped core, then the core is expected a file called "core" and is | 37 // child dumped core, then the core is expected a file called "core" and is |
| 41 // uploaded to a collection server. The core file is deleted and the given | 38 // uploaded to a collection server. The core file is deleted and the given |
| 42 // directory is removed. | 39 // directory is removed. |
| 43 void MonitorForCoreDumpsAndReport(const std::string& core_dump_directory, | 40 void MonitorForCoreDumpsAndReport(const std::string& core_dump_directory, |
| 44 const pid_t child); | 41 const pid_t child); |
| 45 | 42 |
| 46 #endif // defined(GOOGLE_CHROME_BUILD) | 43 #endif // defined(GOOGLE_CHROME_BUILD) |
| 47 | 44 |
| 48 #endif // CHROME_APP_BREAKPAD_LINUX_H_ | 45 #endif // CHROME_APP_BREAKPAD_LINUX_H_ |
| OLD | NEW |