Skip to content

Commit 65efa93

Browse files
authored
PR Chromium 126.2.70 to 127.3.50 (#27)
* Upgrade to 127.3.5+g114ea2a+chromium-127.0.6533.120 * Change Cef.IsInitialized from bool to bool? * InitializeCefInternal() missing fix * Update ChromiumWebBrowser.cs
1 parent be8cbf6 commit 65efa93

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

CefSharp.Wpf.HwndHost/CefSharp.Wpf.HwndHost.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<RootNamespace>CefSharp.Wpf.HwndHost</RootNamespace>
66
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
8-
<Version>126.2.70</Version>
8+
<Version>127.3.50</Version>
99
<Authors>The CefSharp Authors</Authors>
1010
<Description>The CefSharp Chromium-based browser component. The CefSharp.Wpf.HwndHost.ChromiumWebBrowser control is a drop in replacement for the CefSharp.Wpf.ChromiumWebBrowser that's rougly equivilent to hosting the WinForms version in WPF.</Description>
1111
<Copyright>Copyright © The CefSharp Authors</Copyright>
@@ -23,11 +23,11 @@
2323
</PropertyGroup>
2424

2525
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
26-
<PackageReference Include="CefSharp.Common" Version="126.2.70" />
26+
<PackageReference Include="CefSharp.Common" Version="127.3.50" />
2727
</ItemGroup>
2828

2929
<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
30-
<PackageReference Include="CefSharp.Common.NETCore" Version="126.2.70" />
30+
<PackageReference Include="CefSharp.Common.NETCore" Version="127.3.50" />
3131
</ItemGroup>
3232

3333
<ItemGroup>

CefSharp.Wpf.HwndHost/ChromiumWebBrowser.cs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public class ChromiumWebBrowser : System.Windows.Interop.HwndHost, IWebBrowserIn
3131
"The ChromiumWebBrowser instance creates the underlying Chromium Embedded Framework (CEF) browser instance in an async fashion. " +
3232
"The undelying CefBrowser instance is not yet initialized. Use the IsBrowserInitializedChanged event and check " +
3333
"the IsBrowserInitialized property to determine when the browser has been initialized.";
34+
private const string CefInitializeFailedErrorMessage = "Cef.Initialize() failed.Check the log file see https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting#log-file for details.";
35+
private const string CefIsInitializedFalseErrorMessage = "Cef.IsInitialized was false!.Check the log file for errors!. See https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting#log-file for details.";
3436

3537
[DllImport("user32.dll", EntryPoint = "CreateWindowEx", CharSet = CharSet.Unicode)]
3638
private static extern IntPtr CreateWindowEx(int dwExStyle,
@@ -629,16 +631,7 @@ public ChromiumWebBrowser(string initialAddress)
629631
[MethodImpl(MethodImplOptions.NoInlining)]
630632
private void NoInliningConstructor()
631633
{
632-
//Initialize CEF if it hasn't already been initialized
633-
if (!Cef.IsInitialized)
634-
{
635-
var settings = new CefSettings();
636-
637-
if (!Cef.Initialize(settings))
638-
{
639-
throw new InvalidOperationException("Cef::Initialize() failed");
640-
}
641-
}
634+
InitializeCefInternal();
642635

643636
//Add this ChromiumWebBrowser instance to a list of IDisposable objects
644637
// that if still alive at the time Cef.Shutdown is called will be disposed of
@@ -1716,6 +1709,22 @@ public IBrowser GetBrowser()
17161709
return browser;
17171710
}
17181711

1712+
private static void InitializeCefInternal()
1713+
{
1714+
if (Cef.IsInitialized == null)
1715+
{
1716+
if (!Cef.Initialize(new CefSettings()))
1717+
{
1718+
throw new InvalidOperationException(CefInitializeFailedErrorMessage);
1719+
}
1720+
}
1721+
1722+
if (Cef.IsInitialized == false)
1723+
{
1724+
throw new InvalidOperationException(CefIsInitializedFalseErrorMessage);
1725+
}
1726+
}
1727+
17191728
/// <summary>
17201729
/// Check is browserisinitialized
17211730
/// </summary>

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image: Visual Studio 2019
22

3-
version: 126.2.70-CI{build}
3+
version: 127.3.50-CI{build}
44

55
clone_depth: 10
66

0 commit comments

Comments
 (0)