Commit Graph

17 Commits

Author SHA1 Message Date
amaitland 11338dda42 Add more xunit tests 2025-10-11 11:39:34 +10:00
Alex Maitland 8d7a169590 Change Frame identifier from Int64 to String (#4740)
* Change Frame identifier from Int64 to String

Issue https://github.com/cefsharp/CefSharp/issues/4737

* Fix SetCanExecuteJavascriptOnMainFrame frameId parsing

* Add tests

* NetCore Tests - Install missing packages
2024-03-09 06:55:27 +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 a18637facd C++/CLI - Replace NULL with nullptr
Issue #3636
2021-07-31 15:52:56 +10:00
Alex Maitland b24cd8e2d7 C++/CLI - Replace OVERRIDE with override
OVERRIDE was a CEF macro which has been removed, use standard compliant override

Issue #3636
2021-07-31 15:52:55 +10:00
Alex Maitland 9f96333626 Javascript Binding - CefSharp.BindObjectAsync() never raised the ResolveObject event
Resolves #3470
2021-04-28 13:49:09 +10:00
Alex Maitland e3e4c3fe35 BrowserSubprocess - Namespace cleanup
Possibly a few cases that were missed, this should be the bulk of the rename

Resolves #3253
2021-02-27 14:40:16 +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
Gilberto Stankiewicz b0b5103100 Fix code analysis C4018 warnings (#3223)
* Replace `auto`s with `size_t`s to reduce:

```
Severity	Code	Description	Project	File	Line	Suppression State
Warning	C4018	'<': signed/unsigned mismatch	CefSharp.BrowserSubprocess.Core	c:\repos\cefsharp\cefsharp.browsersubprocess.core\serialization\jsobjectsserialization.cpp	71
```

* Fix templates
2020-08-26 19:13:13 +10:00
amaitland e8cf336bf3 Net Core - Support for compiling with .Net Core 3.1
- Make Wpf/WinForms/OffScreen projects target AnyCPU
Only the VC++ projects are platform specific now.
- Remove BrowserSubProcess project reference
Not needed as we now have a standalone exe
- Add OffScreen example
- Add WPF Example project
- Fix some compile errors for main solution
- Add BrowserSubProcess executable
- JavascriptObjectRepository remove isAsync param
Rather than throw exception remove the option
- BrowserSubprocess Exclude the WCF specific code from the netCore project
- Add some ifdef/ifndef to exclude the WCF specific implementation
- Move WCF implementation into separate namespace
2020-07-23 15:23:45 +10:00
amaitland 4b2fe1e0d7 Core - JavascriptObjectRepository.ResolveObject incorrectly called with args.ObjectName of string.Empty
We were incorrectly leaving empty entries in the CefListValue

Resolves #3193
2020-07-22 14:55:14 +10:00
amaitland 31fdcd459b BindObjectAsyncHandler - Switch to using Promise.resolve when immediate response available
Instead of creating a new promise then resolving it, we just resolve directly
Requires a slightly different approach using Eval with a string as I couldn't get a reference to Promise.resolve
then execute it successfully.
2019-07-08 21:06:32 +10:00
amaitland 6fcd3e67ff BindObjectAsyncHandler - Add destructor
Release managed resources
2019-07-08 20:14:57 +10:00
amaitland ae2acc0905 BindObjectAsyncHandler - Move some variables closer to their usage 2019-07-08 20:14:56 +10:00
amaitland b983457158 BindObjectAsyncHandler - Further reduce nesting, simplifying frame checks in the progress 2019-07-08 20:14:55 +10:00
amaitland eda2e2f33c BindObjectAsyncHandler - Reduce nesting
Combine Context Get and Context Enter error handling
2019-07-08 20:14:53 +10:00
amaitland f6edbd5ad8 CefSharp.BindObjectAsync - Split out into it's own Handler
- Add BindObjectAsyncHandler
- Remove unneeded params from RegisterBoundObjectHandler
2019-07-08 20:14:52 +10:00