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 uint64_t uptime, |
| 81 size_t oom_size, |
| 82 int signal_fd, |
| 83 int attempt); |
| 84 |
74 std::string process_type_; | 85 std::string process_type_; |
75 base::FilePath dumps_path_; | 86 base::FilePath dumps_path_; |
76 #if !defined(OS_ANDROID) | 87 #if !defined(OS_ANDROID) |
77 bool upload_; | 88 bool upload_; |
78 #endif | 89 #endif |
79 | 90 |
80 int process_socket_; | 91 int process_socket_; |
81 int browser_socket_; | 92 int browser_socket_; |
82 | 93 |
83 base::MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; | 94 base::MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; |
84 std::unique_ptr<base::Thread> uploader_thread_; | 95 std::unique_ptr<base::Thread> uploader_thread_; |
85 bool shutting_down_; | 96 bool shutting_down_; |
86 | 97 |
87 // Unique sequence token so that writing crash dump won't be blocked | 98 // Unique sequence token so that writing crash dump won't be blocked |
88 // by other tasks. | 99 // by other tasks. |
89 base::SequencedWorkerPool::SequenceToken worker_pool_token_; | 100 base::SequencedWorkerPool::SequenceToken worker_pool_token_; |
90 | 101 |
91 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); | 102 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); |
92 }; | 103 }; |
93 | 104 |
94 } // namespace breakpad | 105 } // namespace breakpad |
95 | 106 |
96 #endif // COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 107 #endif // COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ |
OLD | NEW |