OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ | 5 #ifndef CHROME_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ |
6 #define CHROME_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ | 6 #define CHROME_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "breakpad/src/client/windows/crash_generation/crash_generation_server.h
" |
14 | 15 |
15 namespace google_breakpad { | 16 namespace google_breakpad { |
16 | 17 |
17 class CrashReportSender; | 18 class CrashReportSender; |
18 class CrashGenerationServer; | |
19 class ClientInfo; | 19 class ClientInfo; |
20 | 20 |
21 } | 21 } |
22 | 22 |
23 // This class implements an out-of-process crash server. It uses breakpad's | 23 // This class implements an out-of-process crash server. It uses breakpad's |
24 // CrashGenerationServer and CrashReportSender to generate and then send the | 24 // CrashGenerationServer and CrashReportSender to generate and then send the |
25 // crash dumps. Internally, it uses OS specific pipe to allow applications to | 25 // crash dumps. Internally, it uses OS specific pipe to allow applications to |
26 // register for crash dumps and later on when a registered application crashes | 26 // register for crash dumps and later on when a registered application crashes |
27 // it will signal an event that causes this code to wake up and perform a | 27 // it will signal an event that causes this code to wake up and perform a |
28 // crash dump on the signaling process. The dump is then stored on disk and | 28 // crash dump on the signaling process. The dump is then stored on disk and |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // return value is a good number to pass in ExitProcess(). | 82 // return value is a good number to pass in ExitProcess(). |
83 int ProcessingLoop(); | 83 int ProcessingLoop(); |
84 | 84 |
85 private: | 85 private: |
86 static void OnClientConnected(void* context, | 86 static void OnClientConnected(void* context, |
87 const google_breakpad::ClientInfo* client_info); | 87 const google_breakpad::ClientInfo* client_info); |
88 | 88 |
89 static void OnClientDumpRequest( | 89 static void OnClientDumpRequest( |
90 void* context, | 90 void* context, |
91 const google_breakpad::ClientInfo* client_info, | 91 const google_breakpad::ClientInfo* client_info, |
| 92 const google_breakpad::CrashGenerationServer::ClientDumpRequestType |
| 93 request_type, |
92 const std::wstring* file_path); | 94 const std::wstring* file_path); |
93 | 95 |
94 static void OnClientExited(void* context, | 96 static void OnClientExited(void* context, |
95 const google_breakpad::ClientInfo* client_info); | 97 const google_breakpad::ClientInfo* client_info); |
96 | 98 |
97 // This routine sends the crash dump to the server. It takes the sending_ | 99 // This routine sends the crash dump to the server. It takes the sending_ |
98 // lock when it is performing the send. | 100 // lock when it is performing the send. |
99 static unsigned long __stdcall AsyncSendDump(void* context); | 101 static unsigned long __stdcall AsyncSendDump(void* context); |
100 | 102 |
101 // Returns the security descriptor which access to low integrity processes | 103 // Returns the security descriptor which access to low integrity processes |
(...skipping 13 matching lines...) Expand all Loading... |
115 int requests_handled_; | 117 int requests_handled_; |
116 int requests_sent_; | 118 int requests_sent_; |
117 volatile long clients_connected_; | 119 volatile long clients_connected_; |
118 volatile long clients_terminated_; | 120 volatile long clients_terminated_; |
119 base::Lock sending_; | 121 base::Lock sending_; |
120 | 122 |
121 DISALLOW_COPY_AND_ASSIGN(CrashService); | 123 DISALLOW_COPY_AND_ASSIGN(CrashService); |
122 }; | 124 }; |
123 | 125 |
124 #endif // CHROME_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ | 126 #endif // CHROME_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ |
OLD | NEW |