| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_TOOLS_CRASH_SERVICE__ | 4 #ifndef CHROME_TOOLS_CRASH_SERVICE__ |
| 5 #define CHROME_TOOLS_CRASH_SERVICE__ | 5 #define CHROME_TOOLS_CRASH_SERVICE__ |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/lock.h" | 10 #include "base/lock.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 // Starts the processing loop. This function does not return unless the | 74 // Starts the processing loop. This function does not return unless the |
| 75 // user is logging off or the user closes the crash service window. The | 75 // user is logging off or the user closes the crash service window. The |
| 76 // return value is a good number to pass in ExitProcess(). | 76 // return value is a good number to pass in ExitProcess(). |
| 77 int ProcessingLoop(); | 77 int ProcessingLoop(); |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 static void OnClientConnected(void* context, | 80 static void OnClientConnected(void* context, |
| 81 const google_breakpad::ClientInfo* client_info); | 81 const google_breakpad::ClientInfo* client_info); |
| 82 | 82 |
| 83 static void OnClientDumpRequest(void* context, | 83 static void OnClientDumpRequest( |
| 84 const google_breakpad::ClientInfo* client_info
, | 84 void* context, |
| 85 const std::wstring* file_path); | 85 const google_breakpad::ClientInfo* client_info, |
| 86 const std::wstring* file_path); |
| 86 | 87 |
| 87 static void OnClientExited(void* context, | 88 static void OnClientExited(void* context, |
| 88 const google_breakpad::ClientInfo* client_info); | 89 const google_breakpad::ClientInfo* client_info); |
| 89 | 90 |
| 90 // This routine sends the crash dump to the server. It takes the sending_ | 91 // This routine sends the crash dump to the server. It takes the sending_ |
| 91 // lock when it is performing the send. | 92 // lock when it is performing the send. |
| 92 static unsigned long __stdcall AsyncSendDump(void* context); | 93 static unsigned long __stdcall AsyncSendDump(void* context); |
| 93 | 94 |
| 94 google_breakpad::CrashGenerationServer* dumper_; | 95 google_breakpad::CrashGenerationServer* dumper_; |
| 95 google_breakpad::CrashReportSender* sender_; | 96 google_breakpad::CrashReportSender* sender_; |
| 96 | 97 |
| 97 // the path to dumps and logs directory. | 98 // the path to dumps and logs directory. |
| 98 std::wstring report_path_; | 99 std::wstring report_path_; |
| 99 // the extra tag sent to the server with each dump. | 100 // the extra tag sent to the server with each dump. |
| 100 std::wstring reporter_tag_; | 101 std::wstring reporter_tag_; |
| 101 | 102 |
| 102 // clients serviced statistics: | 103 // clients serviced statistics: |
| 103 int requests_handled_; | 104 int requests_handled_; |
| 104 int requests_sent_; | 105 int requests_sent_; |
| 105 volatile long clients_connected_; | 106 volatile long clients_connected_; |
| 106 volatile long clients_terminated_; | 107 volatile long clients_terminated_; |
| 107 Lock sending_; | 108 Lock sending_; |
| 108 | 109 |
| 109 DISALLOW_EVIL_CONSTRUCTORS(CrashService); | 110 DISALLOW_EVIL_CONSTRUCTORS(CrashService); |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 | 113 |
| 113 #endif // CHROME_TOOLS_CRASH_SERVICE__ | 114 #endif // CHROME_TOOLS_CRASH_SERVICE__ |
| 114 | 115 |
| OLD | NEW |