1 : // Copyright 2015 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 :
15 : #ifndef SYZYGY_KASKO_CLIENT_H_
16 : #define SYZYGY_KASKO_CLIENT_H_
17 :
18 : #include <Windows.h>
19 :
20 : #include "base/macros.h"
21 : #include "base/strings/string16.h"
22 : #include "syzygy/kasko/minidump_type.h"
23 :
24 m : namespace kasko {
25 :
26 : // Implements the client process lifetime. Holds configuration and provides an
27 : // API for triggering a diagnostic report of the current process..
28 m : class Client {
29 m : public:
30 : // Instantiates a diagnostic reporting client.
31 : // @param endpoint_name The RPC endpoint name shared with the reporter
32 : // process.
33 m : explicit Client(const base::string16& endpoint);
34 :
35 m : ~Client();
36 :
37 : // Sends a diagnostic report for the current process.
38 : // @param exception_pointers Optional exception information.
39 : // @param minidump_type The type of minidump to be included in the report.
40 : // @param protobuf An optional protobuf to be included in the report.
41 : // @param protobuf_length The length of the protobuf.
42 : // @param keys An optional null-terminated array of crash key names
43 : // @param values An optional null-terminated array of crash key values. Must
44 : // be of equal length to |keys|.
45 m : void SendReport(const EXCEPTION_POINTERS* exception_pointers,
46 m : MinidumpType minidump_type,
47 m : const char* protobuf,
48 m : size_t protobuf_length,
49 m : const base::char16* const* keys,
50 m : const base::char16* const* values) const;
51 :
52 m : private:
53 : // The RPC endpoint name shared with the reporter process.
54 m : const base::string16 endpoint_;
55 :
56 m : DISALLOW_COPY_AND_ASSIGN(Client);
57 m : };
58 :
59 m : } // namespace kasko
60 :
61 : #endif // SYZYGY_KASKO_CLIENT_H_
|