OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 5 #ifndef COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ |
6 #define COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 6 #define COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ |
7 | 7 |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
| 18 #include "components/crash/content/app/breakpad_linux_impl.h" |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class Thread; | 21 class Thread; |
21 } | 22 } |
22 | 23 |
23 namespace breakpad { | 24 namespace breakpad { |
24 | 25 |
25 struct BreakpadInfo; | 26 struct BreakpadInfo; |
26 | 27 |
27 // This is the host for processes which run breakpad inside the sandbox on | 28 // This is the host for processes which run breakpad inside the sandbox on |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 65 |
65 // Do work in a sequenced worker pool for OnFileCanReadWithoutBlocking(). | 66 // Do work in a sequenced worker pool for OnFileCanReadWithoutBlocking(). |
66 void WriteDumpFile(std::unique_ptr<BreakpadInfo> info, | 67 void WriteDumpFile(std::unique_ptr<BreakpadInfo> info, |
67 std::unique_ptr<char[]> crash_context, | 68 std::unique_ptr<char[]> crash_context, |
68 pid_t crashing_pid, | 69 pid_t crashing_pid, |
69 int signal_fd); | 70 int signal_fd); |
70 | 71 |
71 // Continue OnFileCanReadWithoutBlocking()'s work on the IO thread. | 72 // Continue OnFileCanReadWithoutBlocking()'s work on the IO thread. |
72 void QueueCrashDumpTask(std::unique_ptr<BreakpadInfo> info, int signal_fd); | 73 void QueueCrashDumpTask(std::unique_ptr<BreakpadInfo> info, int signal_fd); |
73 | 74 |
| 75 // Find crashing thread (may delay and retry) and dump on IPC thread. |
| 76 void FindCrashingThreadAndDump(pid_t crashing_pid, |
| 77 const std::string& expected_syscall_data, |
| 78 std::unique_ptr<char[]> crash_context, |
| 79 std::unique_ptr<CrashKeyStorage> crash_keys, |
| 80 #if defined(ADDRESS_SANITIZER) |
| 81 std::unique_ptr<char[]> asan_report, |
| 82 #endif |
| 83 uint64_t uptime, |
| 84 size_t oom_size, |
| 85 int signal_fd, |
| 86 int attempt); |
| 87 |
74 std::string process_type_; | 88 std::string process_type_; |
75 base::FilePath dumps_path_; | 89 base::FilePath dumps_path_; |
76 #if !defined(OS_ANDROID) | 90 #if !defined(OS_ANDROID) |
77 bool upload_; | 91 bool upload_; |
78 #endif | 92 #endif |
79 | 93 |
80 int process_socket_; | 94 int process_socket_; |
81 int browser_socket_; | 95 int browser_socket_; |
82 | 96 |
83 base::MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; | 97 base::MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; |
84 std::unique_ptr<base::Thread> uploader_thread_; | 98 std::unique_ptr<base::Thread> uploader_thread_; |
85 bool shutting_down_; | 99 bool shutting_down_; |
86 | 100 |
87 // Unique sequence token so that writing crash dump won't be blocked | 101 // Unique sequence token so that writing crash dump won't be blocked |
88 // by other tasks. | 102 // by other tasks. |
89 base::SequencedWorkerPool::SequenceToken worker_pool_token_; | 103 base::SequencedWorkerPool::SequenceToken worker_pool_token_; |
90 | 104 |
91 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); | 105 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); |
92 }; | 106 }; |
93 | 107 |
94 } // namespace breakpad | 108 } // namespace breakpad |
95 | 109 |
96 #endif // COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 110 #endif // COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ |
OLD | NEW |