Skip to content

Commit

Permalink
Core - Remove Remaining Plugin APIs
Browse files Browse the repository at this point in the history
- Remove plugin references
- Update xml doc comments
- Update ref assembly (netcore)
- Update examples

Issue #4045
  • Loading branch information
amaitland committed Mar 21, 2022
1 parent e6d9aba commit 0ac43cf
Show file tree
Hide file tree
Showing 27 changed files with 9 additions and 411 deletions.
8 changes: 4 additions & 4 deletions CefSharp.BrowserSubprocess.Core/BrowserSubprocessExecutable.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace CefSharp

/// <summary>
/// This function should be called from the application entry point function (typically Program.Main)
/// to execute a secondary process e.g. gpu, plugin, renderer, utility
/// to execute a secondary process e.g. gpu, renderer, utility
/// This overload is specifically used for .Net Core. For hosting your own BrowserSubProcess
/// it's preferable to use the Main method provided by this class.
/// - Obtains the command line args via a call to Environment::GetCommandLineArgs
Expand All @@ -49,7 +49,7 @@ namespace CefSharp

/// <summary>
/// This function should be called from the application entry point function (typically Program.Main)
/// to execute a secondary process e.g. gpu, plugin, renderer, utility
/// to execute a secondary process e.g. gpu, renderer, utility
/// This overload is specifically used for .Net Core. For hosting your own BrowserSubProcess
/// it's preferable to use the Main method provided by this class.
/// - Obtains the command line args via a call to Environment::GetCommandLineArgs
Expand All @@ -72,7 +72,7 @@ namespace CefSharp

/// <summary>
/// This function should be called from the application entry point function (typically Program.Main)
/// to execute a secondary process e.g. gpu, plugin, renderer, utility
/// to execute a secondary process e.g. gpu, renderer, utility
/// It can be used to run secondary processes (BrowserSubProcess) from your main applications executable
/// or from a separate executable specified by the CefSettings.BrowserSubprocessPath value.
/// CefSharp defaults to using the latter approach, a default implementation (CefSharp.BrowserSubProcess.exe) is
Expand All @@ -91,7 +91,7 @@ namespace CefSharp

/// <summary>
/// This function should be called from the application entry point function (typically Program.Main)
/// to execute a secondary process e.g. gpu, plugin, renderer, utility
/// to execute a secondary process e.g. gpu, renderer, utility
/// It can be used to run secondary processes (BrowserSubProcess) from your main applications executable
/// or from a separate executable specified by the CefSettings.BrowserSubprocessPath value.
/// CefSharp defaults to using the latter approach, a default implementation (CefSharp.BrowserSubProcess.exe) is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public BrowserSettings(bool autoDispose) { }
public virtual CefSharp.CefState LocalStorage { get { throw null; } set { } }
public virtual int MinimumFontSize { get { throw null; } set { } }
public virtual int MinimumLogicalFontSize { get { throw null; } set { } }
public virtual CefSharp.CefState Plugins { get { throw null; } set { } }
public virtual CefSharp.CefState RemoteFonts { get { throw null; } set { } }
public virtual string SansSerifFontFamily { get { throw null; } set { } }
public virtual string SerifFontFamily { get { throw null; } set { } }
Expand Down Expand Up @@ -77,23 +76,19 @@ public static void EnableWaitForBrowsersToClose() { }
public static CefSharp.IRequestContext GetGlobalRequestContext() { throw null; }
public static string GetMimeType(string extension) { throw null; }
public static int GetMinLogLevel() { throw null; }
public static System.Threading.Tasks.Task<System.Collections.Generic.List<CefSharp.WebPluginInfo>> GetPlugins() { throw null; }
public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings) { throw null; }
public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings, bool performDependencyCheck) { throw null; }
public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings, bool performDependencyCheck, CefSharp.IApp cefApp) { throw null; }
public static bool Initialize(CefSharp.Core.CefSettingsBase cefSettings, bool performDependencyCheck, CefSharp.IBrowserProcessHandler browserProcessHandler) { throw null; }
public static CefSharp.UrlParts ParseUrl(string url) { throw null; }
public static void PreShutdown() { }
public static void QuitMessageLoop() { }
public static void RefreshWebPlugins() { }
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() { }
public static void SetCrashKeyValue(string key, string value) { }
public static void Shutdown() { }
public static void ShutdownWithoutChecks() { }
public static void UnregisterInternalWebPlugin(string path) { }
public static void VisitWebPluginInfo(CefSharp.IWebPluginInfoVisitor visitor) { }
public static void WaitForBrowsersToClose() { }
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Expand Down
10 changes: 0 additions & 10 deletions CefSharp.Core.Runtime/BrowserSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,6 @@ namespace CefSharp
void set(CefState value) { _browserSettings->javascript_dom_paste = (cef_state_t)value; }
}

/// <summary>
/// Controls whether any plugins will be loaded. Also configurable using the
/// "disable-plugins" command-line switch.
/// </summary>
virtual property CefState Plugins
{
CefState get() { return (CefState)_browserSettings->plugins; }
void set(CefState value) { _browserSettings->plugins = (cef_state_t)value; }
}

/// <summary>
/// Controls whether image URLs will be loaded from the network. A cached image
/// will still be rendered if requested. Also configurable using the
Expand Down
42 changes: 0 additions & 42 deletions CefSharp.Core.Runtime/Cef.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
#include <msclr/marshal.h>
#include <include/cef_version.h>
#include <include/cef_origin_whitelist.h>
#include <include/cef_web_plugin.h>
#include <include/cef_crash_util.h>
#include <include/cef_parser.h>
#include <include/internal/cef_types.h>

#include "Internals/CefSharpApp.h"
#include "Internals/CefWebPluginInfoVisitorAdapter.h"
#include "Internals/CefTaskScheduler.h"
#include "CookieManager.h"
#include "CefSettingsBase.h"
Expand Down Expand Up @@ -637,46 +635,6 @@ namespace CefSharp
return CefClearSchemeHandlerFactories();
}

/// <summary>
/// Visit web plugin information. Can be called on any thread in the browser process.
/// </summary>
static void VisitWebPluginInfo(IWebPluginInfoVisitor^ visitor)
{
CefVisitWebPluginInfo(new CefWebPluginInfoVisitorAdapter(visitor));
}

/// <summary>
/// Async returns a list containing Plugin Information
/// (Wrapper around CefVisitWebPluginInfo)
/// </summary>
/// <returns>Returns List of <see cref="WebPluginInfo"/> structs.</returns>
static Task<List<WebPluginInfo^>^>^ GetPlugins()
{
auto taskVisitor = gcnew TaskWebPluginInfoVisitor();
CefRefPtr<CefWebPluginInfoVisitorAdapter> visitor = new CefWebPluginInfoVisitorAdapter(taskVisitor);

CefVisitWebPluginInfo(visitor);

return taskVisitor->Task;
}

/// <summary>
/// Cause the plugin list to refresh the next time it is accessed regardless of whether it has already been loaded.
/// </summary>
static void RefreshWebPlugins()
{
CefRefreshWebPlugins();
}

/// <summary>
/// Unregister an internal plugin. This may be undone the next time RefreshWebPlugins() is called.
/// </summary>
/// <param name="path">Path (directory + file).</param>
static void UnregisterInternalWebPlugin(String^ path)
{
CefUnregisterInternalWebPlugin(StringUtils::ToNative(path));
}

/// <summary>
/// Call during process startup to enable High-DPI support on Windows 7 or newer.
/// Older versions of Windows should be left DPI-unaware because they do not
Expand Down
1 change: 0 additions & 1 deletion CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@
<ClInclude Include="Internals\JavascriptCallbackFactory.h" />
<ClInclude Include="Internals\MCefRefPtr.h" />
<ClInclude Include="Internals\Messaging\Messages.h" />
<ClInclude Include="Internals\CefWebPluginInfoVisitorAdapter.h" />

This comment has been minimized.

Copy link
@kpreisser

kpreisser Mar 23, 2022

Contributor

Hi @amaitland, doesn't this also need to be removed from CefSharp.Core.Runtime.netcore.vcxproj? It still contains this line although the referenced file was deleted.
Thanks!

This comment has been minimized.

Copy link
@amaitland

amaitland Mar 23, 2022

Author Member

Yes it needs to be removed. I just ran out of time to build the netcore solution.

Issue #4045 is still open until the final issues are resolved.

This comment has been minimized.

Copy link
@amaitland

amaitland Mar 23, 2022

Author Member

I should have time to review and fix the remaining issues tomorrow.

Let me know if you spot anything else, thanks 👍

<ClInclude Include="Internals\RenderClientAdapter.h" />
<ClInclude Include="Internals\ReportUnhandledExceptions.h" />
<ClInclude Include="Internals\CefRequestCallbackWrapper.h" />
Expand Down
3 changes: 0 additions & 3 deletions CefSharp.Core.Runtime/CefSharp.Core.Runtime.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,6 @@
<ClInclude Include="Internals\CefSchemeHandlerFactoryAdapter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Internals\CefWebPluginInfoVisitorAdapter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Internals\CefResourceHandlerAdapter.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down
44 changes: 0 additions & 44 deletions CefSharp.Core.Runtime/Internals/CefWebPluginInfoVisitorAdapter.h

This file was deleted.

12 changes: 0 additions & 12 deletions CefSharp.Core.Runtime/Internals/ClientAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,18 +666,6 @@ namespace CefSharp
return handler->OnQuotaRequest(_browserControl, browserWrapper, StringUtils::ToClr(originUrl), newSize, requestCallback);
}

void ClientAdapter::OnPluginCrashed(CefRefPtr<CefBrowser> browser, const CefString& plugin_path)
{
auto handler = _browserControl->RequestHandler;

if (handler != nullptr)
{
auto browserWrapper = GetBrowserWrapper(browser->GetIdentifier(), browser->IsPopup());

handler->OnPluginCrashed(_browserControl, browserWrapper, StringUtils::ToClr(plugin_path));
}
}

void ClientAdapter::OnRenderViewReady(CefRefPtr<CefBrowser> browser)
{
auto handler = _browserControl->RequestHandler;
Expand Down
1 change: 0 additions & 1 deletion CefSharp.Core.Runtime/Internals/ClientAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ namespace CefSharp
virtual DECL bool OnCertificateError(CefRefPtr<CefBrowser> browser, cef_errorcode_t cert_error, const CefString& request_url, CefRefPtr<CefSSLInfo> ssl_info, CefRefPtr<CefCallback> callback) override;
virtual DECL bool OnSelectClientCertificate(CefRefPtr<CefBrowser> browser, bool isProxy, const CefString& host, int port,
const CefRequestHandler::X509CertificateList& certificates, CefRefPtr<CefSelectClientCertificateCallback> callback) override;
virtual DECL void OnPluginCrashed(CefRefPtr<CefBrowser> browser, const CefString& plugin_path) override;
virtual DECL void OnRenderViewReady(CefRefPtr<CefBrowser> browser) override;
virtual DECL void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser, TerminationStatus status) override;
virtual DECL void OnDocumentAvailableInMainFrame(CefRefPtr<CefBrowser> browser) override;
Expand Down
9 changes: 0 additions & 9 deletions CefSharp.Core.Runtime/Internals/TypeConversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "include/internal/cef_ptr.h"
#include "include\cef_download_item.h"
#include "include\cef_response.h"
#include "include\cef_web_plugin.h"

#include "Serialization\ObjectsSerialization.h"
#include "Serialization\V8Serialization.h"
Expand Down Expand Up @@ -88,14 +87,6 @@ namespace CefSharp
return Nullable<DateTime>(DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(epoch).ToLocalTime());
}

static WebPluginInfo^ FromNative(CefRefPtr<CefWebPluginInfo> webPluginInfo)
{
return gcnew WebPluginInfo(StringUtils::ToClr(webPluginInfo->GetName()),
StringUtils::ToClr(webPluginInfo->GetDescription()),
StringUtils::ToClr(webPluginInfo->GetPath()),
StringUtils::ToClr(webPluginInfo->GetVersion()));
}

static IList<DraggableRegion>^ FromNative(const std::vector<CefDraggableRegion>& regions)
{
if (regions.size() == 0)
Expand Down
7 changes: 0 additions & 7 deletions CefSharp.Core/BrowserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,6 @@ public CefState JavascriptDomPaste
set { settings.JavascriptDomPaste = value; }
}

/// <inheritdoc/>
public CefState Plugins
{
get { return settings.Plugins; }
set { settings.Plugins = value; }
}

/// <inheritdoc/>
public CefState ImageLoading
{
Expand Down
2 changes: 1 addition & 1 deletion CefSharp.Core/BrowserSubprocess/SelfHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class SelfHost
{
/// <summary>
/// This function should be called from the application entry point function (typically Program.Main)
/// to execute a secondary process e.g. gpu, plugin, renderer, utility
/// to execute a secondary process e.g. gpu, renderer, utility
/// This overload is specifically used for .Net Core. For hosting your own BrowserSubProcess
/// it's preferable to use the Main method provided by this class.
/// - Pass in command line args
Expand Down
35 changes: 0 additions & 35 deletions CefSharp.Core/Cef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,41 +408,6 @@ public static bool ClearSchemeHandlerFactories()
return Core.Cef.ClearSchemeHandlerFactories();
}

/// <summary>
/// Visit web plugin information. Can be called on any thread in the browser process.
/// </summary>
public static void VisitWebPluginInfo(IWebPluginInfoVisitor visitor)
{
Core.Cef.VisitWebPluginInfo(visitor);
}

/// <summary>
/// Async returns a list containing Plugin Information
/// (Wrapper around CefVisitWebPluginInfo)
/// </summary>
/// <returns>Returns List of <see cref="WebPluginInfo"/> structs.</returns>
public static Task<List<WebPluginInfo>> GetPlugins()
{
return Core.Cef.GetPlugins();
}

/// <summary>
/// Cause the plugin list to refresh the next time it is accessed regardless of whether it has already been loaded.
/// </summary>
public static void RefreshWebPlugins()
{
Core.Cef.RefreshWebPlugins();
}

/// <summary>
/// Unregister an internal plugin. This may be undone the next time RefreshWebPlugins() is called.
/// </summary>
/// <param name="path">Path (directory + file).</param>
public static void UnregisterInternalWebPlugin(string path)
{
Core.Cef.UnregisterInternalWebPlugin(path);
}

/// <summary>
/// Call during process startup to enable High-DPI support on Windows 7 or newer.
/// Older versions of Windows should be left DPI-unaware because they do not
Expand Down
Loading

0 comments on commit 0ac43cf

Please sign in to comment.