Skip to content

Commit

Permalink
Refactor CefSharp.Core into CefSharp.Core.Runtime (#3311)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
amaitland authored Dec 16, 2020
1 parent 149bda0 commit 8a367fb
Show file tree
Hide file tree
Showing 230 changed files with 7,126 additions and 5,341 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ x64/Release
Win32/Release
.vs/
/Help
/tools
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "stdafx.h"
#include "JavascriptAsyncMethodHandler.h"
#include "../CefSharp.Core/Internals/Messaging/Messages.h"
#include "../CefSharp.Core/Internals/Serialization/Primitives.h"
#include "../CefSharp.Core.Runtime/Internals/Messaging/Messages.h"
#include "../CefSharp.Core.Runtime/Internals/Serialization/Primitives.h"
#include "Serialization/V8Serialization.h"
#include "CefAppUnmanagedWrapper.h"

Expand Down
4 changes: 2 additions & 2 deletions CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "include/cef_v8.h"
#include "RegisterBoundObjectRegistry.h"
#include "..\CefSharp.Core\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core\Internals\Serialization\Primitives.h"
#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h"

using namespace System;
using namespace CefSharp::Internals::Messaging;
Expand Down
4 changes: 2 additions & 2 deletions CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include "Wrapper\V8Context.h"
#include "Wrapper\Frame.h"
#include "Wrapper\Browser.h"
#include "..\CefSharp.Core\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core\Internals\Serialization\Primitives.h"
#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h"

using namespace System;
using namespace System::Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
<ClInclude Include="JavascriptObjectWrapper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\MCefRefPtr.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\MCefRefPtr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\StringUtils.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\StringUtils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TypeUtils.h">
Expand All @@ -56,10 +56,10 @@
<ClInclude Include="JavascriptCallbackWrapper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\ReportUnhandledExceptions.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\ReportUnhandledExceptions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\Serialization\Primitives.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Serialization\V8Serialization.h">
Expand All @@ -77,7 +77,7 @@
<ClInclude Include="Async\JavascriptAsyncMethodCallback.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\Serialization\ObjectsSerialization.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\Serialization\ObjectsSerialization.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Serialization\JsObjectsSerialization.h">
Expand Down Expand Up @@ -148,7 +148,7 @@
<ClCompile Include="JavascriptCallbackRegistry.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CefSharp.Core\Internals\Serialization\Primitives.cpp">
<ClCompile Include="..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Serialization\V8Serialization.cpp">
Expand All @@ -166,7 +166,7 @@
<ClCompile Include="Async\JavascriptAsyncMethodCallback.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CefSharp.Core\Internals\Serialization\ObjectsSerialization.cpp">
<ClCompile Include="..\CefSharp.Core.Runtime\Internals\Serialization\ObjectsSerialization.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Serialization\JsObjectsSerialization.cpp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\CefSharp.Core\Internals\MCefRefPtr.h" />
<ClInclude Include="..\CefSharp.Core\Internals\ReportUnhandledExceptions.h" />
<ClInclude Include="..\CefSharp.Core\Internals\Serialization\ObjectsSerialization.h" />
<ClInclude Include="..\CefSharp.Core\Internals\Serialization\Primitives.h" />
<ClInclude Include="..\CefSharp.Core\Internals\StringUtils.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\MCefRefPtr.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\ReportUnhandledExceptions.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\Serialization\ObjectsSerialization.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\StringUtils.h" />
<ClInclude Include="BindObjectAsyncHandler.h" />
<ClCompile Include="BrowserSubprocessExecutable.h" />
<ClInclude Include="Cef.h" />
Expand Down Expand Up @@ -207,8 +207,8 @@
<ClInclude Include="vcclr_local.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\CefSharp.Core\Internals\Serialization\ObjectsSerialization.cpp" />
<ClCompile Include="..\CefSharp.Core\Internals\Serialization\Primitives.cpp" />
<ClCompile Include="..\CefSharp.Core.Runtime\Internals\Serialization\ObjectsSerialization.cpp" />
<ClCompile Include="..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.cpp" />
<ClCompile Include="AssemblyInfo.cpp" />
<ClCompile Include="Async\JavascriptAsyncMethodCallback.cpp" />
<ClCompile Include="Async\JavascriptAsyncMethodHandler.cpp" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\cef.sdk.87.1.12\build\cef.sdk.props" Condition="Exists('..\packages\cef.sdk.87.1.12\build\cef.sdk.props')" />
<Import Project="..\packages\GitLink.3.1.0\build\GitLink.props" Condition="Exists('..\packages\GitLink.3.1.0\build\GitLink.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -167,11 +168,11 @@
<Reference Include="System.ServiceModel" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\CefSharp.Core\Internals\MCefRefPtr.h" />
<ClInclude Include="..\CefSharp.Core\Internals\ReportUnhandledExceptions.h" />
<ClInclude Include="..\CefSharp.Core\Internals\Serialization\ObjectsSerialization.h" />
<ClInclude Include="..\CefSharp.Core\Internals\Serialization\Primitives.h" />
<ClInclude Include="..\CefSharp.Core\Internals\StringUtils.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\MCefRefPtr.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\ReportUnhandledExceptions.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\Serialization\ObjectsSerialization.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h" />
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\StringUtils.h" />
<ClInclude Include="BindObjectAsyncHandler.h" />
<ClCompile Include="BrowserSubprocessExecutable.h" />
<ClInclude Include="Cef.h" />
Expand Down Expand Up @@ -208,8 +209,8 @@
<ClInclude Include="vcclr_local.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\CefSharp.Core\Internals\Serialization\ObjectsSerialization.cpp" />
<ClCompile Include="..\CefSharp.Core\Internals\Serialization\Primitives.cpp" />
<ClCompile Include="..\CefSharp.Core.Runtime\Internals\Serialization\ObjectsSerialization.cpp" />
<ClCompile Include="..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.cpp" />
<ClCompile Include="AssemblyInfo.cpp" />
<ClCompile Include="Async\JavascriptAsyncMethodCallback.cpp" />
<ClCompile Include="Async\JavascriptAsyncMethodHandler.cpp" />
Expand Down Expand Up @@ -247,5 +248,7 @@
<None Include="packages.CefSharp.BrowserSubprocess.Core.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\GitLink.3.1.0\build\GitLink.targets" Condition="Exists('..\packages\GitLink.3.1.0\build\GitLink.targets')" />
</ImportGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
<ClInclude Include="JavascriptObjectWrapper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\MCefRefPtr.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\MCefRefPtr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\StringUtils.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\StringUtils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TypeUtils.h">
Expand All @@ -56,10 +56,10 @@
<ClInclude Include="JavascriptCallbackWrapper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\ReportUnhandledExceptions.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\ReportUnhandledExceptions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\Serialization\Primitives.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Serialization\V8Serialization.h">
Expand All @@ -77,7 +77,7 @@
<ClInclude Include="Async\JavascriptAsyncMethodCallback.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CefSharp.Core\Internals\Serialization\ObjectsSerialization.h">
<ClInclude Include="..\CefSharp.Core.Runtime\Internals\Serialization\ObjectsSerialization.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Serialization\JsObjectsSerialization.h">
Expand Down Expand Up @@ -154,7 +154,7 @@
<ClCompile Include="JavascriptCallbackRegistry.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CefSharp.Core\Internals\Serialization\Primitives.cpp">
<ClCompile Include="..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Serialization\V8Serialization.cpp">
Expand All @@ -172,7 +172,7 @@
<ClCompile Include="Async\JavascriptAsyncMethodCallback.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CefSharp.Core\Internals\Serialization\ObjectsSerialization.cpp">
<ClCompile Include="..\CefSharp.Core.Runtime\Internals\Serialization\ObjectsSerialization.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Serialization\JsObjectsSerialization.cpp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#pragma once

#include "include/cef_v8.h"
#include "..\CefSharp.Core\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core\Internals\Serialization\Primitives.h"
#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h"
#include "Serialization\V8Serialization.h"

using namespace System;
Expand Down
4 changes: 2 additions & 2 deletions CefSharp.BrowserSubprocess.Core/JavascriptPromiseHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#pragma once

#include "include/cef_v8.h"
#include "..\CefSharp.Core\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core\Internals\Serialization\Primitives.h"
#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h"
#include "Serialization\V8Serialization.h"

using namespace System;
Expand Down
4 changes: 2 additions & 2 deletions CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "include/cef_v8.h"
#include "RegisterBoundObjectRegistry.h"
#include "..\CefSharp.Core\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core\Internals\Serialization\Primitives.h"
#include "..\CefSharp.Core.Runtime\Internals\Messaging\Messages.h"
#include "..\CefSharp.Core.Runtime\Internals\Serialization\Primitives.h"

using namespace System;
using namespace CefSharp::Internals::Messaging;
Expand Down
8 changes: 4 additions & 4 deletions CefSharp.BrowserSubprocess.Core/Resource.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1 VERSIONINFO
FILEVERSION 86,0,20
PRODUCTVERSION 86,0,20
FILEVERSION 87,1,11
PRODUCTVERSION 87,1,11
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -16,10 +16,10 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "CefSharp.BrowserSubprocess.Core"
VALUE "FileVersion", "86.0.20"
VALUE "FileVersion", "87.1.11"
VALUE "LegalCopyright", "Copyright © 2020 The CefSharp Authors"
VALUE "ProductName", "CefSharp"
VALUE "ProductVersion", "86.0.20"
VALUE "ProductVersion", "87.1.11"
END
END
BLOCK "VarFileInfo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "stdafx.h"
#include "JsObjectsSerialization.h"
#include "../CefSharp.Core/Internals/Serialization/Primitives.h"
#include "../CefSharp.Core/Internals/Serialization/ObjectsSerialization.h"
#include "../CefSharp.Core.Runtime/Internals/Serialization/Primitives.h"
#include "../CefSharp.Core.Runtime/Internals/Serialization/ObjectsSerialization.h"

namespace CefSharp
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright © 2015 The CefSharp Authors. All rights reserved.
// Copyright © 2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

#include "Stdafx.h"
#include "V8Serialization.h"
#include "JavascriptCallbackRegistry.h"
#include "../CefSharp.Core/Internals/Serialization/Primitives.h"
#include "../CefSharp.Core.Runtime/Internals/Serialization/Primitives.h"

#include <deque>

Expand Down Expand Up @@ -185,4 +185,4 @@ namespace CefSharp
template CefRefPtr<CefV8Value> DeserializeV8Object(const CefRefPtr<CefDictionaryValue>& list, const CefString& index);
}
}
}
}
6 changes: 3 additions & 3 deletions CefSharp.BrowserSubprocess.Core/Stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

#include <include/cef_base.h>

#include ".\..\CefSharp.Core\Internals\MCefRefPtr.h"
#include ".\..\CefSharp.Core\Internals\StringUtils.h"
#include ".\..\CefSharp.Core.Runtime\Internals\MCefRefPtr.h"
#include ".\..\CefSharp.Core.Runtime\Internals\StringUtils.h"
#include "vcclr_local.h"

using namespace System;
using namespace CefSharp;
using namespace CefSharp::Internals;
using namespace CefSharp::Internals;
2 changes: 1 addition & 1 deletion CefSharp.BrowserSubprocess.Core/TypeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "Stdafx.h"
#include ".\..\CefSharp.Core\Internals\StringUtils.h"
#include ".\..\CefSharp.Core.Runtime\Internals\StringUtils.h"
#include "TypeUtils.h"

using namespace System::Collections::Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.sdk" version="87.1.12" targetFramework="native" />
<package id="GitLink" version="3.1.0" targetFramework="native" developmentDependency="true" />
</packages>
2 changes: 1 addition & 1 deletion CefSharp.BrowserSubprocess/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<assemblyIdentity version="86.0.20.0" name="CefSharp.BrowserSubprocess.app" />
<assemblyIdentity version="87.1.11.0" name="CefSharp.BrowserSubprocess.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
Expand Down
Loading

0 comments on commit 8a367fb

Please sign in to comment.