Commit Graph

23 Commits

Author SHA1 Message Date
Alex Maitland 65534275b7 Core - Upgrade to newer SDK Style project
- Upgrade CefSharp.Core.csproj
- Upgrade CefSharp.csproj
- Ensure pdbs are generated for release builds with same settings as before

Issue #3791
2021-09-20 11:32:14 +10:00
Alex Maitland 172ee5afe8 Migrate from GitLink to Source link
Resolves #3036
2021-09-07 12:08:56 +10:00
Alex Maitland e4e0f22ca7 WinForms/WPF/OffScreen - Upgrade to SDK style projects and multi-target net452 and net462
Haven't tested the output nuget packages yet, we might still need to change the nuspec files to add a
dependency group.

Issue #3791
2021-09-05 15:09:35 +10:00
Alex Maitland d350cad52a Update to M93 (#3781)
* Upgrade to CEF 93.1.7+g9117d6a+chromium-93.0.4577.42 / Chromium 93.0.4577.42

- Core - Add basic ref counting implementation

IMPLEMENT_REFCOUNTING implementation uses atomic which
forces the VC++ compiler to compile as native which doesn't work for our managed ref classes.

    - Use InterlockedCompareExchange for custom ref count reads
    - Use InterlockedIncrement/InterlockedDecrement directly
    - There's no memory barrier for HasOneRef/HasAtLeastOneRef as the read of a LONG should happen in one operation
on 32/64 bit architectures (at least that's my understanding at this point in time).

    References:
    https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_x86_msvc.h#L125
    https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_arm64_msvc.h#L107
    https://github.com/chromiumembedded/cef/blob/4472/include/base/cef_atomic_ref_count.h#L114
    https://github.com/chromiumembedded/cef/blob/4472/include/cef_base.h#L91

-  Remove Microsoft.Net.Compilers package from projects
Now that we require a min of VS2019 to build there's no need for a custom compiler package
- Start removing VS2015/VC++2015 references
- Remove RegisterWidevineCdm
This is a breaking change. CEF will now automatically download the Widevine CDM component
Resolves #3767

- RequestContext.LoadExtension now uses managed to code spawn on CEF UI Thread
Avoid having to use cef_callback.h which was causing problems for x86 builds
2021-09-03 10:51:18 +10:00
Alex Maitland 8a367fbdc4 Refactor CefSharp.Core into CefSharp.Core.Runtime (#3311)
* Net Core - Rename CefSharp.Core.dll to CefSharp.Core.Runtime.dll

Partial rename, only Net Core, folder not renamed

* Net Core - Rename CefSharp.Core.RefAssembly to CefSharp.Core.netcore

Remove GenApi

* Core - Rename CefDragDataWrapper to DragData

Move into CefSharp.Core namespace

* WinForms/WPF/OffScreen - Migrate from GitLink command line to Nuget package

* Net Core - Refactor to have CefSharp.Core.dll contain only public Api

* Net Core - Remove CefSharp.Core.RefAssembly

* Net Core - Change CefSharp.Core.netcore output folder

* Net Core - Restructure nuget packages

* Net Core - Add Cefsharp.Core.Runtime.RefAssembly

* Net Core - Hide CLI/C++ classes from intellisense

Make sure users don't attempt to load them directly

* Rename CefSharp.Core to CefSharp.Core.Runtime

* Core - Restructure Net 4.5.2 packages to use CefSharp.Core.dll anycpu variant

Attempt to load CefSharp.Core.Runtime at runtime rather than having to use msbuild to copy the correct version

* Rename CefSharp.Core.netcore to CefSharp.Core

* WPF/WinForms/OffScreen - Change from x86/64 to AnyCPU

As they are all managed assemblies they can target AnyCPU.
Includes CefSharp.dll

* Convert RequestContextBuilder from C++ to C#

Now part of the CefSharp.Core PublicApi

* Update version number to 87.1.11

* Migrate more of the public Api to C#

* Net Core - Basic restructure complete

* Net Core - ModuleInitializer (Doesn't work yet)

* Remove direct references to BrowserSettings

* Net Core - ModuleInitializer load CefShar.Core.Runtime.dl

* Net Core - Load libcef.dll via CLR Module initializer

If no RID is specified then we can load libcef.dll using the module initializer

* Add version to CefSharp.Core

* Remove dependency on CefSharp.Core.Runtime
Rewrite common targets

* AnyCPU app.config transform

Improve AnyCPU support

* Improve Net Core 3 support
Only delete CefSharp.Core.Runtime.dll when AnyCPU

* Nuget - Add CefSharp.Core.Runtime reference when TargetFramework = NetCore

* Fix Typos

Based on #3306

* Net Core - Rename CefSharp.Core.Runtime RefAssembly source file

* Net Full - Generate CefSharp.Core.Runtime Ref Assembly

For now the powershell build script generates the .cs file based on a x86 release build.ps1
It's not possible to directly install GenApi as it requires a Sdk style project

* Net Core - Old packages copy files to required folders

* Test - Install newer .Net Compiler and set Lang Version to 7.3

* Net Core - Exclude Net 452 Runtime generated reference source

* Core - Add Refactoring TODO

* Ref Assembly - Generate source as part of build

- Move ref assembly source generate into GenerateRefAssemblySource.ps1
- Call before project build

Runs locally, see if Appveyor has a problem with the powershell script execution

* Core - Add more factory methods to create instances of managed wrappers

* Net Core - Make Initialzier properties internal

Not quite sure what the public API should look like as yet, so making internal for now.
2020-12-16 10:47:34 +10:00
Alex Maitland c0ef404213 Core - VS2019 Invalid option '7.3' for /langversion
When building CefSharp3.sln under VS2019 the Microsoft.Net.Compilers (version 2.4) is passed version 7.3 for c# version
Version 2.4 supports a maximum of version 7.1, the issue doesn't happen on VS2015 or VS2017
Hard code LangVersion in csproj files

CS1617	Invalid option '7.3' for /langversion; must be ISO-1, ISO-2, Default, Latest or a valid version in range 1 to 7.1.

https://stackoverflow.com/questions/46419760/using-c-sharp-7-1-with-msbuild
2020-11-06 13:13:28 +10:00
amaitland 3372ce8a57 Build - Generate Ref Assemblies for .Net 4.5.2 assemblies
Only for Release builds.

This appears to work as expected under VS2017, not sure about VS2015
Roslny .Net compiler upgraded to 2.4 allows for Ref Assembly generation
2020-10-21 18:10:04 +10:00
amaitland 5d4897f4c6 Core - Add Microsoft.Net.Compilers 2.4
This is the last version to support .Net 4.5.2
Set allowedVersions="2.4"  to stop from updating to a newer version which won't compile under VS2015
2020-10-21 17:55:29 +10:00
amaitland 0183c429e0 WPF/WinForms/OffScreen - Reduce Code Duplication Initial
- Add ChromiumWebBrowser.Partial.cs and include in all three projects
- Remove InternalsVisibleTo from Cefsharp.dll start moving code into the partial class
  (We don't want to publish our internals as part of our Ref Assembly so this goings together)

#3082
#3197
2020-08-07 14:24:07 +10:00
amaitland d87e795000 WinForms/Wpf/OffScreen - Create specific CefSettings class for each version
- This is a breaking change as there is no common `CefSharp.CefSettings`, there is no `CefSharp.Wpf.CefSettings`, `CefSharp.WinForms.CefSettings` and `CefSharp.OffScreen.CefSettings`
 - Cef.Initialize has been removed, the `ChromiumWebBrowser` constructor will call the `Cef.Initialize` with the defaults for your flavour
 - CefSettings.FocusedNodeChangedEnabled has been moved to CefSharpSettings.FocusedNodeChangedEnabled

Resolves #2477
2018-08-02 10:47:12 +10:00
amaitland c51a615d7d OffScreen - Add IRenderHandler and DefaultRenderHandler basic implementation
Only supports OnPaint, will expand to support the other methods
2018-04-23 13:02:12 +10:00
amaitland c1b89c62e9 WPF/OffScreen - Code cleanup and minor refactor
IRenderWebBrowser - Method naming now matches CEF, xmldoc updated to be more accurate

CefSharp.Wpf.ChromiumWebBrowser and CefSharp.OffScreen.ChromiumWebBrowser both updated as a result of IRenderWebBrowser changes
Should be minimal public API changes, should only require changes for those that are implementing their own rendering, who will have a major rewrite on their hands regardless of this.
2018-04-20 14:49:25 +10:00
amaitland 127c00554f Rewrite WPF/OffScreen OnPaint
OffScreen
  - Now maintains a raw Byte[] buffer that is used to create the GDI bitmaps
can be overridden and raw buffer access granted (eliminates the forced memory copy to the memory mapped view)

WPF
  - MemoryMappedFile.CreateNew is now used to create the in memory view and copy the buffer
  - InteropBitmapFactory only create new MemoryMappedFile selectively. If the MemoryMappedFile is larger than we require then just reuse it rather than
    releasing then allocating a smaller section of memory that's used for double buffering with InteropBitmap and WritableBitmap
  - Removed CefDirtyRect and used existing Rect class
  - Rename rendering event to Paint, still preferable to implement IBitmapFactory or subclass ChromiumWebBrowser
  - Update ChromiumWebBrowserWithScreenshotSupport to support new rendering method - not very well tested.

Resolves #2237
2018-01-18 11:29:12 +10:00
amaitland 4e0fb684fe OffScreen - code cleanup and expose more of the underlying methods, allow for overriding of IRenderWebBrowser method when inheriting from ChromiumWebBrowser
Mark ScreenshotOrNull as obsolete - use OnPaint instead
Mark NewScreenshot event as obsolete - use ScreenshotAsync instead
2018-01-18 10:25:51 +10:00
Valentin Deschaintre 910b56cbd3 Offscreen popup (dropdown list) merge with the background browser. (#1734)
* Enhanced implementation of offscreen ChromiumWebBrowser to enable more possibilities of override. Mainly improved the popup informations accessibility.

* Addition of a blending/merge implementation to set Bitmap to the whole image (full browser + popup) in case of dropdown lists in offscreen project. Fixed 2 comments.

* Remove the use of $"string {var}" for string.Format.

* Removal of "nameof" use.

* Move of the blending in ScreenshotOrNull for better performance. Removed useless function and variables. Samll fixes as asked in the PR.
2016-07-06 21:53:02 +10:00
amaitland 54f7fccdaa Upgrade to .Net 4.5.2
Resolve #1572
2016-05-10 20:28:21 +10:00
amaitland 1238392642 Allow for custom rendering in OffScreen project
- Add BitmapFactory property
- Expose InvokeRenderAsync as virtual
2015-10-15 21:45:07 +10:00
amaitland 370832cd94 Remove unused references from CefSharp.OffScreen 2015-07-28 08:06:41 +10:00
amaitland cedc3196fa Remove WindowsBase reference from OffScreen - not required (Uses Gdi Bitmap) 2015-05-21 13:51:14 +10:00
amaitland fcde9660d3 Add System.ServiceModel to OffScreen - needed to use the new extension methods 2015-05-21 13:51:14 +10:00
amaitland 0eeacddd78 Sign the OffScreen project (using existing snk file) 2015-05-02 06:55:27 +10:00
amaitland 520349d643 Make BitmapInfo abstract and implement a strongly typed version in WPF and OffScreen 2014-12-16 23:19:21 +10:00
amaitland eded63be55 Hopefully the final renaming 2014-11-18 13:32:38 +10:00