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 | 12 |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.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 | 18 |
19 namespace base { | 19 namespace base { |
20 class Thread; | 20 class Thread; |
21 } | 21 } |
22 | 22 |
23 namespace breakpad { | 23 namespace breakpad { |
24 | 24 |
25 struct BreakpadInfo; | 25 struct BreakpadInfo; |
(...skipping 30 matching lines...) Expand all Loading... |
56 // MessageLoop::DestructionObserver impl: | 56 // MessageLoop::DestructionObserver impl: |
57 void WillDestroyCurrentMessageLoop() override; | 57 void WillDestroyCurrentMessageLoop() override; |
58 | 58 |
59 // Whether we are shutting down or not. | 59 // Whether we are shutting down or not. |
60 bool IsShuttingDown() const; | 60 bool IsShuttingDown() const; |
61 | 61 |
62 private: | 62 private: |
63 void Init(); | 63 void Init(); |
64 | 64 |
65 // Do work in a sequenced worker pool for OnFileCanReadWithoutBlocking(). | 65 // Do work in a sequenced worker pool for OnFileCanReadWithoutBlocking(). |
66 void WriteDumpFile(scoped_ptr<BreakpadInfo> info, | 66 void WriteDumpFile(std::unique_ptr<BreakpadInfo> info, |
67 scoped_ptr<char[]> crash_context, | 67 std::unique_ptr<char[]> crash_context, |
68 pid_t crashing_pid, | 68 pid_t crashing_pid, |
69 int signal_fd); | 69 int signal_fd); |
70 | 70 |
71 // Continue OnFileCanReadWithoutBlocking()'s work on the IO thread. | 71 // Continue OnFileCanReadWithoutBlocking()'s work on the IO thread. |
72 void QueueCrashDumpTask(scoped_ptr<BreakpadInfo> info, int signal_fd); | 72 void QueueCrashDumpTask(std::unique_ptr<BreakpadInfo> info, int signal_fd); |
73 | 73 |
74 std::string process_type_; | 74 std::string process_type_; |
75 base::FilePath dumps_path_; | 75 base::FilePath dumps_path_; |
76 bool upload_; | 76 bool upload_; |
77 | 77 |
78 int process_socket_; | 78 int process_socket_; |
79 int browser_socket_; | 79 int browser_socket_; |
80 | 80 |
81 base::MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; | 81 base::MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; |
82 scoped_ptr<base::Thread> uploader_thread_; | 82 std::unique_ptr<base::Thread> uploader_thread_; |
83 bool shutting_down_; | 83 bool shutting_down_; |
84 | 84 |
85 // Unique sequence token so that writing crash dump won't be blocked | 85 // Unique sequence token so that writing crash dump won't be blocked |
86 // by other tasks. | 86 // by other tasks. |
87 base::SequencedWorkerPool::SequenceToken worker_pool_token_; | 87 base::SequencedWorkerPool::SequenceToken worker_pool_token_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); | 89 DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace breakpad | 92 } // namespace breakpad |
93 | 93 |
94 #endif // COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ | 94 #endif // COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_HANDLER_HOST_LINUX_H_ |
OLD | NEW |