diff --git a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.h b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.h index 1513e11c87..c98a4baa29 100644 --- a/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.h +++ b/CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.h @@ -38,7 +38,7 @@ namespace CefSharp _methodCallbackSave = nullptr; } - IMPLEMENT_REFCOUNTING(JavascriptAsyncMethodHandler); + IMPLEMENT_REFCOUNTINGM(JavascriptAsyncMethodHandler); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h b/CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h index 319d98fca9..bbe39fe54b 100644 --- a/CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h +++ b/CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h @@ -321,8 +321,7 @@ namespace CefSharp return false; } - - IMPLEMENT_REFCOUNTING(BindObjectAsyncHandler); + IMPLEMENT_REFCOUNTINGM(BindObjectAsyncHandler); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.h b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.h index 7fa6e0e1d4..b202f31aa8 100644 --- a/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.h @@ -84,7 +84,7 @@ namespace CefSharp virtual DECL void OnFocusedNodeChanged(CefRefPtr browser, CefRefPtr frame, CefRefPtr node) override; virtual DECL void OnUncaughtException(CefRefPtr browser, CefRefPtr frame, CefRefPtr context, CefRefPtr exception, CefRefPtr stackTrace) override; - IMPLEMENT_REFCOUNTING(CefAppUnmanagedWrapper); + IMPLEMENT_REFCOUNTINGM(CefAppUnmanagedWrapper); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h b/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h index 16c08a4c58..1e32ecea5e 100644 --- a/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h @@ -36,7 +36,7 @@ namespace CefSharp public: CefBrowserWrapper(CefRefPtr cefBrowser) { - _cefBrowser = cefBrowser; + _cefBrowser = cefBrowser.get(); BrowserId = cefBrowser->GetIdentifier(); IsPopup = cefBrowser->IsPopup(); diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj index 13d8748391..f501b76999 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj @@ -1,6 +1,6 @@  - + @@ -37,6 +37,7 @@ CefSharpBrowserSubprocessCore NetCoreCProj netcoreapp3.1 + 10.0 @@ -254,12 +255,14 @@ + + diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj index 95bb7498d1..05747fd581 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj @@ -1,6 +1,6 @@  - + @@ -25,6 +25,7 @@ ManagedCProj CefSharpBrowserSubprocessCore v4.5.2 + 10.0 @@ -168,11 +169,13 @@ + + diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj.filters b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj.filters index d8a73f4413..659e3820c0 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj.filters +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj.filters @@ -119,6 +119,9 @@ Header Files + + Header Files + @@ -190,6 +193,9 @@ Header Files + + Source Files + diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.h b/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.h index 13ed854fef..36ee2c31e8 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptMethodHandler.h @@ -38,7 +38,7 @@ namespace CefSharp CefRefPtr ConvertToCefObject(Object^ obj); - IMPLEMENT_REFCOUNTING(JavascriptMethodHandler); + IMPLEMENT_REFCOUNTINGM(JavascriptMethodHandler); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPostMessageHandler.h b/CefSharp.BrowserSubprocess.Core/JavascriptPostMessageHandler.h index 9e0ee9b5fa..9274c0ad8b 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptPostMessageHandler.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPostMessageHandler.h @@ -86,7 +86,7 @@ namespace CefSharp return true; } - IMPLEMENT_REFCOUNTING(JavascriptPostMessageHandler); + IMPLEMENT_REFCOUNTINGM(JavascriptPostMessageHandler); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPromiseHandler.h b/CefSharp.BrowserSubprocess.Core/JavascriptPromiseHandler.h index 5407735717..24b7bcd8a3 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptPromiseHandler.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPromiseHandler.h @@ -83,7 +83,7 @@ namespace CefSharp return false; } - IMPLEMENT_REFCOUNTING(JavascriptPromiseHandler); + IMPLEMENT_REFCOUNTINGM(JavascriptPromiseHandler); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/JavascriptPropertyHandler.h b/CefSharp.BrowserSubprocess.Core/JavascriptPropertyHandler.h index 024d6c277a..1de2931d6c 100644 --- a/CefSharp.BrowserSubprocess.Core/JavascriptPropertyHandler.h +++ b/CefSharp.BrowserSubprocess.Core/JavascriptPropertyHandler.h @@ -62,7 +62,7 @@ namespace CefSharp return true; } - IMPLEMENT_REFCOUNTING(JavascriptPropertyHandler); + IMPLEMENT_REFCOUNTINGM(JavascriptPropertyHandler); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h b/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h index fb93fb4845..525bf19538 100644 --- a/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h +++ b/CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h @@ -122,7 +122,7 @@ namespace CefSharp return true; } - IMPLEMENT_REFCOUNTING(RegisterBoundObjectHandler); + IMPLEMENT_REFCOUNTINGM(RegisterBoundObjectHandler); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/Stdafx.h b/CefSharp.BrowserSubprocess.Core/Stdafx.h index b450bb08cb..f080d8421a 100644 --- a/CefSharp.BrowserSubprocess.Core/Stdafx.h +++ b/CefSharp.BrowserSubprocess.Core/Stdafx.h @@ -14,6 +14,7 @@ #include +#include ".\..\CefSharp.Core.Runtime\Internals\CefRefCountManaged.h" #include ".\..\CefSharp.Core.Runtime\Internals\MCefRefPtr.h" #include ".\..\CefSharp.Core.Runtime\Internals\StringUtils.h" #include "vcclr_local.h" diff --git a/CefSharp.BrowserSubprocess.Core/SubProcessApp.h b/CefSharp.BrowserSubprocess.Core/SubProcessApp.h index 7f1c285aee..b3e4c9be75 100644 --- a/CefSharp.BrowserSubprocess.Core/SubProcessApp.h +++ b/CefSharp.BrowserSubprocess.Core/SubProcessApp.h @@ -44,7 +44,7 @@ namespace CefSharp } } - IMPLEMENT_REFCOUNTING(SubProcessApp); + IMPLEMENT_REFCOUNTINGM(SubProcessApp); }; } } diff --git a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config index 136bba42ba..5a2078807c 100644 --- a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config +++ b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config index e4025a68b5..48e863d08d 100644 --- a/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config +++ b/CefSharp.BrowserSubprocess.Core/packages.CefSharp.BrowserSubprocess.Core.netcore.config @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs b/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs index b2cfdbbf90..ebabe0b97e 100644 --- a/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs +++ b/CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.netcore.cs @@ -87,8 +87,6 @@ public static void EnableWaitForBrowsersToClose() { } public static void PreShutdown() { } public static void QuitMessageLoop() { } public static void RefreshWebPlugins() { } - public static void RegisterWidevineCdm(string path, CefSharp.IRegisterCdmCallback callback) { } - public static System.Threading.Tasks.Task RegisterWidevineCdmAsync(string path) { throw null; } public static bool RemoveCrossOriginWhitelistEntry(string sourceOrigin, string targetProtocol, string targetDomain, bool allowTargetSubdomains) { throw null; } public static void RemoveDisposable(System.IDisposable item) { } public static void RunMessageLoop() { } diff --git a/CefSharp.Core.Runtime/Cef.h b/CefSharp.Core.Runtime/Cef.h index e6673b6393..4404e4d2d2 100644 --- a/CefSharp.Core.Runtime/Cef.h +++ b/CefSharp.Core.Runtime/Cef.h @@ -21,7 +21,6 @@ #include "Internals/CefSharpApp.h" #include "Internals/CefWebPluginInfoVisitorAdapter.h" #include "Internals/CefTaskScheduler.h" -#include "Internals/CefRegisterCdmCallbackAdapter.h" #include "CookieManager.h" #include "CefSettingsBase.h" #include "RequestContext.h" @@ -773,75 +772,6 @@ namespace CefSharp return cef_get_min_log_level(); } - /// - /// Register the Widevine CDM plugin. - /// - /// The client application is responsible for downloading an appropriate - /// platform-specific CDM binary distribution from Google, extracting the - /// contents, and building the required directory structure on the local machine. - /// The method class can be used - /// to implement this functionality in CefSharp. Contact Google via - /// https://www.widevine.com/contact.html for details on CDM download. - /// - /// - /// path is a directory that must contain the following files: - /// 1. manifest.json file from the CDM binary distribution (see below). - /// 2. widevinecdm file from the CDM binary distribution (e.g. - /// widevinecdm.dll on Windows). - /// 3. widevidecdmadapter file from the CEF binary distribution (e.g. - /// widevinecdmadapter.dll on Windows). - /// - /// If any of these files are missing or if the manifest file has incorrect - /// contents the registration will fail and callback will receive an ErrorCode - /// value of . - /// - /// The manifest.json file must contain the following keys: - /// A. "os": Supported OS (e.g. "mac", "win" or "linux"). - /// B. "arch": Supported architecture (e.g. "ia32" or "x64"). - /// C. "x-cdm-module-versions": Module API version (e.g. "4"). - /// D. "x-cdm-interface-versions": Interface API version (e.g. "8"). - /// E. "x-cdm-host-versions": Host API version (e.g. "8"). - /// F. "version": CDM version (e.g. "1.4.8.903"). - /// G. "x-cdm-codecs": List of supported codecs (e.g. "vp8,vp9.0,avc1"). - /// - /// A through E are used to verify compatibility with the current Chromium - /// version. If the CDM is not compatible the registration will fail and - /// callback will receive an ErrorCode value of . - /// - /// If registration is not supported at the time that Cef.RegisterWidevineCdm() is called then callback - /// will receive an ErrorCode value of . - /// - /// is a directory that contains the Widevine CDM files - /// optional callback - - /// will be executed asynchronously once registration is complete - static void RegisterWidevineCdm(String^ path, [Optional] IRegisterCdmCallback^ callback) - { - CefRefPtr adapter = nullptr; - - if (callback != nullptr) - { - adapter = new CefRegisterCdmCallbackAdapter(callback); - } - - CefRegisterWidevineCdm(StringUtils::ToNative(path), adapter); - } - - /// - /// Register the Widevine CDM plugin. - /// - /// See for more details. - /// - /// is a directory that contains the Widevine CDM files - /// Returns a Task that can be awaited to receive the response. - static Task^ RegisterWidevineCdmAsync(String^ path) - { - auto callback = gcnew TaskRegisterCdmCallback(); - - RegisterWidevineCdm(path, callback); - - return callback->Task; - } - /// /// Returns the mime type for the specified file extension or an empty string if unknown. /// diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj index fc0a907f90..38a2874657 100644 --- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj @@ -1,6 +1,6 @@  - + @@ -332,6 +332,7 @@ + @@ -361,6 +362,7 @@ + @@ -391,7 +393,6 @@ - diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj.filters b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj.filters index 24c50aac73..3fc6acc65a 100644 --- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj.filters +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj.filters @@ -83,6 +83,9 @@ Source Files + + Source Files + @@ -232,9 +235,6 @@ Header Files - - Header Files - Header Files @@ -328,6 +328,9 @@ Header Files + + Header Files + diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj index 96c9682835..d72e637e98 100644 --- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj @@ -1,6 +1,6 @@  - + @@ -236,6 +236,7 @@ + @@ -264,6 +265,7 @@ + @@ -293,7 +295,6 @@ - diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters index b22865ade1..01e4f14296 100644 --- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters @@ -83,6 +83,9 @@ Source Files + + Source Files + @@ -232,9 +235,6 @@ Header Files - - Header Files - Header Files @@ -328,6 +328,9 @@ Header Files + + Header Files + diff --git a/CefSharp.Core.Runtime/Internals/CefCompletionCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefCompletionCallbackAdapter.h index c346f141a3..410d11c4b4 100644 --- a/CefSharp.Core.Runtime/Internals/CefCompletionCallbackAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefCompletionCallbackAdapter.h @@ -33,7 +33,7 @@ namespace CefSharp _handler->OnComplete(); } - IMPLEMENT_REFCOUNTING(CefCompletionCallbackAdapter); + IMPLEMENT_REFCOUNTINGM(CefCompletionCallbackAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefCookieAccessFilterAdapter.h b/CefSharp.Core.Runtime/Internals/CefCookieAccessFilterAdapter.h index 04a2ecb3c7..943902e949 100644 --- a/CefSharp.Core.Runtime/Internals/CefCookieAccessFilterAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefCookieAccessFilterAdapter.h @@ -76,7 +76,7 @@ namespace CefSharp return _handler->CanSaveCookie(_browserControl, nullptr, nullptr, %requestWrapper, %responseWrapper, managedCookie); } - IMPLEMENT_REFCOUNTING(CefCookieAccessFilterAdapter); + IMPLEMENT_REFCOUNTINGM(CefCookieAccessFilterAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefCookieVisitorAdapter.h b/CefSharp.Core.Runtime/Internals/CefCookieVisitorAdapter.h index c985354530..0a4af572ee 100644 --- a/CefSharp.Core.Runtime/Internals/CefCookieVisitorAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefCookieVisitorAdapter.h @@ -37,7 +37,7 @@ namespace CefSharp return _visitor->Visit(cookie, count, total, deleteCookie); } - IMPLEMENT_REFCOUNTING(CefCookieVisitorAdapter); + IMPLEMENT_REFCOUNTINGM(CefCookieVisitorAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefDeleteCookiesCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefDeleteCookiesCallbackAdapter.h index f0cd478d65..bf0d2d9ae6 100644 --- a/CefSharp.Core.Runtime/Internals/CefDeleteCookiesCallbackAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefDeleteCookiesCallbackAdapter.h @@ -33,7 +33,7 @@ namespace CefSharp _handler->OnComplete(numDeleted); } - IMPLEMENT_REFCOUNTING(CefDeleteCookiesCallbackAdapter); + IMPLEMENT_REFCOUNTINGM(CefDeleteCookiesCallbackAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefDevToolsMessageObserverAdapter.h b/CefSharp.Core.Runtime/Internals/CefDevToolsMessageObserverAdapter.h index 5b5f1e4595..fea1ff5c23 100644 --- a/CefSharp.Core.Runtime/Internals/CefDevToolsMessageObserverAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefDevToolsMessageObserverAdapter.h @@ -76,7 +76,7 @@ namespace CefSharp _handler->OnDevToolsAgentDetached(%browserWrapper); } - IMPLEMENT_REFCOUNTING(CefDevToolsMessageObserverAdapter); + IMPLEMENT_REFCOUNTINGM(CefDevToolsMessageObserverAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefExtensionHandlerAdapter.h b/CefSharp.Core.Runtime/Internals/CefExtensionHandlerAdapter.h index c352ae6db8..14fa5278d6 100644 --- a/CefSharp.Core.Runtime/Internals/CefExtensionHandlerAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefExtensionHandlerAdapter.h @@ -208,7 +208,7 @@ namespace CefSharp gcnew CefGetExtensionResourceCallbackWrapper(callback)); } - IMPLEMENT_REFCOUNTING(CefExtensionHandlerAdapter); + IMPLEMENT_REFCOUNTINGM(CefExtensionHandlerAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefNavigationEntryVisitorAdapter.h b/CefSharp.Core.Runtime/Internals/CefNavigationEntryVisitorAdapter.h index ce59b2b1ed..882e3c5f05 100644 --- a/CefSharp.Core.Runtime/Internals/CefNavigationEntryVisitorAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefNavigationEntryVisitorAdapter.h @@ -38,7 +38,7 @@ namespace CefSharp return _handler->Visit(navEntry, current, index, total); } - IMPLEMENT_REFCOUNTING(CefNavigationEntryVisitorAdapter); + IMPLEMENT_REFCOUNTINGM(CefNavigationEntryVisitorAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefPdfPrintCallbackWrapper.h b/CefSharp.Core.Runtime/Internals/CefPdfPrintCallbackWrapper.h index d2e513f4f8..fdbdd47132 100644 --- a/CefSharp.Core.Runtime/Internals/CefPdfPrintCallbackWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefPdfPrintCallbackWrapper.h @@ -37,7 +37,7 @@ namespace CefSharp } } - IMPLEMENT_REFCOUNTING(CefPdfPrintCallbackWrapper); + IMPLEMENT_REFCOUNTINGM(CefPdfPrintCallbackWrapper); }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core.Runtime/Internals/CefRefCountManaged.cpp b/CefSharp.Core.Runtime/Internals/CefRefCountManaged.cpp new file mode 100644 index 0000000000..283b0e6321 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefRefCountManaged.cpp @@ -0,0 +1,2 @@ +#include "stdafx.h" +#include "CefRefCountManaged.h" diff --git a/CefSharp.Core.Runtime/Internals/CefRefCountManaged.h b/CefSharp.Core.Runtime/Internals/CefRefCountManaged.h new file mode 100644 index 0000000000..7788376541 --- /dev/null +++ b/CefSharp.Core.Runtime/Internals/CefRefCountManaged.h @@ -0,0 +1,86 @@ +// Copyright © 2021 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. + +#ifndef CEFSHARP_CORE_CEFREFCOUNTEDMANAGED_H +#define CEFSHARP_CORE_CEFREFCOUNTEDMANAGED_H +#pragma once + +#include + +#include "include\base\cef_macros.h" + +class CefRefCountManaged +{ +public: + CefRefCountManaged() : ref_count_(0) + { + } + + /// + // Increment the reference count. + /// + void AddRef() const + { + InterlockedIncrement(&ref_count_); + } + + /// + // Decrement the reference count. Returns true if the reference count is 0. + /// + bool Release() const + { + LONG res = InterlockedDecrement(&ref_count_); + + return res == 0; + } + + /// + // Returns true if the reference count is 1. + /// + bool HasOneRef() const + { + LONG res = InterlockedCompareExchange(&ref_count_, 0, 0); + + return res == 1; + } + + /// + // Returns true if the reference count is at least 1. + /// + bool HasAtLeastOneRef() const + { + LONG res = InterlockedCompareExchange(&ref_count_, 0, 0); + + return res > 0; + } + +private: + mutable volatile LONG ref_count_; + DISALLOW_COPY_AND_ASSIGN(CefRefCountManaged); +}; + + +/// +// Macro that provides a reference counting implementation for classes extending +// CefBase. +/// +#define IMPLEMENT_REFCOUNTINGM(ClassName) \ + public: \ + void AddRef() const override { ref_count_.AddRef(); } \ + bool Release() const override { \ + if (ref_count_.Release()) { \ + delete static_cast(this); \ + return true; \ + } \ + return false; \ + } \ + bool HasOneRef() const override { return ref_count_.HasOneRef(); } \ + bool HasAtLeastOneRef() const override { \ + return ref_count_.HasAtLeastOneRef(); \ + } \ + \ + private: \ + CefRefCountManaged ref_count_ + +#endif // CEFSHARP_CORE_CEFREFCOUNTEDMANAGED_H diff --git a/CefSharp.Core.Runtime/Internals/CefRegisterCdmCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefRegisterCdmCallbackAdapter.h deleted file mode 100644 index c70ea521c3..0000000000 --- a/CefSharp.Core.Runtime/Internals/CefRegisterCdmCallbackAdapter.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright © 2017 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. - -#pragma once - -#include "Stdafx.h" -#include "CefWrapper.h" - -namespace CefSharp -{ - namespace Internals - { - private class CefRegisterCdmCallbackAdapter : public CefRegisterCdmCallback - { - private: - gcroot _callback; - - public: - CefRegisterCdmCallbackAdapter(IRegisterCdmCallback^ callback) - { - _callback = callback; - } - - ~CefRegisterCdmCallbackAdapter() - { - delete _callback; - _callback = nullptr; - } - - /// - /// Method that will be called when CDM registration is complete. |result| - /// will be CEF_CDM_REGISTRATION_ERROR_NONE if registration completed - /// successfully. Otherwise, |result| and |error_message| will contain - /// additional information about why registration failed. - /// - virtual void OnCdmRegistrationComplete(cef_cdm_registration_error_t result, - const CefString& error_message) override - { - auto r = gcnew CdmRegistration((CdmRegistrationErrorCode)result, StringUtils::ToClr(error_message)); - - _callback->OnRegistrationComplete(r); - } - - IMPLEMENT_REFCOUNTING(CefRegisterCdmCallbackAdapter); - }; - } -} diff --git a/CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.h b/CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.h index c738010a72..c3a174b89b 100644 --- a/CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefRequestContextHandlerAdapter.h @@ -49,7 +49,7 @@ namespace CefSharp const CefString& request_initiator, bool& disable_default_handling) override; - IMPLEMENT_REFCOUNTING(CefRequestContextHandlerAdapter); + IMPLEMENT_REFCOUNTINGM(CefRequestContextHandlerAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefResolveCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefResolveCallbackAdapter.h index 00fbcfa13e..f3cf3c76e9 100644 --- a/CefSharp.Core.Runtime/Internals/CefResolveCallbackAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefResolveCallbackAdapter.h @@ -33,7 +33,7 @@ namespace CefSharp _handler->OnResolveCompleted((CefErrorCode)result, StringUtils::ToClr(resolvedIps)); } - IMPLEMENT_REFCOUNTING(CefResolveCallbackAdapter); + IMPLEMENT_REFCOUNTINGM(CefResolveCallbackAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.h b/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.h index 1535607e2b..d03d120bc1 100644 --- a/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefResourceHandlerAdapter.h @@ -44,7 +44,7 @@ namespace CefSharp virtual bool ProcessRequest(CefRefPtr request, CefRefPtr callback) override; virtual bool ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr callback) override; - IMPLEMENT_REFCOUNTING(CefResourceHandlerAdapter); + IMPLEMENT_REFCOUNTINGM(CefResourceHandlerAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefResourceRequestHandlerAdapter.h b/CefSharp.Core.Runtime/Internals/CefResourceRequestHandlerAdapter.h index cda97118d2..2c7cbe5c93 100644 --- a/CefSharp.Core.Runtime/Internals/CefResourceRequestHandlerAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefResourceRequestHandlerAdapter.h @@ -257,7 +257,7 @@ namespace CefSharp } } - IMPLEMENT_REFCOUNTING(CefResourceRequestHandlerAdapter); + IMPLEMENT_REFCOUNTINGM(CefResourceRequestHandlerAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefResponseFilterAdapter.h b/CefSharp.Core.Runtime/Internals/CefResponseFilterAdapter.h index d1f5c3dab0..7ecf3807ad 100644 --- a/CefSharp.Core.Runtime/Internals/CefResponseFilterAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefResponseFilterAdapter.h @@ -79,7 +79,7 @@ namespace CefSharp return (FilterStatus)status; } - IMPLEMENT_REFCOUNTING(CefResponseFilterAdapter); + IMPLEMENT_REFCOUNTINGM(CefResponseFilterAdapter); }; } -} \ No newline at end of file +} diff --git a/CefSharp.Core.Runtime/Internals/CefRunFileDialogCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefRunFileDialogCallbackAdapter.h index efb8be6cbc..8b360c4a77 100644 --- a/CefSharp.Core.Runtime/Internals/CefRunFileDialogCallbackAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefRunFileDialogCallbackAdapter.h @@ -38,7 +38,7 @@ namespace CefSharp } } - IMPLEMENT_REFCOUNTING(CefRunFileDialogCallbackAdapter); + IMPLEMENT_REFCOUNTINGM(CefRunFileDialogCallbackAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefSchemeHandlerFactoryAdapter.h b/CefSharp.Core.Runtime/Internals/CefSchemeHandlerFactoryAdapter.h index 811b6de1b2..e2ff28f40f 100644 --- a/CefSharp.Core.Runtime/Internals/CefSchemeHandlerFactoryAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefSchemeHandlerFactoryAdapter.h @@ -84,7 +84,7 @@ namespace CefSharp return new CefResourceHandlerAdapter(handler); } - IMPLEMENT_REFCOUNTING(CefSchemeHandlerFactoryAdapter); + IMPLEMENT_REFCOUNTINGM(CefSchemeHandlerFactoryAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefSetCookieCallbackAdapter.h b/CefSharp.Core.Runtime/Internals/CefSetCookieCallbackAdapter.h index ab100c2cdd..4ad2a5c0dd 100644 --- a/CefSharp.Core.Runtime/Internals/CefSetCookieCallbackAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefSetCookieCallbackAdapter.h @@ -33,7 +33,7 @@ namespace CefSharp _handler->OnComplete(success); } - IMPLEMENT_REFCOUNTING(CefSetCookieCallbackAdapter); + IMPLEMENT_REFCOUNTINGM(CefSetCookieCallbackAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefSharpApp.h b/CefSharp.Core.Runtime/Internals/CefSharpApp.h index 404606c99c..b3ba15a7c9 100644 --- a/CefSharp.Core.Runtime/Internals/CefSharpApp.h +++ b/CefSharp.Core.Runtime/Internals/CefSharpApp.h @@ -208,7 +208,7 @@ namespace CefSharp } }; - IMPLEMENT_REFCOUNTING(CefSharpApp); + IMPLEMENT_REFCOUNTINGM(CefSharpApp); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefStringVisitorAdapter.h b/CefSharp.Core.Runtime/Internals/CefStringVisitorAdapter.h index 429e3620e3..3c9d8e6851 100644 --- a/CefSharp.Core.Runtime/Internals/CefStringVisitorAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefStringVisitorAdapter.h @@ -33,7 +33,7 @@ namespace CefSharp _visitor->Visit(StringUtils::ToClr(string)); } - IMPLEMENT_REFCOUNTING(CefStringVisitorAdapter); + IMPLEMENT_REFCOUNTINGM(CefStringVisitorAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefTaskWrapper.h b/CefSharp.Core.Runtime/Internals/CefTaskWrapper.h index 6a7f59c3c0..726d7df109 100644 --- a/CefSharp.Core.Runtime/Internals/CefTaskWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefTaskWrapper.h @@ -45,7 +45,7 @@ namespace CefSharp } }; - IMPLEMENT_REFCOUNTING(CefTaskWrapper); + IMPLEMENT_REFCOUNTINGM(CefTaskWrapper); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.h b/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.h index 3d762c693b..64a8c88336 100644 --- a/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefUrlRequestClientAdapter.h @@ -88,7 +88,7 @@ namespace CefSharp const CefString& scheme, CefRefPtr callback) override; - IMPLEMENT_REFCOUNTING(CefUrlRequestClientAdapter); + IMPLEMENT_REFCOUNTINGM(CefUrlRequestClientAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefWebPluginInfoVisitorAdapter.h b/CefSharp.Core.Runtime/Internals/CefWebPluginInfoVisitorAdapter.h index d30330a32d..7fbba56e41 100644 --- a/CefSharp.Core.Runtime/Internals/CefWebPluginInfoVisitorAdapter.h +++ b/CefSharp.Core.Runtime/Internals/CefWebPluginInfoVisitorAdapter.h @@ -38,7 +38,7 @@ namespace CefSharp return _visitor->Visit(plugin, count, total); } - IMPLEMENT_REFCOUNTING(CefWebPluginInfoVisitorAdapter); + IMPLEMENT_REFCOUNTINGM(CefWebPluginInfoVisitorAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/CefWriteHandlerWrapper.h b/CefSharp.Core.Runtime/Internals/CefWriteHandlerWrapper.h index bdc4c07213..9aee3cbd00 100644 --- a/CefSharp.Core.Runtime/Internals/CefWriteHandlerWrapper.h +++ b/CefSharp.Core.Runtime/Internals/CefWriteHandlerWrapper.h @@ -109,7 +109,7 @@ namespace CefSharp return !_isMemoryStream; } - IMPLEMENT_REFCOUNTING(CefWriteHandlerWrapper); + IMPLEMENT_REFCOUNTINGM(CefWriteHandlerWrapper); }; } } diff --git a/CefSharp.Core.Runtime/Internals/ClientAdapter.h b/CefSharp.Core.Runtime/Internals/ClientAdapter.h index 57d055a578..7359cd856d 100644 --- a/CefSharp.Core.Runtime/Internals/ClientAdapter.h +++ b/CefSharp.Core.Runtime/Internals/ClientAdapter.h @@ -201,7 +201,7 @@ namespace CefSharp virtual DECL void OnAudioStreamStopped(CefRefPtr browser) override; virtual DECL void OnAudioStreamError(CefRefPtr browser, const CefString& message) override; - IMPLEMENT_REFCOUNTING(ClientAdapter); + IMPLEMENT_REFCOUNTINGM(ClientAdapter); }; } } diff --git a/CefSharp.Core.Runtime/Internals/RenderClientAdapter.h b/CefSharp.Core.Runtime/Internals/RenderClientAdapter.h index 2f1edd6e34..b1c3ebc864 100644 --- a/CefSharp.Core.Runtime/Internals/RenderClientAdapter.h +++ b/CefSharp.Core.Runtime/Internals/RenderClientAdapter.h @@ -245,7 +245,7 @@ namespace CefSharp _renderWebBrowser->OnVirtualKeyboardRequested(GetBrowserWrapper(browser->GetIdentifier()), (CefSharp::Enums::TextInputMode)input_mode); } - IMPLEMENT_REFCOUNTING(RenderClientAdapter); + IMPLEMENT_REFCOUNTINGM(RenderClientAdapter); }; } } diff --git a/CefSharp.Core.Runtime/PostData.h b/CefSharp.Core.Runtime/PostData.h index 3bbef8749a..f665d315c5 100644 --- a/CefSharp.Core.Runtime/PostData.h +++ b/CefSharp.Core.Runtime/PostData.h @@ -92,7 +92,7 @@ namespace CefSharp /// PostData() { - _postData = CefPostData::Create(); + _postData = CefPostData::Create().get(); } /// diff --git a/CefSharp.Core.Runtime/PostDataElement.h b/CefSharp.Core.Runtime/PostDataElement.h index 4a7ad78852..3daea5673b 100644 --- a/CefSharp.Core.Runtime/PostDataElement.h +++ b/CefSharp.Core.Runtime/PostDataElement.h @@ -51,7 +51,7 @@ namespace CefSharp public: PostDataElement() { - _postDataElement = CefPostDataElement::Create(); + _postDataElement = CefPostDataElement::Create().get(); } virtual property bool IsReadOnly diff --git a/CefSharp.Core.Runtime/Request.h b/CefSharp.Core.Runtime/Request.h index 1fa2fa1e43..e94976fff7 100644 --- a/CefSharp.Core.Runtime/Request.h +++ b/CefSharp.Core.Runtime/Request.h @@ -60,7 +60,7 @@ namespace CefSharp public: Request() { - _request = CefRequest::Create(); + _request = CefRequest::Create().get(); } virtual property UrlRequestFlags Flags { UrlRequestFlags get(); void set(UrlRequestFlags flags); } diff --git a/CefSharp.Core.Runtime/RequestContext.cpp b/CefSharp.Core.Runtime/RequestContext.cpp index f337651f09..6c46d33895 100644 --- a/CefSharp.Core.Runtime/RequestContext.cpp +++ b/CefSharp.Core.Runtime/RequestContext.cpp @@ -7,18 +7,6 @@ #include "include\cef_parser.h" -//For the x86 version we define and undefine CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_ -//as the /clr compliation option attempts to be helpful and convers all the __fastcall versions -//to __stdcall which already exist, so we just use the standard calling convention and ignore -//the optimised ones. The original error is -//warning C4561: '__fastcall' incompatible with the '/clr' option: converting to '__stdcall' -//(compiling source file RequestContext.cpp) -#define CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_ -#include "include\base\cef_bind.h" -#undef CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_ - -#include "include\wrapper\cef_closure_task.h" - #include "CookieManager.h" #include "Internals\CefSchemeHandlerFactoryAdapter.h" #include "Internals\CefCompletionCallbackAdapter.h" @@ -259,14 +247,7 @@ namespace CefSharp CefRefPtr extensionHandler = handler == nullptr ? nullptr : new CefExtensionHandlerAdapter(handler); - if (CefCurrentlyOn(CefThreadId::TID_UI)) - { - _requestContext->LoadExtension(StringUtils::ToNative(rootDirectory), manifest, extensionHandler); - } - else - { - CefPostTask(TID_UI, base::Bind(&CefRequestContext::LoadExtension, _requestContext.get(), StringUtils::ToNative(rootDirectory), manifest, extensionHandler)); - } + _requestContext->LoadExtension(StringUtils::ToNative(rootDirectory), manifest, extensionHandler); } IRequestContext^ RequestContext::UnWrap() diff --git a/CefSharp.Core.Runtime/RequestContext.h b/CefSharp.Core.Runtime/RequestContext.h index 7a8f86e794..0c4d0660af 100644 --- a/CefSharp.Core.Runtime/RequestContext.h +++ b/CefSharp.Core.Runtime/RequestContext.h @@ -44,7 +44,7 @@ namespace CefSharp internal: RequestContext(CefRefPtr& context) { - _requestContext = context; + _requestContext = context.get(); _settings = nullptr; } @@ -61,38 +61,38 @@ namespace CefSharp RequestContext() { CefRequestContextSettings settings; - _requestContext = CefRequestContext::CreateContext(settings, nullptr); + _requestContext = CefRequestContext::CreateContext(settings, nullptr).get(); } RequestContext(RequestContextSettings^ settings) : _settings(settings) { PathCheck::AssertAbsolute(settings->CachePath, "RequestContextSettings.CachePath"); - _requestContext = CefRequestContext::CreateContext(settings, nullptr); + _requestContext = CefRequestContext::CreateContext(settings, nullptr).get(); } RequestContext(IRequestContextHandler^ requestContextHandler) { CefRequestContextSettings settings; - _requestContext = CefRequestContext::CreateContext(settings, new CefRequestContextHandlerAdapter(requestContextHandler)); + _requestContext = CefRequestContext::CreateContext(settings, new CefRequestContextHandlerAdapter(requestContextHandler)).get(); } RequestContext(RequestContextSettings^ settings, IRequestContextHandler^ requestContextHandler) : _settings(settings) { PathCheck::AssertAbsolute(settings->CachePath, "RequestContextSettings.CachePath"); - _requestContext = CefRequestContext::CreateContext(settings, new CefRequestContextHandlerAdapter(requestContextHandler)); + _requestContext = CefRequestContext::CreateContext(settings, new CefRequestContextHandlerAdapter(requestContextHandler)).get(); } ///Creates a new context object that shares storage with | other | and uses an optional | handler | . RequestContext(IRequestContext^ otherRequestContext) { - _requestContext = CefRequestContext::CreateContext((RequestContext^)otherRequestContext->UnWrap(), nullptr); + _requestContext = CefRequestContext::CreateContext((RequestContext^)otherRequestContext->UnWrap(), nullptr).get(); } RequestContext(IRequestContext^ otherRequestContext, IRequestContextHandler^ requestContextHandler) { - _requestContext = CefRequestContext::CreateContext((RequestContext^)otherRequestContext->UnWrap(), new CefRequestContextHandlerAdapter(requestContextHandler)); + _requestContext = CefRequestContext::CreateContext((RequestContext^)otherRequestContext->UnWrap(), new CefRequestContextHandlerAdapter(requestContextHandler)).get(); } !RequestContext() diff --git a/CefSharp.Core.Runtime/Stdafx.h b/CefSharp.Core.Runtime/Stdafx.h index b08bc4b554..7214f76f35 100644 --- a/CefSharp.Core.Runtime/Stdafx.h +++ b/CefSharp.Core.Runtime/Stdafx.h @@ -15,10 +15,11 @@ #include +#include "Internals\CefRefCountManaged.h" #include "Internals\MCefRefPtr.h" #include "Internals\StringUtils.h" #include "vcclr_local.h" using namespace CefSharp; using namespace CefSharp::Internals; -using namespace System; \ No newline at end of file +using namespace System; diff --git a/CefSharp.Core.Runtime/UrlRequest.h b/CefSharp.Core.Runtime/UrlRequest.h index 32fa55b81e..02ab9f758e 100644 --- a/CefSharp.Core.Runtime/UrlRequest.h +++ b/CefSharp.Core.Runtime/UrlRequest.h @@ -60,7 +60,7 @@ namespace CefSharp throw gcnew ArgumentNullException("urlRequestClient"); } - _urlRequest = CefURLRequest::Create((Request^)request, new CefUrlRequestClientAdapter(urlRequestClient), (RequestContext^)requestContext); + _urlRequest = CefURLRequest::Create((Request^)request, new CefUrlRequestClientAdapter(urlRequestClient), (RequestContext^)requestContext).get(); } /// diff --git a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config index 136bba42ba..5a2078807c 100644 --- a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config +++ b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config index e4025a68b5..48e863d08d 100644 --- a/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config +++ b/CefSharp.Core.Runtime/packages.CefSharp.Core.Runtime.netcore.config @@ -1,6 +1,6 @@  - + diff --git a/CefSharp.Core/Cef.cs b/CefSharp.Core/Cef.cs index a5b79024ab..5b63c7e67c 100644 --- a/CefSharp.Core/Cef.cs +++ b/CefSharp.Core/Cef.cs @@ -582,64 +582,6 @@ public static LogSeverity GetMinLogLevel() return (LogSeverity)severity; } - /// - /// Register the Widevine CDM plugin. - /// - /// The client application is responsible for downloading an appropriate - /// platform-specific CDM binary distribution from Google, extracting the - /// contents, and building the required directory structure on the local machine. - /// The method class can be used - /// to implement this functionality in CefSharp. Contact Google via - /// https://www.widevine.com/contact.html for details on CDM download. - /// - /// - /// path is a directory that must contain the following files: - /// 1. manifest.json file from the CDM binary distribution (see below). - /// 2. widevinecdm file from the CDM binary distribution (e.g. - /// widevinecdm.dll on Windows). - /// 3. widevidecdmadapter file from the CEF binary distribution (e.g. - /// widevinecdmadapter.dll on Windows). - /// - /// If any of these files are missing or if the manifest file has incorrect - /// contents the registration will fail and callback will receive an ErrorCode - /// value of . - /// - /// The manifest.json file must contain the following keys: - /// A. "os": Supported OS (e.g. "mac", "win" or "linux"). - /// B. "arch": Supported architecture (e.g. "ia32" or "x64"). - /// C. "x-cdm-module-versions": Module API version (e.g. "4"). - /// D. "x-cdm-interface-versions": Interface API version (e.g. "8"). - /// E. "x-cdm-host-versions": Host API version (e.g. "8"). - /// F. "version": CDM version (e.g. "1.4.8.903"). - /// G. "x-cdm-codecs": List of supported codecs (e.g. "vp8,vp9.0,avc1"). - /// - /// A through E are used to verify compatibility with the current Chromium - /// version. If the CDM is not compatible the registration will fail and - /// callback will receive an ErrorCode value of . - /// - /// If registration is not supported at the time that Cef.RegisterWidevineCdm() is called then callback - /// will receive an ErrorCode value of . - /// - /// is a directory that contains the Widevine CDM files - /// optional callback - - /// will be executed asynchronously once registration is complete - public static void RegisterWidevineCdm(string path, IRegisterCdmCallback callback = null) - { - Core.Cef.RegisterWidevineCdm(path, callback); - } - - /// - /// Register the Widevine CDM plugin. - /// - /// See for more details. - /// - /// is a directory that contains the Widevine CDM files - /// Returns a Task that can be awaited to receive the response. - public static Task RegisterWidevineCdmAsync(string path) - { - return Core.Cef.RegisterWidevineCdmAsync(path); - } - /// /// Returns the mime type for the specified file extension or an empty string if unknown. /// diff --git a/CefSharp.Core/CefSharp.Core.csproj b/CefSharp.Core/CefSharp.Core.csproj index 8619855fef..1f86e02c8e 100644 --- a/CefSharp.Core/CefSharp.Core.csproj +++ b/CefSharp.Core/CefSharp.Core.csproj @@ -1,7 +1,6 @@  - Debug diff --git a/CefSharp.Core/RequestContext.cs b/CefSharp.Core/RequestContext.cs index f70d46c7eb..27aeaaaf75 100644 --- a/CefSharp.Core/RequestContext.cs +++ b/CefSharp.Core/RequestContext.cs @@ -198,7 +198,17 @@ public bool HasExtension(string extensionId) /// public void LoadExtension(string rootDirectory, string manifestJson, IExtensionHandler handler) { - requestContext.LoadExtension(rootDirectory, manifestJson, handler); + if (Cef.CurrentlyOnThread(CefThreadIds.TID_UI)) + { + requestContext.LoadExtension(rootDirectory, manifestJson, handler); + } + else + { + Cef.UIThreadTaskFactory.StartNew(() => + { + requestContext.LoadExtension(rootDirectory, manifestJson, handler); + }); + } } /// diff --git a/CefSharp.Core/RequestContext.netcore.cs b/CefSharp.Core/RequestContext.netcore.cs index 12a470970b..a41fc2d576 100644 --- a/CefSharp.Core/RequestContext.netcore.cs +++ b/CefSharp.Core/RequestContext.netcore.cs @@ -41,6 +41,21 @@ public RequestContext(CefSharp.RequestContextSettings settings, CefSharp.IReques { } + public override void LoadExtension(string rootDirectory, string manifestJson, IExtensionHandler handler) + { + if (Cef.CurrentlyOnThread(CefThreadIds.TID_UI)) + { + base.LoadExtension(rootDirectory, manifestJson, handler); + } + else + { + Cef.UIThreadTaskFactory.StartNew(() => + { + base.LoadExtension(rootDirectory, manifestJson, handler); + }); + } + } + /// /// Creates a new RequestContextBuilder which can be used to fluently set /// preferences diff --git a/CefSharp.Core/packages.config b/CefSharp.Core/packages.config index e2934c28ce..8d650f3462 100644 --- a/CefSharp.Core/packages.config +++ b/CefSharp.Core/packages.config @@ -1,5 +1,4 @@  - \ No newline at end of file diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs index a121fe9c77..d5810ab4de 100644 --- a/CefSharp.Example/CefExample.cs +++ b/CefSharp.Example/CefExample.cs @@ -59,10 +59,6 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser // Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_ID", ""); // Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_SECRET", ""); - // Widevine CDM registration - pass in directory where Widevine CDM binaries and manifest.json are located. - // For more information on support for DRM content with Widevine see: https://github.com/cefsharp/CefSharp/issues/1934 - //Cef.RegisterWidevineCdm(@".\WidevineCdm"); - //Chromium Command Line args //http://peter.sh/experiments/chromium-command-line-switches/ //NOTE: Not all relevant in relation to `CefSharp`, use for reference purposes only. diff --git a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj index 4bf3e88c59..e21fa60fea 100644 --- a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj +++ b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj @@ -1,8 +1,7 @@  - - - + + Debug diff --git a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj index 1a5438df39..7e24a0e8ec 100644 --- a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj +++ b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj @@ -38,7 +38,7 @@ - + diff --git a/CefSharp.OffScreen.Example/packages.config b/CefSharp.OffScreen.Example/packages.config index c61a08c233..c7ede7e90b 100644 --- a/CefSharp.OffScreen.Example/packages.config +++ b/CefSharp.OffScreen.Example/packages.config @@ -1,6 +1,5 @@  - - - + + \ No newline at end of file diff --git a/CefSharp.OffScreen/CefSharp.OffScreen.csproj b/CefSharp.OffScreen/CefSharp.OffScreen.csproj index 32348bae50..b891358e36 100644 --- a/CefSharp.OffScreen/CefSharp.OffScreen.csproj +++ b/CefSharp.OffScreen/CefSharp.OffScreen.csproj @@ -1,7 +1,6 @@  - Debug diff --git a/CefSharp.OffScreen/packages.config b/CefSharp.OffScreen/packages.config index e2934c28ce..8d650f3462 100644 --- a/CefSharp.OffScreen/packages.config +++ b/CefSharp.OffScreen/packages.config @@ -1,5 +1,4 @@  - \ No newline at end of file diff --git a/CefSharp.Test/CefSharp.Test.csproj b/CefSharp.Test/CefSharp.Test.csproj index d558422c29..ee64c4c88e 100644 --- a/CefSharp.Test/CefSharp.Test.csproj +++ b/CefSharp.Test/CefSharp.Test.csproj @@ -1,8 +1,7 @@  - - - + + Debug diff --git a/CefSharp.Test/CefSharp.Test.netcore.csproj b/CefSharp.Test/CefSharp.Test.netcore.csproj index 1151b60b49..2803c091e2 100644 --- a/CefSharp.Test/CefSharp.Test.netcore.csproj +++ b/CefSharp.Test/CefSharp.Test.netcore.csproj @@ -34,7 +34,7 @@ - + diff --git a/CefSharp.Test/packages.config b/CefSharp.Test/packages.config index 07623eb25a..7577309b93 100644 --- a/CefSharp.Test/packages.config +++ b/CefSharp.Test/packages.config @@ -2,9 +2,8 @@ - - - + + diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj index 4b3f9b5624..b9771006c0 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj @@ -1,8 +1,7 @@  - - - + + Debug AnyCPU diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj index 38950f8329..cb89f97952 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj @@ -38,7 +38,7 @@ - + diff --git a/CefSharp.WinForms.Example/packages.config b/CefSharp.WinForms.Example/packages.config index c61a08c233..c7ede7e90b 100644 --- a/CefSharp.WinForms.Example/packages.config +++ b/CefSharp.WinForms.Example/packages.config @@ -1,6 +1,5 @@  - - - + + \ No newline at end of file diff --git a/CefSharp.WinForms/CefSharp.WinForms.csproj b/CefSharp.WinForms/CefSharp.WinForms.csproj index 82d9aff0bf..2afe926ce5 100644 --- a/CefSharp.WinForms/CefSharp.WinForms.csproj +++ b/CefSharp.WinForms/CefSharp.WinForms.csproj @@ -1,7 +1,6 @@  - Debug diff --git a/CefSharp.WinForms/packages.config b/CefSharp.WinForms/packages.config index e2934c28ce..8d650f3462 100644 --- a/CefSharp.WinForms/packages.config +++ b/CefSharp.WinForms/packages.config @@ -1,5 +1,4 @@  - \ No newline at end of file diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 778cd99223..e2d0912721 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -1,8 +1,7 @@  - - - + + Debug AnyCPU diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj index 194c735044..0efb452f0f 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj @@ -39,7 +39,7 @@ - + diff --git a/CefSharp.Wpf.Example/packages.config b/CefSharp.Wpf.Example/packages.config index c61a08c233..c7ede7e90b 100644 --- a/CefSharp.Wpf.Example/packages.config +++ b/CefSharp.Wpf.Example/packages.config @@ -1,6 +1,5 @@  - - - + + \ No newline at end of file diff --git a/CefSharp.Wpf/CefSharp.Wpf.csproj b/CefSharp.Wpf/CefSharp.Wpf.csproj index 073a6a2f02..d819fe985a 100644 --- a/CefSharp.Wpf/CefSharp.Wpf.csproj +++ b/CefSharp.Wpf/CefSharp.Wpf.csproj @@ -1,7 +1,6 @@  - Debug AnyCPU diff --git a/CefSharp.Wpf/packages.config b/CefSharp.Wpf/packages.config index e2934c28ce..8d650f3462 100644 --- a/CefSharp.Wpf/packages.config +++ b/CefSharp.Wpf/packages.config @@ -1,5 +1,4 @@  - \ No newline at end of file diff --git a/CefSharp.props b/CefSharp.props index 5548ea3618..5c6685b810 100644 --- a/CefSharp.props +++ b/CefSharp.props @@ -2,18 +2,17 @@ - 2013 - 2015 - 2017 - 2017 - 2019 + 2019 + + + - v120 - v140 + v142 + + + 10.0 - /// Content Decryption Module (CDM) registration callback used for asynchronous completion. - /// - public interface IRegisterCdmCallback : IDisposable - { - /// - /// Method that will be called once CDM registration is complete - /// - /// The result of the CDM registration process - void OnRegistrationComplete(CdmRegistration registration); - - /// - /// Gets a value indicating whether the callback has been disposed of. - /// - bool IsDisposed { get; } - } -} diff --git a/CefSharp/Callback/TaskRegisterCdmCallback.cs b/CefSharp/Callback/TaskRegisterCdmCallback.cs deleted file mode 100644 index 3cc66cb440..0000000000 --- a/CefSharp/Callback/TaskRegisterCdmCallback.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright © 2017 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. - -using System; -using System.Threading.Tasks; -using CefSharp.Internals; - -namespace CefSharp -{ - /// - /// Provides a callback implementation of for use with asynchronous Widevine CDM registration. - /// - public class TaskRegisterCdmCallback : IRegisterCdmCallback - { - private readonly TaskCompletionSource taskCompletionSource; - private volatile bool isDisposed; - private bool onComplete; //Only ever accessed on the same CEF thread, so no need for thread safety - - /// - /// Initializes a new instance of the TaskRegisterCdmCallback class. - /// - public TaskRegisterCdmCallback() - { - taskCompletionSource = new TaskCompletionSource(); - } - - void IRegisterCdmCallback.OnRegistrationComplete(CdmRegistration registration) - { - onComplete = true; - - taskCompletionSource.TrySetResultAsync(registration); - } - - /// - /// Task used to await this callback - /// - public Task Task - { - get { return taskCompletionSource.Task; } - } - - bool IRegisterCdmCallback.IsDisposed - { - get { return isDisposed; } - } - - void IDisposable.Dispose() - { - var task = taskCompletionSource.Task; - - //If onComplete is false then IRegisterCdmCallback.OnRegistrationComplete was never called, - //so we'll set the result to false. Calling TrySetResultAsync multiple times - //can result in the issue outlined in https://github.com/cefsharp/CefSharp/pull/2349 - if (onComplete == false && task.IsCompleted == false) - { - taskCompletionSource.TrySetResultAsync(null); - } - - isDisposed = true; - } - } -} diff --git a/CefSharp/CdmRegistration.cs b/CefSharp/CdmRegistration.cs deleted file mode 100644 index 0de0f8bef8..0000000000 --- a/CefSharp/CdmRegistration.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2017 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. - -namespace CefSharp -{ - /// - /// Represents the response to an attempt to register the Widevine Content Decryption Module (CDM) - /// - public sealed class CdmRegistration - { - /// - /// If CDM registration succeeded then value will be , for other values see the enumeration . - /// - public CdmRegistrationErrorCode ErrorCode { get; private set; } - - /// - /// Contains an error message containing additional information if is not . - /// - public string ErrorMessage { get; private set; } - - /// - /// CdmRegistration - /// - /// error code - /// error message - public CdmRegistration(CdmRegistrationErrorCode errorCode, string errorMessage) - { - ErrorCode = errorCode; - ErrorMessage = errorMessage; - } - } -} diff --git a/CefSharp/CefSharp.csproj b/CefSharp/CefSharp.csproj index 6642190beb..6cceb92a7a 100644 --- a/CefSharp/CefSharp.csproj +++ b/CefSharp/CefSharp.csproj @@ -1,7 +1,6 @@  - Debug @@ -69,7 +68,6 @@ - @@ -81,11 +79,9 @@ - - @@ -208,7 +204,6 @@ - diff --git a/CefSharp/Enums/CdmRegistrationErrorCode.cs b/CefSharp/Enums/CdmRegistrationErrorCode.cs deleted file mode 100644 index d413186f95..0000000000 --- a/CefSharp/Enums/CdmRegistrationErrorCode.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright © 2017 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. - -namespace CefSharp -{ - /// - /// Lists the errors that can be reported during Widevine Content Decryption Module (CDM) registration. - /// - public enum CdmRegistrationErrorCode - { - /// - /// No error. Registration completed successfully. - /// - None, - - /// - /// Required files or manifest contents are missing. - /// - IncorrectContents, - - /// - /// The CDM is incompatible with the current Chromium version. - /// - Incompatible, - - /// - /// CDM registration is not supported at this time. - /// - NotSupported, - } -} diff --git a/CefSharp/packages.config b/CefSharp/packages.config index e2934c28ce..8d650f3462 100644 --- a/CefSharp/packages.config +++ b/CefSharp/packages.config @@ -1,5 +1,4 @@  - \ No newline at end of file diff --git a/NuGet/Readme.txt b/NuGet/Readme.txt index 3ccf819913..d4b49d7eb6 100644 --- a/NuGet/Readme.txt +++ b/NuGet/Readme.txt @@ -10,26 +10,26 @@ Post Installation: - For `x86` or x64` set your projects PlatformTarget architecture to `x86` or `x64`. - `AnyCPU` target is supported though requires additional code/changes see https://github.com/cefsharp/CefSharp/issues/1714 for details. - Check your output `\bin` directory to make sure the appropriate references have been copied. - - Add an app.manifest to your exe if you don't already have one, it's required for Windows 10 compatability, HighDPI support and tooltips. The https://github.com/cefsharp/CefSharp.MinimalExample project contains an example app.manifest file in the root of the WPF/WinForms/OffScreen examples. + - Add an app.manifest to your exe if you don't already have one, it's required for Windows 10 compatability, HighDPI support and tooltips. The https://github.com/cefsharp/CefSharp.MinimalExample project contains an example app.manifest file in the root of the WPF/WinForms/OffScreen examples. Deployment: - - Make sure a minimum of `Visual C++ 2015` is installed (`x86` or x64` depending on your build) or package the runtime dlls with your application, see the FAQ for details. + - Make sure a minimum of `Visual C++ 2019` is installed (`x86` or x64` depending on your build) or package the runtime dlls with your application, see the FAQ for details. What's New: See https://github.com/cefsharp/CefSharp/wiki/ChangeLog - IMPORTANT NOTE - Visual C++ 2015 is now required + IMPORTANT NOTE - Visual C++ 2019 is now required IMPORTANT NOTE - .NET Framework 4.5.2 is now required. IMPORTANT NOTE - Chromium has removed support for Windows XP/2003 and Windows Vista/Server 2008 (non R2). Basic Troubleshooting: - Minimum of .Net 4.5.2 - - Minimum of `Visual C++ 2015 Redist` is installed (either `x86` or `x64` depending on your application). VC++ 2017/2019 are backwards compatible. + - Minimum of `Visual C++ 2019 Redist` is installed (either `x86` or `x64` depending on your application). - Please ensure your binaries directory contains these required dependencies: * libcef.dll (Chromium Embedded Framework Core library) * icudtl.dat (Unicode Support data) * chrome_elf.dll(Crash reporting library) * snapshot_blob.bin, v8_context_snapshot.bin (V8 snapshot data) - * locales\en-US.pak, cef.pak, cef_100_percent.pak, cef_200_percent.pak, cef_extensions.pak, devtools_resources.pak, d3dcompiler_47.dll, libEGL.dll, libGLESv2.dll, swiftshader/libEGL.dll, swiftshader/libGLESv2.dll + * locales\en-US.pak, chrome_100_percent.pak, chrome_200_percent.pak, resources.pak, d3dcompiler_47.dll, libEGL.dll, libGLESv2.dll, swiftshader/libEGL.dll, swiftshader/libGLESv2.dll - Whilst these are technically listed as optional, the browser is unlikely to function without these files. - See https://github.com/cefsharp/CefSharp/wiki/Output-files-description-table-%28Redistribution%29 for details * CefSharp.Core.dll, CefSharp.dll, CefSharp.Core.Runtime.dll @@ -40,8 +40,7 @@ Basic Troubleshooting: * CefSharp.Wpf.dll * CefSharp.OffScreen.dll - Additional CEF files are described at: https://github.com/cefsharp/CefSharp/wiki/Output-files-description-table-%28Redistribution%29 - Whilst technically optional the bin - NOTE: CefSharp does not currently support CEF sandboxing. + - NOTE: CefSharp does not currently support CEF sandboxing. - By default `CEF` has it's own log file, `Debug.log` which is located in your executing folder. e.g. `bin` For further help please read the following content: diff --git a/README.md b/README.md index 02a32ac924..e1053be653 100644 --- a/README.md +++ b/README.md @@ -82,14 +82,14 @@ Every commit on `master` produces a `Nuget` package. Use at your own risk! With each release a new branch is created, for example the `79.1.360` release corresponds to the `cefsharp/79` branch. If you're new to `CefSharp` and are downloading the source to check it out, please use a **Release** branch. -***** For .Net Core Packages VC++ 2019 is required
+***** VC++ 2019 is required starting with version 93
****** For .Net Core Packages .Net Core 3.1/.Net 5.0 is required. | Branch | CEF Version | VC++ Version | .Net Version | Status | |----------------------------------------------------------------------|------|-------|---------|-----------------| -| [master](https://github.com/cefsharp/CefSharp/) | 4515 | 2015* | 4.5.2** | Development | +| [master](https://github.com/cefsharp/CefSharp/) | 4577 | 2019* | 4.5.2** | Development | | [cefsharp/92](https://github.com/cefsharp/CefSharp/tree/cefsharp/92) | 4515 | 2015* | 4.5.2** | **Release** | -| [cefsharp/91](https://github.com/cefsharp/CefSharp/tree/cefsharp/91) | 4472 | 2015* | 4.5.2** | **Release** | +| [cefsharp/91](https://github.com/cefsharp/CefSharp/tree/cefsharp/91) | 4472 | 2015* | 4.5.2** | Unsupported | | [cefsharp/90](https://github.com/cefsharp/CefSharp/tree/cefsharp/90) | 4430 | 2015* | 4.5.2** | Unsupported | | [cefsharp/89](https://github.com/cefsharp/CefSharp/tree/cefsharp/89) | 4389 | 2015* | 4.5.2** | Unsupported | | [cefsharp/88](https://github.com/cefsharp/CefSharp/tree/cefsharp/88) | 4324 | 2015* | 4.5.2** | Unsupported | @@ -121,7 +121,7 @@ If you're new to `CefSharp` and are downloading the source to check it out, plea | [cefsharp/39](https://github.com/cefsharp/CefSharp/tree/cefsharp/39) | 2171 | 2012 | 4.0 | Unsupported | | [cefsharp/37](https://github.com/cefsharp/CefSharp/tree/cefsharp/37) | 2062 | 2012 | 4.0 | Unsupported | -***** For .Net Core Packages VC++ 2019 is required
+***** VC++ 2019 is required starting with version 93
****** For .Net Core Packages .Net Core 3.1/.Net 5.0 is required. ## Financial Support diff --git a/UpdateNugetPackages.ps1 b/UpdateNugetPackages.ps1 index 48a726ecec..ce0797fdf0 100644 --- a/UpdateNugetPackages.ps1 +++ b/UpdateNugetPackages.ps1 @@ -6,7 +6,7 @@ # Update the .Net 4.5.2 csproj files using nuget.exe # Update the .Net Core csproj files modifying the xml file directly -$CefVersion = '92.0.25' +$CefVersion = '93.1.7' function RemoveEnsureNuGetPackageBuildImports { diff --git a/appveyor.yml b/appveyor.yml index 5694fd3831..08657f55d1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ -version: 92.0.250-CI{build} +version: 93.1.70-CI{build} image: - - Visual Studio 2015 +# - Visual Studio 2019 Preview - Visual Studio 2019 clone_depth: 10 @@ -11,26 +11,35 @@ matrix: configuration: Release -for: - - - matrix: - only: - - image: Visual Studio 2015 - build_script: - - ps: .\build.ps1 - test: +#for: +# - +# matrix: +# only: +# - image: Visual Studio 2019 +# build_script: +# - ps: .\build.ps1 +# test: # Test our Release x64 build - assemblies: - - CefSharp.Test\bin\x64\Release\CefSharp.Test.dll - - - matrix: - only: - - image: Visual Studio 2019 - build_script: - - ps: .\build.netcore.ps1 - test_script: +# assemblies: +# - CefSharp.Test\bin\x64\Release\CefSharp.Test.dll +# - +# matrix: +# only: +# - image: Visual Studio 2019 Preview +# build_script: +# - ps: .\build.netcore.ps1 +# test_script: # Test our Release x64 build - dotnet test CefSharp.Test\bin.netcore\x64\Release\netcoreapp3.1\win-x64\CefSharp.Test.dll +# dotnet test CefSharp.Test\bin.netcore\x64\Release\netcoreapp3.1\win-x64\CefSharp.Test.dll + +# to run your custom scripts instead of automatic MSBuild +build_script: + - ps: .\build.ps1 + +test: + # Test our Release x64 build + assemblies: + - CefSharp.Test\bin\x64\Release\CefSharp.Test.dll artifacts: - path: NuGet\**\*.nupkg diff --git a/build.netcore.ps1 b/build.netcore.ps1 index 4566b0240a..c856b5402b 100644 --- a/build.netcore.ps1 +++ b/build.netcore.ps1 @@ -3,9 +3,9 @@ [Parameter(Position = 0)] [string] $Target = "netcore31", [Parameter(Position = 1)] - [string] $Version = "92.0.250", + [string] $Version = "93.1.70", [Parameter(Position = 2)] - [string] $AssemblyVersion = "92.0.250" + [string] $AssemblyVersion = "93.1.70" ) $WorkingDir = split-path -parent $MyInvocation.MyCommand.Definition diff --git a/build.ps1 b/build.ps1 index 224f534e09..ad8a36bbc9 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,11 +1,11 @@ param( - [ValidateSet("vs2015", "vs2017", "vs2019", "nupkg-only")] + [ValidateSet("vs2019", "nupkg-only")] [Parameter(Position = 0)] - [string] $Target = "vs2015", + [string] $Target = "vs2019", [Parameter(Position = 1)] - [string] $Version = "92.0.250", + [string] $Version = "93.1.70", [Parameter(Position = 2)] - [string] $AssemblyVersion = "92.0.250" + [string] $AssemblyVersion = "93.1.70" ) $WorkingDir = split-path -parent $MyInvocation.MyCommand.Definition @@ -430,16 +430,6 @@ switch -Exact ($Target) { Nupkg } - "vs2015" - { - VSX v140 - Nupkg - } - "vs2017" - { - VSX v141 - Nupkg - } "vs2019" { VSX v142