Skip to content

Commit b72b6f7

Browse files
committed
Example projects - Remove workaround for crash reporting spawning man app exe and switch to using crash_reporter.cfg
1 parent 454be3c commit b72b6f7

File tree

9 files changed

+90
-32
lines changed

9 files changed

+90
-32
lines changed

CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
<ItemGroup>
9090
<None Include="app.config" />
9191
<None Include="app.manifest" />
92+
<None Include="crash_reporter.cfg">
93+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
94+
</None>
9295
<None Include="packages.config" />
9396
</ItemGroup>
9497
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

CefSharp.OffScreen.Example/Program.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@ public class Program
2020

2121
public static int Main(string[] args)
2222
{
23-
//Until https://bitbucket.org/chromiumembedded/cef/issues/1995/ is resolved it's nessicary to
24-
//deal with the spawning of the crashpad process here as it's not possible to configure which exe it uses
25-
var exitCode = Cef.ExecuteProcess();
26-
27-
//crashpadHandlerExitCode will be -1 for normal process execution, only when running as a subprocess will it be greater
28-
if (exitCode >= 0)
29-
{
30-
return exitCode;
31-
}
32-
3323
Console.WriteLine("This example application will load {0}, take a screenshot, and save it to your desktop.", TestUrl);
3424
Console.WriteLine("You may see a lot of Chromium debugging output, please wait...");
3525
Console.WriteLine();
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Crash reporting is configured using an INI-style config file named
2+
# "crash_reporter.cfg". This file must be placed next to
3+
# the main application executable.
4+
# Comments start with a hash character and must be on their own line.
5+
6+
#[Config]
7+
#ProductName=<Value of the "prod" crash key; defaults to "cef">
8+
#ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
9+
#AppName=<Windows only; App-specific folder name component for storing crash information; default to "CEF">
10+
#ExternalHandler=<Windows only; Name of the external handler exe to use instead of re-launching the main exe; default to empty>
11+
12+
#ServerURL=<crash server URL; default to empty>
13+
#RateLimitEnabled=<True if uploads should be rate limited; default to true>
14+
#MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled; default to 5>
15+
#MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value will cause older reports to be deleted; default to 20>
16+
#MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted; default to 5>
17+
18+
#[CrashKeys]
19+
#my_key1=<small|medium|large>
20+
#my_key2=<small|medium|large>
21+
22+
23+
[Config]
24+
ProductName=CefSharp
25+
ProductVersion=55.0.0
26+
AppName=CefSharp
27+
ExternalHandler=CefSharp.BrowserSubprocess.exe

CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@
146146
<ItemGroup>
147147
<None Include="app.config" />
148148
<None Include="app.manifest" />
149+
<None Include="crash_reporter.cfg">
150+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
151+
</None>
149152
<None Include="packages.config" />
150153
<None Include="Resources\nav_left_green.png" />
151154
</ItemGroup>

CefSharp.WinForms.Example/Program.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@ public static int Main(string[] args)
2020
{
2121
const bool simpleSubProcess = false;
2222

23-
//Until https://bitbucket.org/chromiumembedded/cef/issues/1995/ is resolved it's nessicary to
24-
//deal with the spawning of the crashpad process here as it's not possible to configure which exe it uses
25-
//When running from within VS and using the vshost process you'll see an error in the log and this won't get called.
26-
var crashpadHandlerExitCode = Cef.ExecuteProcess();
27-
28-
//crashpadHandlerExitCode will be -1 for normal process execution, only when running as a subprocess will it be greater
29-
if (crashpadHandlerExitCode >= 0)
30-
{
31-
return crashpadHandlerExitCode;
32-
}
33-
3423
Cef.EnableHighDPISupport();
3524

3625
//NOTE: Using a simple sub processes uses your existing application executable to spawn instances of the sub process.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Crash reporting is configured using an INI-style config file named
2+
# "crash_reporter.cfg". This file must be placed next to
3+
# the main application executable.
4+
# Comments start with a hash character and must be on their own line.
5+
6+
#[Config]
7+
#ProductName=<Value of the "prod" crash key; defaults to "cef">
8+
#ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
9+
#AppName=<Windows only; App-specific folder name component for storing crash information; default to "CEF">
10+
#ExternalHandler=<Windows only; Name of the external handler exe to use instead of re-launching the main exe; default to empty>
11+
12+
#ServerURL=<crash server URL; default to empty>
13+
#RateLimitEnabled=<True if uploads should be rate limited; default to true>
14+
#MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled; default to 5>
15+
#MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value will cause older reports to be deleted; default to 20>
16+
#MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted; default to 5>
17+
18+
#[CrashKeys]
19+
#my_key1=<small|medium|large>
20+
#my_key2=<small|medium|large>
21+
22+
23+
[Config]
24+
ProductName=CefSharp
25+
ProductVersion=55.0.0
26+
AppName=CefSharp
27+
ExternalHandler=CefSharp.BrowserSubprocess.exe

CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@
155155
<ItemGroup>
156156
<None Include="app.config" />
157157
<None Include="app.manifest" />
158+
<None Include="crash_reporter.cfg">
159+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
160+
</None>
158161
<None Include="packages.config" />
159162
</ItemGroup>
160163
<ItemGroup>

CefSharp.Wpf.Example/Program.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ public static class Program
1111
[STAThread]
1212
public static int Main(string[] args)
1313
{
14-
//Until https://bitbucket.org/chromiumembedded/cef/issues/1995/ is resolved it's nessicary to
15-
//deal with the spawning of the crashpad process here as it's not possible to configure which exe it uses
16-
//When running from within VS and using the vshost process you'll see an error in the log and this won't get called.
17-
var crashpadHandlerExitCode = Cef.ExecuteProcess();
18-
19-
//crashpadHandlerExitCode will be -1 for normal process execution, only when running as a subprocess will it be greater
20-
if (crashpadHandlerExitCode >= 0)
21-
{
22-
return crashpadHandlerExitCode;
23-
}
24-
2514
var application = new App();
2615
application.InitializeComponent();
2716
return application.Run();
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Crash reporting is configured using an INI-style config file named
2+
# "crash_reporter.cfg". This file must be placed next to
3+
# the main application executable.
4+
# Comments start with a hash character and must be on their own line.
5+
6+
#[Config]
7+
#ProductName=<Value of the "prod" crash key; defaults to "cef">
8+
#ProductVersion=<Value of the "ver" crash key; defaults to the CEF version>
9+
#AppName=<Windows only; App-specific folder name component for storing crash information; default to "CEF">
10+
#ExternalHandler=<Windows only; Name of the external handler exe to use instead of re-launching the main exe; default to empty>
11+
12+
#ServerURL=<crash server URL; default to empty>
13+
#RateLimitEnabled=<True if uploads should be rate limited; default to true>
14+
#MaxUploadsPerDay=<Max uploads per 24 hours, used if rate limit is enabled; default to 5>
15+
#MaxDatabaseSizeInMb=<Total crash report disk usage greater than this value will cause older reports to be deleted; default to 20>
16+
#MaxDatabaseAgeInDays=<Crash reports older than this value will be deleted; default to 5>
17+
18+
#[CrashKeys]
19+
#my_key1=<small|medium|large>
20+
#my_key2=<small|medium|large>
21+
22+
23+
[Config]
24+
ProductName=CefSharp
25+
ProductVersion=55.0.0
26+
AppName=CefSharp
27+
ExternalHandler=CefSharp.BrowserSubprocess.exe

0 commit comments

Comments
 (0)