|
| 1 | +// Copyright (c) 2016 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 | +// The contents of this file must follow a specific format in order to |
| 33 | +// support the CEF translator tool. See the translator.README.txt file in the |
| 34 | +// tools directory for more information. |
| 35 | +// |
| 36 | + |
| 37 | +#ifndef CEF_INCLUDE_CEF_CRASH_UTIL_H_ |
| 38 | +#define CEF_INCLUDE_CEF_CRASH_UTIL_H_ |
| 39 | +#pragma once |
| 40 | + |
| 41 | +/// |
| 42 | +// Crash reporting is configured using an INI-style config file named |
| 43 | +// "crash_reporter.cfg". On Windows and Linux this file must be placed next to |
| 44 | +// the main application executable. On macOS this file must be placed in the |
| 45 | +// top-level app bundle Resources directory (e.g. |
| 46 | +// "<appname>.app/Contents/Resources"). File contents are as follows: |
| 47 | +// |
| 48 | +// # Comments start with a hash character and must be on their own line. |
| 49 | +// |
| 50 | +// [Config] |
| 51 | +// ProductName=<Value of the "prod" crash key; defaults to "cef"> |
| 52 | +// ProductVersion=<Value of the "ver" crash key; defaults to the CEF version> |
| 53 | +// AppName=<Windows only; App-specific folder name component for storing crash |
| 54 | +// information; default to "CEF"> |
| 55 | +// ExternalHandler=<Windows only; Name of the external handler exe to use |
| 56 | +// instead of re-launching the main exe; default to empty> |
| 57 | +// ServerURL=<crash server URL; default to empty> |
| 58 | +// RateLimitEnabled=<True if uploads should be rate limited; default to true> |
| 59 | +// MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled; |
| 60 | +// default to 5> |
| 61 | +// MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value |
| 62 | +// will cause older reports to be deleted; default to 20> |
| 63 | +// MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted; |
| 64 | +// default to 5> |
| 65 | +// |
| 66 | +// [CrashKeys] |
| 67 | +// my_key1=<small|medium|large> |
| 68 | +// my_key2=<small|medium|large> |
| 69 | +// |
| 70 | +// Config section: |
| 71 | +// |
| 72 | +// If "ProductName" and/or "ProductVersion" are set then the specified values |
| 73 | +// will be included in the crash dump metadata. On macOS if these values are set |
| 74 | +// to empty then they will be retrieved from the Info.plist file using the |
| 75 | +// "CFBundleName" and "CFBundleShortVersionString" keys respectively. |
| 76 | +// |
| 77 | +// If "AppName" is set on Windows then crash report information (metrics, |
| 78 | +// database and dumps) will be stored locally on disk under the |
| 79 | +// "C:\Users\[CurrentUser]\AppData\Local\[AppName]\User Data" folder. On other |
| 80 | +// platforms the CefSettings.user_data_path value will be used. |
| 81 | +// |
| 82 | +// If "ExternalHandler" is set on Windows then the specified exe will be |
| 83 | +// launched as the crashpad-handler instead of re-launching the main process |
| 84 | +// exe. The value can be an absolute path or a path relative to the main exe |
| 85 | +// directory. On Linux the CefSettings.browser_subprocess_path value will be |
| 86 | +// used. On macOS the existing subprocess app bundle will be used. |
| 87 | +// |
| 88 | +// If "ServerURL" is set then crashes will be uploaded as a multi-part POST |
| 89 | +// request to the specified URL. Otherwise, reports will only be stored locally |
| 90 | +// on disk. |
| 91 | +// |
| 92 | +// If "RateLimitEnabled" is set to true then crash report uploads will be rate |
| 93 | +// limited as follows: |
| 94 | +// 1. If "MaxUploadsPerDay" is set to a positive value then at most the |
| 95 | +// specified number of crashes will be uploaded in each 24 hour period. |
| 96 | +// 2. If crash upload fails due to a network or server error then an |
| 97 | +// incremental backoff delay up to a maximum of 24 hours will be applied for |
| 98 | +// retries. |
| 99 | +// 3. If a backoff delay is applied and "MaxUploadsPerDay" is > 1 then the |
| 100 | +// "MaxUploadsPerDay" value will be reduced to 1 until the client is |
| 101 | +// restarted. This helps to avoid an upload flood when the network or |
| 102 | +// server error is resolved. |
| 103 | +// Rate limiting is not supported on Linux. |
| 104 | +// |
| 105 | +// If "MaxDatabaseSizeInMb" is set to a positive value then crash report storage |
| 106 | +// on disk will be limited to that size in megabytes. For example, on Windows |
| 107 | +// each dump is about 600KB so a "MaxDatabaseSizeInMb" value of 20 equates to |
| 108 | +// about 34 crash reports stored on disk. Not supported on Linux. |
| 109 | +// |
| 110 | +// If "MaxDatabaseAgeInDays" is set to a positive value then crash reports older |
| 111 | +// than the specified age in days will be deleted. Not supported on Linux. |
| 112 | +// |
| 113 | +// CrashKeys section: |
| 114 | +// |
| 115 | +// Any number of crash keys can be specified for use by the application. Crash |
| 116 | +// key values will be truncated based on the specified size (small = 63 bytes, |
| 117 | +// medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set |
| 118 | +// from any thread or process using the CefSetCrashKeyValue function. These |
| 119 | +// key/value pairs will be sent to the crash server along with the crash dump |
| 120 | +// file. Medium and large values will be chunked for submission. For example, |
| 121 | +// if your key is named "mykey" then the value will be broken into ordered |
| 122 | +// chunks and submitted using keys named "mykey-1", "mykey-2", etc. |
| 123 | +/// |
| 124 | +/*--cef()--*/ |
| 125 | +bool CefCrashReportingEnabled(); |
| 126 | + |
| 127 | +#include "include/cef_base.h" |
| 128 | + |
| 129 | +/// |
| 130 | +// Sets or clears a specific key-value pair from the crash metadata. |
| 131 | +/// |
| 132 | +/*--cef()--*/ |
| 133 | +void CefSetCrashKeyValue(const CefString& key, const CefString& value); |
| 134 | + |
| 135 | +#endif // CEF_INCLUDE_CEF_CRASH_UTIL_H_ |
0 commit comments