Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: components/breakpad/tools/crash_service.h

Issue 26688006: Move CrashService class to breakpad component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 COMPONENTS_BREAKPAD_TOOLS_CRASH_SERVICE_H_
6 #define CHROME_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ 6 #define COMPONENTS_BREAKPAD_TOOLS_CRASH_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 13
14 namespace google_breakpad { 14 namespace google_breakpad {
15 15
16 class CrashReportSender; 16 class CrashReportSender;
17 class CrashGenerationServer; 17 class CrashGenerationServer;
18 class ClientInfo; 18 class ClientInfo;
19 19
20 } 20 }
21 21
22 namespace breakpad {
23
22 // 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
23 // CrashGenerationServer and CrashReportSender to generate and then send the 25 // CrashGenerationServer and CrashReportSender to generate and then send the
24 // 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
25 // 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
26 // 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
27 // 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
28 // possibly sent to the crash2 servers. 30 // possibly sent to the crash2 servers.
29 class CrashService { 31 class CrashService {
30 public: 32 public:
31 // The ctor takes a directory that needs to be writable and will create 33 explicit CrashService();
Robert Sesek 2013/10/17 13:16:05 No |explicit|
jochen (gone - plz use gerrit) 2013/10/17 16:47:39 Done.
32 // a subdirectory inside to keep logs, crashes and checkpoint files.
33 explicit CrashService(const std::wstring& report_dir);
34 ~CrashService(); 34 ~CrashService();
35 35
36 // Starts servicing crash dumps. The command_line specifies various behaviors, 36 // Starts servicing crash dumps. Returns false if it failed. Do not use
37 // see below for more information. Returns false if it failed. Do not use
38 // other members in that case. 37 // other members in that case.
39 bool Initialize(const std::wstring& command_line); 38 bool Initialize(const base::FilePath& operations_dir,
Robert Sesek 2013/10/17 13:16:05 I don't know what an |operations_dir| is… comment?
jochen (gone - plz use gerrit) 2013/10/17 16:47:39 Done.
39 const base::FilePath& report_path,
40 const base::FilePath& dumps_path);
40 41
41 // Command line switches: 42 // Command line switches:
42 // 43 //
43 // --max-reports=<number> 44 // --max-reports=<number>
44 // Allows to override the maximum number for reports per day. Normally 45 // Allows to override the maximum number for reports per day. Normally
45 // the crash dumps are never sent so if you want to send any you must 46 // the crash dumps are never sent so if you want to send any you must
46 // specify a positive number here. 47 // specify a positive number here.
47 static const char kMaxReports[]; 48 static const char kMaxReports[];
48 // --no-window 49 // --no-window
49 // Does not create a visible window on the desktop. The window does not have 50 // Does not create a visible window on the desktop. The window does not have
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // clients serviced statistics: 114 // clients serviced statistics:
114 int requests_handled_; 115 int requests_handled_;
115 int requests_sent_; 116 int requests_sent_;
116 volatile long clients_connected_; 117 volatile long clients_connected_;
117 volatile long clients_terminated_; 118 volatile long clients_terminated_;
118 base::Lock sending_; 119 base::Lock sending_;
119 120
120 DISALLOW_COPY_AND_ASSIGN(CrashService); 121 DISALLOW_COPY_AND_ASSIGN(CrashService);
121 }; 122 };
122 123
123 #endif // CHROME_TOOLS_CRASH_SERVICE_CRASH_SERVICE_H_ 124 } // namespace breakpad
125
126 #endif // COMPONENTS_BREAKPAD_TOOLS_CRASH_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698