• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 //    * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //    * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 //    * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // ---------------------------------------------------------------------------
31 //
32 // This file was generated by the CEF translator tool and should not edited
33 // by hand. See the translator.README.txt file in the tools directory for
34 // more information.
35 //
36 // $hash=0460e68eb7d1b1188706c42d14beafbf9a6f7126$
37 //
38 
39 #ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
40 #define CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
41 #pragma once
42 
43 #include "include/capi/cef_base_capi.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 ///
50 // Crash reporting is configured using an INI-style config file named
51 // "crash_reporter.cfg". On Windows and Linux this file must be placed next to
52 // the main application executable. On macOS this file must be placed in the
53 // top-level app bundle Resources directory (e.g.
54 // "<appname>.app/Contents/Resources"). File contents are as follows:
55 //
56 //  # Comments start with a hash character and must be on their own line.
57 //
58 //  [Config]
59 //  ProductName=<Value of the "prod" crash key; defaults to "cef">
60 //  ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
61 //  AppName=<Windows only; App-specific folder name component for storing crash
62 //           information; default to "CEF">
63 //  ExternalHandler=<Windows only; Name of the external handler exe to use
64 //                   instead of re-launching the main exe; default to empty>
65 //  BrowserCrashForwardingEnabled=<macOS only; True if browser process crashes
66 //                                 should be forwarded to the system crash
67 //                                 reporter; default to false>
68 //  ServerURL=<crash server URL; default to empty>
69 //  RateLimitEnabled=<True if uploads should be rate limited; default to true>
70 //  MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled;
71 //                    default to 5>
72 //  MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value
73 //                       will cause older reports to be deleted; default to 20>
74 //  MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted;
75 //                        default to 5>
76 //
77 //  [CrashKeys]
78 //  my_key1=<small|medium|large>
79 //  my_key2=<small|medium|large>
80 //
81 // Config section:
82 //
83 // If "ProductName" and/or "ProductVersion" are set then the specified values
84 // will be included in the crash dump metadata. On macOS if these values are set
85 // to NULL then they will be retrieved from the Info.plist file using the
86 // "CFBundleName" and "CFBundleShortVersionString" keys respectively.
87 //
88 // If "AppName" is set on Windows then crash report information (metrics,
89 // database and dumps) will be stored locally on disk under the
90 // "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other
91 // platforms the CefSettings.user_data_path value will be used.
92 //
93 // If "ExternalHandler" is set on Windows then the specified exe will be
94 // launched as the crashpad-handler instead of re-launching the main process
95 // exe. The value can be an absolute path or a path relative to the main exe
96 // directory. On Linux the CefSettings.browser_subprocess_path value will be
97 // used. On macOS the existing subprocess app bundle will be used.
98 //
99 // If "BrowserCrashForwardingEnabled" is set to true (1) on macOS then browser
100 // process crashes will be forwarded to the system crash reporter. This results
101 // in the crash UI dialog being displayed to the user and crash reports being
102 // logged under "~/Library/Logs/DiagnosticReports". Forwarding of crash reports
103 // from non-browser processes and Debug builds is always disabled.
104 //
105 // If "ServerURL" is set then crashes will be uploaded as a multi-part POST
106 // request to the specified URL. Otherwise, reports will only be stored locally
107 // on disk.
108 //
109 // If "RateLimitEnabled" is set to true (1) then crash report uploads will be
110 // rate limited as follows:
111 //  1. If "MaxUploadsPerDay" is set to a positive value then at most the
112 //     specified number of crashes will be uploaded in each 24 hour period.
113 //  2. If crash upload fails due to a network or server error then an
114 //     incremental backoff delay up to a maximum of 24 hours will be applied for
115 //     retries.
116 //  3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the
117 //     "MaxUploadsPerDay" value will be reduced to 1 until the client is
118 //     restarted. This helps to avoid an upload flood when the network or
119 //     server error is resolved.
120 // Rate limiting is not supported on Linux.
121 //
122 // If "MaxDatabaseSizeInMb" is set to a positive value then crash report storage
123 // on disk will be limited to that size in megabytes. For example, on Windows
124 // each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 equates to
125 // about 34 crash reports stored on disk. Not supported on Linux.
126 //
127 // If "MaxDatabaseAgeInDays" is set to a positive value then crash reports older
128 // than the specified age in days will be deleted. Not supported on Linux.
129 //
130 // CrashKeys section:
131 //
132 // A maximum of 26 crash keys of each size can be specified for use by the
133 // application. Crash key values will be truncated based on the specified size
134 // (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of
135 // crash keys can be set from any thread or process using the
136 // CefSetCrashKeyValue function. These key/value pairs will be sent to the crash
137 // server along with the crash dump file.
138 ///
139 CEF_EXPORT int cef_crash_reporting_enabled();
140 
141 ///
142 // Sets or clears a specific key-value pair from the crash metadata.
143 ///
144 CEF_EXPORT void cef_set_crash_key_value(const cef_string_t* key,
145                                         const cef_string_t* value);
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif  // CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
152