Skip to content

Commit f375692

Browse files
committed
Merge of latest CefSharp master into the NET40 compatible branch
2 parents 5bd8f15 + 12402da commit f375692

File tree

211 files changed

+6416
-2982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+6416
-2982
lines changed

.github/FUNDING.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
99
#custom: # Replace with a single custom sponsorship URL
1010

11-
#github: amaitland
12-
patreon: alexmaitland
11+
github: amaitland
12+
#patreon: alexmaitland
1313
custom: https://paypal.me/AlexMaitland

.github/ISSUE_TEMPLATE/bug_report.md

+28-16
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,58 @@ So you have a question to ask, where can you look for answers? Read on. Think yo
1717
- You can see all the `CefSharp` tagged issues on `Stackoverflow`, some useful stuff there : http://stackoverflow.com/questions/tagged/cefsharp
1818
- You can search the `Gitter Chat Channel` for past questions/conversations, you can search through every discussion from the beginning : https://gitter.im/cefsharp/CefSharp
1919

20-
Still have a question? Great, ask it on `Gitter`. https://gitter.im/cefsharp/CefSharp
20+
Still have a question? Great, ask it on [Stackoverflow](http://stackoverflow.com/questions/tagged/cefsharp) or [Gitter](https://gitter.im/cefsharp/CefSharp). Larger complex questions should be asked on `Stackoverflow`
2121

2222
**Note: CefSharp is just a wrapper around the Chromium Embedded Project, it's worth searching http://magpcss.org/ceforum/index.php if your problem involves a low level Chromium error message**
2323

24-
We ask that you put in a reasonable amount of effort in searching through the resources listed above. The developers have full time jobs, they have lives, families, the time they have available to contribute this project is a precious resource, make sure you use it wisely! Remember the more time we spend answering the same questions over and over again, less time goes into writing code, adding new features, actually fixing bugs!
24+
We ask that you put in a reasonable amount of effort in searching through the resources listed above. The developers have full time jobs, they have lives, families, the time they have available to contribute this project is a precious resource, make sure you use it wisely! Remember the more time we spend answering the same questions over and over again, less time goes into writing code, adding new features, actually fixing bugs!
2525

2626
Still have a question to ask or unsure where to go next? Start with the Gitter Chat room : https://gitter.im/cefsharp/CefSharp
2727

28-
--
28+
Before posting a bug report please take the time to read https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/
29+
30+
---
2931
### Bug Report
3032
Delete this line and everything above, and then fill in the details below.
3133

3234
- **What version of the product are you using?**
33-
- What version are you using? Nuget? CI Nuget? build from a branch? If so which branch? Please include the exact version number you are using (no ambiguous statements like `Latest from Nuget`)
34-
e.g. 57.0.0 or 63.0.0-pre01
35-
- Please only create an issue if you can reproduce the problem with the latest version. (If you are using the latest stable release please check to see if there is a newer `-pre` release and test with that also).
35+
- What version are you using? Nuget? CI Nuget? build from a branch? If so please link to the relevant commit.
36+
- Please include the exact version number you are using e.g. 79.1.360 (no ambiguous statements like `Latest from Nuget`)
37+
- Please only create an issue if you can reproduce the problem with version 79.1.360 or greater.
3638

3739
- **What architecture x86 or x64?**
38-
40+
<x86/x64>
41+
3942
- **On what operating system?**
40-
- Win7, Win 8, Win10, etc?
43+
<Win7/Win8.1/Win10>
4144

4245
- **Are you using `WinForms`, `WPF` or `OffScreen`?**
43-
46+
<WinForms/WPF/OffScreen>
47+
4448
- **What steps will reproduce the problem?**
45-
- Please provide detailed information here, enough for someone else to reprodce your problem.
46-
- Please no binary (zip, etc) links, fork the [MinimalExample](https://github.com/cefsharp/CefSharp.MinimalExample) and push your changes to `GitHub`. (Alternatively use a code sharing service list `Gist` or `Pastebin`).
49+
- Please provide detailed information here, enough for someone else to reprodce your problem.
50+
- Does the problem reproduce using the [MinimalExample](https://github.com/cefsharp/CefSharp.MinimalExample)?
51+
- If code is required to reproduce your problem then please provide one of the following
52+
- Fork the [MinimalExample](https://github.com/cefsharp/CefSharp.MinimalExample) and push your changes to `GitHub` (this is the preferred option).
53+
- Use a code sharing service list `Gist` or `Pastebin`
54+
- Paste your **formatted code as part of this issue** (only do this for small amounts of code and make sure you **format the code so it's reabily**)
55+
- Please no binary attachments (zip, 7z, etc), code needs to be easily reviewed in a web browser.
4756

4857
- **What is the expected output? What do you see instead?**
4958

5059
- **Please provide any additional information below.**
5160
- A stack trace if available, any Exception information.
61+
- If you are seeing a crash in `libcef.dll` then please download `libcef.dll.pdb` and place it next to `libcef.dll` to obtain a detailed stack trace, see https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting#loading-native-symbols-for-easier-diagnosis for details.
5262

5363
- Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory)
5464

5565
- Any other background information that's relevant? Are you doing something out of the ordinary? 3rd party controls?
5666

57-
- **Does this problem also occur in the `CEF` Sample Application from http://opensource.spotify.com/cefbuilds/index.html?**
58-
59-
- To compare with WPF run cefclient --multi-threaded-message-loop --off-screen-rendering-enabled --enable-gpu
60-
- To compare with WinForms run cefclient --multi-threaded-message-loop
67+
- **Does this problem also occur in the `CEF` Sample Application**
68+
- Download one of the following:
69+
- For x86 download http://opensource.spotify.com/cefbuilds/cef_binary_79.1.36%2Bg90301bd%2Bchromium-79.0.3945.130_windows32_client.tar.bz2
70+
- For x64 download http://opensource.spotify.com/cefbuilds/cef_binary_79.1.36%2Bg90301bd%2Bchromium-79.0.3945.130_windows64_client.tar.bz2
71+
- If you are using WPF/OffScreen run cefclient --multi-threaded-message-loop --off-screen-rendering-enabled --enable-gpu
72+
- If you are using WinForms run cefclient --multi-threaded-message-loop
73+
- **MAKE SURE TO TEST WITH THE COMMAND LINE ARGS LISTED ABOVE**
6174
- If you can reproduce the problem with `cefclient` then you'll need to report the bug on https://bitbucket.org/chromiumembedded/cef/overview there is no point opening an issue here. (Make sure you search before opening an issue)
62-
- Please include the version you tested with e.g. `cef_binary_3.3029.1611.g44e39a8_windows64_client.tar.bz2`. It's important to you test with the same version that `CefSharp` is based on. Check the release notes to determine the version (https://github.com/cefsharp/CefSharp/releases) or load `chrome://version` in the browser.

.github/ISSUE_TEMPLATE/config.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
2+
blank_issues_enabled: false
3+
contact_links:
4+
- name: stackoverflow
5+
url: http://stackoverflow.com/questions/tagged/cefsharp
6+
about: Please ask and answer questions here.
7+
- name: Chromium Embedded Framework(CEF) Forum
8+
url: https://magpcss.org/ceforum/index.php
9+
about: Please ask your non CefSharp specific CEF questions here

.github/ISSUE_TEMPLATE/feature_request.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
22
name: Feature request
3-
about: Suggest an idea for this project
3+
about: Suggest an idea for this project, please don't use this template to ask questions, thank you.
44
title: Feature Request - My Feature
55
labels: feature-request
66
assignees: ''
77

88
---
99

10+
Please ask your questions on https://stackoverflow.com/questions/tagged/cefsharp
11+
12+
---
13+
1014
`CefSharp` is a wrapper around the [Chromium Embedded Framework](https://bitbucket.org/chromiumembedded/cef/overview) in a lot of cases a feature must be added to `CEF` first before it can be used in `CefSharp`. `CEF` has it's own `Feature Request Forum` at https://magpcss.org/ceforum/viewforum.php?f=7
1115

1216
---

.github/support.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ supportComment: >
99
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports
1010
and feature requests. However, this issue appears to be a support request.
1111
Please use our support channels to get help with the project.
12-
12+
<br/>
1313
If you have a question, ask it on [StackOverflow](http://stackoverflow.com/questions/tagged/cefsharp) or use [ceforum](http://magpcss.org/ceforum/) (for questions specific to `CEF`).
14-
14+
<br/>
1515
If you are new to `CefSharp` then we suggest you read https://github.com/cefsharp/CefSharp/wiki/General-Usage
16+
<br/>
17+
If you feel this was closed in error then you **must** edit your original issue and complete the [Bug Report Template](https://github.com/cefsharp/CefSharp/blob/master/.github/ISSUE_TEMPLATE/bug_report.md#bug-report)
18+
then post a comment asking for a review.
1619
1720
# Close issues marked as support requests
1821
close: true

.vsconfig

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": "1.0",
3+
"components": [
4+
"Microsoft.VisualStudio.Component.CoreEditor",
5+
"Microsoft.VisualStudio.Workload.CoreEditor",
6+
"Microsoft.VisualStudio.Component.NuGet",
7+
"Microsoft.Net.Component.4.6.1.TargetingPack",
8+
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
9+
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
10+
"Microsoft.Net.ComponentGroup.DevelopmentPrerequisites",
11+
"Microsoft.Component.MSBuild",
12+
"Microsoft.VisualStudio.Component.ManagedDesktop.Core",
13+
"Microsoft.Net.Component.4.5.2.TargetingPack",
14+
"Microsoft.VisualStudio.Component.IntelliCode",
15+
"Microsoft.Net.ComponentGroup.TargetingPacks.Common",
16+
"Microsoft.VisualStudio.Component.Debugger.JustInTime",
17+
"Microsoft.VisualStudio.Component.VC.CoreIde",
18+
"Microsoft.VisualStudio.Component.Windows10SDK",
19+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
20+
"Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
21+
"Microsoft.ComponentGroup.Blend",
22+
"Microsoft.VisualStudio.Workload.ManagedDesktop",
23+
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
24+
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
25+
"Microsoft.VisualStudio.Component.VC.CLI.Support",
26+
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
27+
"Microsoft.VisualStudio.Workload.NativeDesktop"
28+
]
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// Copyright © 2019 The CefSharp Authors. All rights reserved.
2+
//
3+
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4+
5+
#pragma once
6+
7+
#include "Stdafx.h"
8+
9+
#include "SubProcess.h"
10+
#include "WcfEnabledSubProcess.h"
11+
12+
using namespace System;
13+
using namespace CefSharp::Internals;
14+
15+
namespace CefSharp
16+
{
17+
namespace BrowserSubprocess
18+
{
19+
/// <summary>
20+
/// BrowserSubprocessExecutable provides the fundimental browser process handling for
21+
/// CefSharp.BrowserSubprocess.exe and can be used to self host the BrowserSubProcess in your
22+
/// existing application (preferred approach for .Net Core).
23+
/// </summary>
24+
public ref class BrowserSubprocessExecutable
25+
{
26+
public:
27+
BrowserSubprocessExecutable()
28+
{
29+
30+
}
31+
32+
/// <summary>
33+
/// This function should be called from the application entry point function (typically Program.Main)
34+
/// to execute a secondary process e.g. gpu, plugin, renderer, utility
35+
/// It can be used to run secondary processes (BrowserSubProcess) from your main applications executable
36+
/// or from a separate executable specified by the CefSettings.BrowserSubprocessPath value.
37+
/// CefSharp defaults to using the latter approach, a default implementation (CefSharp.BrowserSubProcess.exe) is
38+
/// supplied, see https://github.com/cefsharp/CefSharp/wiki/General-Usage#processes for more details.
39+
/// </summary>
40+
/// <param name="args">command line args</param>
41+
/// <returns>
42+
/// If called for the browser process (identified by no "type" command-line value) it will return immediately
43+
/// with a value of -1. If called for a recognized secondary process it will block until the process should exit
44+
/// and then return the process exit code.
45+
/// </returns
46+
int Main(IEnumerable<String^>^ args)
47+
{
48+
return Main(args, nullptr);
49+
}
50+
51+
/// <summary>
52+
/// This function should be called from the application entry point function (typically Program.Main)
53+
/// to execute a secondary process e.g. gpu, plugin, renderer, utility
54+
/// It can be used to run secondary processes (BrowserSubProcess) from your main applications executable
55+
/// or from a separate executable specified by the CefSettings.BrowserSubprocessPath value.
56+
/// CefSharp defaults to using the latter approach, a default implementation (CefSharp.BrowserSubProcess.exe) is
57+
/// supplied, see https://github.com/cefsharp/CefSharp/wiki/General-Usage#processes for more details.
58+
/// </summary>
59+
/// <param name="args">command line args</param>
60+
/// <param name="handler">An option IRenderProcessHandler implementation, use null if no handler is required</param>
61+
/// <returns>
62+
/// If called for the browser process (identified by no "type" command-line value) it will return immediately
63+
/// with a value of -1. If called for a recognized secondary process it will block until the process should exit
64+
/// and then return the process exit code.
65+
/// </returns>
66+
int Main(IEnumerable<String^>^ args, IRenderProcessHandler^ handler)
67+
{
68+
auto type = CommandLineArgsParser::GetArgumentValue(args, CefSharpArguments::SubProcessTypeArgument);
69+
70+
if (String::IsNullOrEmpty(type))
71+
{
72+
//If --type param missing from command line CEF/Chromium assums
73+
//this is the main process (as all subprocesses must have a type param).
74+
//Return -1 to indicate this behaviour.
75+
return -1;
76+
}
77+
78+
auto parentProcessId = -1;
79+
80+
// The Crashpad Handler doesn't have any HostProcessIdArgument, so we must not try to
81+
// parse it lest we want an ArgumentNullException.
82+
if (type != "crashpad-handler")
83+
{
84+
parentProcessId = int::Parse(CommandLineArgsParser::GetArgumentValue(args, CefSharpArguments::HostProcessIdArgument));
85+
if (CommandLineArgsParser::HasArgument(args, CefSharpArguments::ExitIfParentProcessClosed))
86+
{
87+
ParentProcessMonitor::StartMonitorTask(parentProcessId);
88+
}
89+
}
90+
91+
// Use our custom subProcess provides features like EvaluateJavascript
92+
if (type == "renderer")
93+
{
94+
auto subProcess = GetSubprocess(args, parentProcessId, handler);
95+
96+
try
97+
{
98+
return subProcess->Run();
99+
}
100+
finally
101+
{
102+
delete subProcess;
103+
}
104+
}
105+
106+
return SubProcess::ExecuteProcess(args);
107+
}
108+
109+
protected:
110+
virtual SubProcess^ GetSubprocess(IEnumerable<String^>^ args, int parentProcessId, IRenderProcessHandler^ handler)
111+
{
112+
return gcnew SubProcess(handler, args);
113+
}
114+
};
115+
}
116+
}

CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,15 @@ namespace CefSharp
241241
auto frames = CefListValue::Create();
242242
for (auto i = 0; i < stackTrace->GetFrameCount(); i++)
243243
{
244-
auto frame = CefListValue::Create();
244+
auto stackTraceFrame = CefListValue::Create();
245245
auto frameArg = stackTrace->GetFrame(i);
246246

247-
frame->SetString(0, frameArg->GetFunctionName());
248-
frame->SetInt(1, frameArg->GetLineNumber());
249-
frame->SetInt(2, frameArg->GetColumn());
250-
frame->SetString(3, frameArg->GetScriptNameOrSourceURL());
247+
stackTraceFrame->SetString(0, frameArg->GetFunctionName());
248+
stackTraceFrame->SetInt(1, frameArg->GetLineNumber());
249+
stackTraceFrame->SetInt(2, frameArg->GetColumn());
250+
stackTraceFrame->SetString(3, frameArg->GetScriptNameOrSourceURL());
251251

252-
frames->SetList(i, frame);
252+
frames->SetList(i, stackTraceFrame);
253253
}
254254

255255
list->SetList(1, frames);
@@ -579,8 +579,8 @@ namespace CefSharp
579579
for (auto i = 0; i < javascriptObjects->Count; i++)
580580
{
581581
auto dict = CefDictionaryValue::Create();
582-
auto name = javascriptObjects[i]->JavascriptName;
583-
dict->SetString("Name", StringUtils::ToNative(name));
582+
auto objectName = javascriptObjects[i]->JavascriptName;
583+
dict->SetString("Name", StringUtils::ToNative(objectName));
584584
dict->SetBool("IsCached", false);
585585
dict->SetBool("AlreadyBound", false);
586586

CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\cef.sdk.76.1.9\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.76.1.9\build\cef.sdk.props')" />
3+
<Import Project="..\packages\cef.sdk.79.1.36\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.79.1.36\build\cef.sdk.props')" />
44
<ItemGroup Label="ProjectConfigurations">
55
<ProjectConfiguration Include="Debug-Net40|Win32">
66
<Configuration>Debug-Net40</Configuration>
@@ -321,13 +321,15 @@
321321
<ClInclude Include="..\CefSharp.Core\Internals\Serialization\Primitives.h" />
322322
<ClInclude Include="..\CefSharp.Core\Internals\StringUtils.h" />
323323
<ClInclude Include="BindObjectAsyncHandler.h" />
324+
<ClCompile Include="BrowserSubprocessExecutable.h" />
324325
<ClInclude Include="SubProcessApp.h" />
325326
<ClInclude Include="Async\JavascriptAsyncMethodCallback.h" />
326327
<ClInclude Include="Async\JavascriptAsyncMethodHandler.h" />
327328
<ClInclude Include="Async\JavascriptAsyncMethodWrapper.h" />
328329
<ClInclude Include="Async\JavascriptAsyncObjectWrapper.h" />
329330
<ClInclude Include="CefAppUnmanagedWrapper.h" />
330331
<ClInclude Include="JavascriptPostMessageHandler.h" />
332+
<ClCompile Include="WcfBrowserSubprocessExecutable.h" />
331333
<ClInclude Include="Wrapper\Frame.h" />
332334
<ClInclude Include="Wrapper\Browser.h" />
333335
<ClInclude Include="Wrapper\V8Context.h" />

CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj.filters

+6
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@
181181
<ClCompile Include="Wrapper\Browser.cpp">
182182
<Filter>Source Files</Filter>
183183
</ClCompile>
184+
<ClCompile Include="WcfBrowserSubprocessExecutable.h">
185+
<Filter>Header Files</Filter>
186+
</ClCompile>
187+
<ClCompile Include="BrowserSubprocessExecutable.h">
188+
<Filter>Header Files</Filter>
189+
</ClCompile>
184190
</ItemGroup>
185191
<ItemGroup>
186192
<ResourceCompile Include="Resource.rc" />

CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ namespace CefSharp
4242
{
4343
try
4444
{
45-
auto global = context->GetGlobal();
46-
4745
if (name == kIsObjectCached || name == kIsObjectCachedCamelCase)
4846
{
4947
if (arguments.size() == 0 || arguments.size() > 1)

0 commit comments

Comments
 (0)