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 | |
Mark Mentovai
2011/11/21 13:49:24
Extra blank line not necessary.
| |
23 // This class implements an out-of-process crash server. It uses breakpad's | 24 // This class implements an out-of-process crash server. It uses breakpad's |
24 // CrashGenerationServer and CrashReportSender to generate and then send the | 25 // CrashGenerationServer and CrashReportSender to generate and then send the |
25 // crash dumps. Internally, it uses OS specific pipe to allow applications to | 26 // 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 | 27 // 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 | 28 // 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 | 29 // crash dump on the signaling process. The dump is then stored on disk and |
29 // possibly sent to the crash2 servers. | 30 // possibly sent to the crash2 servers. |
30 class CrashService { | 31 class CrashService { |
31 public: | 32 public: |
32 // The ctor takes a directory that needs to be writable and will create | 33 // The ctor takes a directory that needs to be writable and will create |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 // return value is a good number to pass in ExitProcess(). | 83 // return value is a good number to pass in ExitProcess(). |
83 int ProcessingLoop(); | 84 int ProcessingLoop(); |
84 | 85 |
85 private: | 86 private: |
86 static void OnClientConnected(void* context, | 87 static void OnClientConnected(void* context, |
87 const google_breakpad::ClientInfo* client_info); | 88 const google_breakpad::ClientInfo* client_info); |
88 | 89 |
89 static void OnClientDumpRequest( | 90 static void OnClientDumpRequest( |
90 void* context, | 91 void* context, |
91 const google_breakpad::ClientInfo* client_info, | 92 const google_breakpad::ClientInfo* client_info, |
93 const google_breakpad::CrashGenerationServer::ClientDumpRequestType | |
94 request_type, | |
92 const std::wstring* file_path); | 95 const std::wstring* file_path); |
93 | 96 |
94 static void OnClientExited(void* context, | 97 static void OnClientExited(void* context, |
95 const google_breakpad::ClientInfo* client_info); | 98 const google_breakpad::ClientInfo* client_info); |
96 | 99 |
97 // This routine sends the crash dump to the server. It takes the sending_ | 100 // This routine sends the crash dump to the server. It takes the sending_ |
98 // lock when it is performing the send. | 101 // lock when it is performing the send. |
99 static unsigned long __stdcall AsyncSendDump(void* context); | 102 static unsigned long __stdcall AsyncSendDump(void* context); |
100 | 103 |
101 // Returns the security descriptor which access to low integrity processes | 104 // Returns the security descriptor which access to low integrity processes |
(...skipping 13 matching lines...) Expand all Loading... | |
115 int requests_handled_; | 118 int requests_handled_; |
116 int requests_sent_; | 119 int requests_sent_; |
117 volatile long clients_connected_; | 120 volatile long clients_connected_; |
118 volatile long clients_terminated_; | 121 volatile long clients_terminated_; |
119 base::Lock sending_; | 122 base::Lock sending_; |
120 | 123 |
121 DISALLOW_COPY_AND_ASSIGN(CrashService); | 124 DISALLOW_COPY_AND_ASSIGN(CrashService); |
122 }; | 125 }; |
123 | 126 |
124 #endif // CHROME_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ | 127 #endif // CHROME_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ |
OLD | NEW |